SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Ado
(framework for web-projects on Mojolicious)
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Table of Contents
●
What is it?
●
What it provides?
●
Minimal Core
●
Plugins
●
Commands
●
Applications
●
Demo
●
Credits
●
Contributors? Investors? Sponsors?
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
●
Ado is:
–
busy or delaying activity; bustle; fuss - суматоха, бъркотия,
суетня. http://www.thefreedictionary.com/ado
–
Yet another Perl module on CPAN: https://metacpan.org/pod/Ado
–
A set of mojo commands: ~/$ ado adduser
–
A (Mojolicious) application:
require Mojolicious::Commands;
Mojolicious::Commands->start_app('Ado');
–
A CMS!, A CRM!, An ERP!..
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
●
Ado's purpose is to quickly put together a web
application based on Mojolicious with scalability,
performance and growth in mind.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
●
An Ado system starts as a lightweight but well
structured application that can turn into an ERP,
a CMS, a CRM or all in one by just adding
plugins along the way, as the organization,
which is using it grows.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
Linux, Mac OSX, Free BSD, Windows...
Perl SQLite, MySQL, Postgre SQL
Mojolicious
Ado framework = Ado App + Mojolicious Plugins
Ado-based applications
Ado::Plugin::Vest
Ado::Plugin::Site
Ado::Plugin::Admin
Ado::Plugin::Shop
Ado::Plugin::Store
Ado::Plugin::XYZ
Layers / Blocks
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What it provides?
●
Glue code, that you otherwise write every time
you start a new Mojolicious project.
●
Default configuration in etc/ado.conf.
●
Database in etc/ado.sqlite. MySQL or
PostgreSQL can be used.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What it provides?
●
Default name-space for controllers:
Ado::Control::*. You can use your own.
●
Model: Ado::Model::* based on
DBIx::Simple::Class. You can generate your
classes on the fly.
●
Additional Commands: Ado::Command::*.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What it provides?
●
Examples – Ado is a Mojolicious application,
aiming to be a good example.
●
Semantic-UI CSS/JS framework in
public/vendor/Semantic-UI.
●
Always up to date with latest Mojolicious!
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Minimal Core
●
Ado strives to provide just the code that you
otherwise have to write with every next
Mojolicious project.
●
Bundled Semantic-UI for UI.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Minimal Core
●
Additional assets (CSS, JS, templates) are
optional.
Mojolicious::Plugin::AssetPack can be used to
manage them.
●
All plugins are (should be) optional. Use them if
you wish!
●
Enough to start a personal site in minutes.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Any Mojolicious::Plugin::* can be used.
●
Ado::Plugin is the base class for Ado plugins.
It allows you to use plugin-specific and
mode-specific configuration files:
–
Ado/etc/plugins/routes.conf
–
Ado/etc/plugins/routes.development.conf
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
JSON and Perl configuration file formats are
supported.
●
Any configuration format is supported as long as
Mojolicious::Plugin::XYZConfig follows the Mojo
API.
●
Every Ado plugin ISA Mojolicious::Plugin!
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::I18n localizes your application and site.
–
automatically detects the current UserAgent language preferences
–
Options can be set in etc/ado.conf or in etc/plugins/i18n.conf:
–
language_from_route => 1, # eg. /bg/news/list
–
language_from_host => 1, # eg. fr.example.com
–
language_from_param => 1, # eg. ?language=de
–
language_from_cookie => 1, # eg. Cookie: language=bg;
–
language_from_headers => 1, # eg. Accept-Language: bg,fr;q=0.8,en-us;q=0.5,en;q=0.3
–
Helpers:
–
l() - <%= l('hello', user->name) %>
–
language() - Allows you to (re)set the current language. No need to use this helper!
–
It is called automatically in Mojolicious/around_action hook.
–
Storage of translation entries in the database is planned.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::Routes allows you to define your routes in a
separate file $MOJO_HOME/etc/plugins/routes.conf.
●
In the configuration file you can also use the app keyword
and add complex routes as you would do directly in the
code.
●
Options:
–
routes => [
–
{route => '/ado-users', via => ['GET'],
–
to => 'ado-users#list',},
–
...
–
],
–
base_url_path =>'/'
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::MarkdownRenderer is a markdown
renderer.
●
Text::MultiMarkdown is the default renderer. Support for
other is planned.
●
Create a controller and use the md_to_html helper.
See Ado::Control::Doc for an example.
●
Many options. See the docs.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::MarkdownRenderer Helpers:
–
markdown - Accepts markdown text and options. Returns
HTML.
#in a template
%==markdown($text)
–
md_to_html
<%= md_to_html($file_path) %>
% #<article>$html</article>
–
%# using $c->stash('md_file')
<%= md_to_html() %>
% #<article>$html</article>
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::Auth authenticates users to an Ado system.
●
Users can be authenticated locally or (TODO!) using
Facebook, Google, Twitter and other authentication
service-providers.
●
Mojolicious::Plugin::OAuth2 is planned as dependency.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::AdoHelpers will be a collection of helpers
for Ado if we need even more.
●
Mojolicious::Plugin::DefaultHelpers,
Mojolicious::Plugin::TagHelpers
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::version shows version information for
installed core and optional modules.
–
$ ado version
–
ADO:
–
0.55 - U+2C04 GLAGOLITIC CAPITAL LETTER DOBRO ( )Ⰴ
–
Thanks for testing a development release, you are awesome!
–
CORE
–
Perl (v5.18.2, linux)
–
Mojolicious (5.18, Tiger Face)
–
OPTIONAL
–
EV 4.0+ (4.17)
–
IO::Socket::IP 0.20+ (0.29)
–
IO::Socket::SSL 1.84+ (1.962)
–
This version is up to date, have fun!
–
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::adduser adds a user to an Ado
application. It is a facade for Ado::Model::Users.
●
$ ado adduser
USAGE:
# Minimal required options to add a user
bin/ado adduser --login_name USERNAME --email user@example.com
--first_name John --last_name Smith
# Add a user to an additional group
bin/ado adduser --login_name USERNAME --ingroup GROUPNAME
# Change password / disable a user
bin/ado adduser --login_name USERNAME --ingroup GROUPNAME --disabled
--login_password !@#$%^&
See perldoc Ado::Command::adduser for full set of options.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::generate::apache2vhost generates a
minimal Apache2 Virtual Host configuration file for your
Ado application.
●
On the command-line:
$ bin/ado generate apache2vhost --ServerName example.com -s 
> etc/001-example.com.vhost.conf
In your code:
use Ado::Command::generate::apache2vhost;
my $vhost = Ado::Command::generate::apache2vhost->new;
$vhost->run('--ServerName' => 'example.com', '-p' => 8080);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::generate::apache2htaccess
generates an Apache2 .htaccess configuration
file. Use this command on a shared hosting too.
–
ado generate apache2htaccess --module cgi,fcgid 
> .htaccess
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::generate::adoplugin generates
an Ado::Plugin.
–
$ ado generate adoplugin --name MyBlog
–
$ ado generate adoplugin --name MyBlog –crud 
-t 'articles,news'
●
Ado::Command::generate::crud generates MVC
set of files.
–
$ ado generate crud --tables='news,articles'
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
dsc_dump_schema.pl is a script to dump a schema
from a database. Comes with DBIx::Simple::Class.
●
#dump all tables
dsc_dump_schema.pl --dsn
DBI:mysql:database=mydb;host=127.0.0.1;mysql_enable_utf8=1 
-u me -p mypassword --overwrite 1 --lib_root ./lib
●
#or dump only the "users" table - using short options and
choosing a namespace
dsc_dump_schema.pl -dsn dbi:SQLite:database=etc/ado.sqlite 
-n Ado::Model -l lib -t users
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Applications
●
Entire custom applications can be created by just using
your own plugins.
●
You can directly inherit Ado. Ado ISA Mojolicious.
●
Use Mojolicious Plugins
–
Preferably written by someone of the Mojolicious core
development-team.
–
Look in the code and decide if it is well written.
–
Make sure it is often updated and works with latest Mojo.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Contributors? Investors? Sponsors?
●
See Ado::Manual::Contributing.
●
Hire me to implement your Ideas.
●
Use Ado and report issues.
●
Convince your boss Ado worths it.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Credits
●
Вълчо Неделчев (Valcho Nedelchev)
–
Helped by writing code, moral support and feedback.
●
Станислав Лечев (Stanislav Lechev)
–
Helped by providing free hosting for the Ado demo site
http://ado.0xaf.org/, moral support and feedback.
●
You?
–
Ideas, feature requests, code, design, Mojo mastery...
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Create one or more tables to be used by your plugin.
●
CREATE TABLE blog (
id INTEGER PRIMARY KEY,
title VARCHAR NOT NULL UNIQUE,
body TEXT NOT NULL,
published BOOL DEFAULT '0',
deleted BOOL NOT NULL DEFAULT '0',
user_id INTEGER REFERENCES users(id),
group_id INTEGER REFERENCES groups(id),
permissions VARCHAR(10) DEFAULT '-rwxr-xr-xr'
);
CREATE INDEX blog_published ON blog(published);
CREATE INDEX blog_deleted ON blog(deleted);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Add some dummy records.
●
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey','Hello world',3,3);
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey You','Hello Universe',3,3);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Generate your plugin:
●
$ ado generate adoplugin -n Blog --crud -t blog
●
[mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin/Blog.pm
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Control/Blog.pm
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/list.html.ep
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/create.html.ep
…
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/t/plugin/blog-00.t
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/Build.PL
[mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/blog.conf
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Add some dummy records.
●
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey','Hello world',3,3);
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey You','Hello Universe',3,3);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Copy blog.conf to blog.development.conf and edit blog.development.conf
●
$ ado generate adoplugin -n Blog --crud -t blog
●
cd /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/
●
cp blog.conf blog.development.conf
●
Edit etc/ado.development.conf to make Ado know about
it:
●
plugins => [
…
'blog',
]
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Run Ado with your new plugin to see if it works.
●
$ export PERL5LIB=$HOME/opt/public_dev/Ado-Plugin-Blog/lib:$PERL5LIB
●
$ ado daemon
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
It works:
●
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Благодаря!
●
Thanks!
●
Merci!
●
Díky!!
●
Multumesc!
●
Спасибо!

Weitere ähnliche Inhalte

Mehr von Krasimir Berov (Красимир Беров) (16)

Хешове
ХешовеХешове
Хешове
 
Списъци и масиви
Списъци и масивиСписъци и масиви
Списъци и масиви
 
Скаларни типове данни
Скаларни типове данниСкаларни типове данни
Скаларни типове данни
 
Въведение в Perl
Въведение в PerlВъведение в Perl
Въведение в Perl
 
System Programming and Administration
System Programming and AdministrationSystem Programming and Administration
System Programming and Administration
 
Network programming
Network programmingNetwork programming
Network programming
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Working with databases
Working with databasesWorking with databases
Working with databases
 
Working with text, Regular expressions
Working with text, Regular expressionsWorking with text, Regular expressions
Working with text, Regular expressions
 
Subroutines
SubroutinesSubroutines
Subroutines
 
IO Streams, Files and Directories
IO Streams, Files and DirectoriesIO Streams, Files and Directories
IO Streams, Files and Directories
 
Syntax
SyntaxSyntax
Syntax
 
Hashes
HashesHashes
Hashes
 
Lists and arrays
Lists and arraysLists and arrays
Lists and arrays
 
Scalar data types
Scalar data typesScalar data types
Scalar data types
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 

Kürzlich hochgeladen

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Kürzlich hochgeladen (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

Ado (framework for web-projects on Mojolicious)

  • 1. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Ado (framework for web-projects on Mojolicious)
  • 2. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Table of Contents ● What is it? ● What it provides? ● Minimal Core ● Plugins ● Commands ● Applications ● Demo ● Credits ● Contributors? Investors? Sponsors?
  • 3. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? ● Ado is: – busy or delaying activity; bustle; fuss - суматоха, бъркотия, суетня. http://www.thefreedictionary.com/ado – Yet another Perl module on CPAN: https://metacpan.org/pod/Ado – A set of mojo commands: ~/$ ado adduser – A (Mojolicious) application: require Mojolicious::Commands; Mojolicious::Commands->start_app('Ado'); – A CMS!, A CRM!, An ERP!..
  • 4. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? ● Ado's purpose is to quickly put together a web application based on Mojolicious with scalability, performance and growth in mind.
  • 5. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? ● An Ado system starts as a lightweight but well structured application that can turn into an ERP, a CMS, a CRM or all in one by just adding plugins along the way, as the organization, which is using it grows.
  • 6. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? Linux, Mac OSX, Free BSD, Windows... Perl SQLite, MySQL, Postgre SQL Mojolicious Ado framework = Ado App + Mojolicious Plugins Ado-based applications Ado::Plugin::Vest Ado::Plugin::Site Ado::Plugin::Admin Ado::Plugin::Shop Ado::Plugin::Store Ado::Plugin::XYZ Layers / Blocks
  • 7. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What it provides? ● Glue code, that you otherwise write every time you start a new Mojolicious project. ● Default configuration in etc/ado.conf. ● Database in etc/ado.sqlite. MySQL or PostgreSQL can be used.
  • 8. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What it provides? ● Default name-space for controllers: Ado::Control::*. You can use your own. ● Model: Ado::Model::* based on DBIx::Simple::Class. You can generate your classes on the fly. ● Additional Commands: Ado::Command::*.
  • 9. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What it provides? ● Examples – Ado is a Mojolicious application, aiming to be a good example. ● Semantic-UI CSS/JS framework in public/vendor/Semantic-UI. ● Always up to date with latest Mojolicious!
  • 10. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Minimal Core ● Ado strives to provide just the code that you otherwise have to write with every next Mojolicious project. ● Bundled Semantic-UI for UI.
  • 11. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Minimal Core ● Additional assets (CSS, JS, templates) are optional. Mojolicious::Plugin::AssetPack can be used to manage them. ● All plugins are (should be) optional. Use them if you wish! ● Enough to start a personal site in minutes.
  • 12. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Any Mojolicious::Plugin::* can be used. ● Ado::Plugin is the base class for Ado plugins. It allows you to use plugin-specific and mode-specific configuration files: – Ado/etc/plugins/routes.conf – Ado/etc/plugins/routes.development.conf
  • 13. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● JSON and Perl configuration file formats are supported. ● Any configuration format is supported as long as Mojolicious::Plugin::XYZConfig follows the Mojo API. ● Every Ado plugin ISA Mojolicious::Plugin!
  • 14. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::I18n localizes your application and site. – automatically detects the current UserAgent language preferences – Options can be set in etc/ado.conf or in etc/plugins/i18n.conf: – language_from_route => 1, # eg. /bg/news/list – language_from_host => 1, # eg. fr.example.com – language_from_param => 1, # eg. ?language=de – language_from_cookie => 1, # eg. Cookie: language=bg; – language_from_headers => 1, # eg. Accept-Language: bg,fr;q=0.8,en-us;q=0.5,en;q=0.3 – Helpers: – l() - <%= l('hello', user->name) %> – language() - Allows you to (re)set the current language. No need to use this helper! – It is called automatically in Mojolicious/around_action hook. – Storage of translation entries in the database is planned.
  • 15. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::Routes allows you to define your routes in a separate file $MOJO_HOME/etc/plugins/routes.conf. ● In the configuration file you can also use the app keyword and add complex routes as you would do directly in the code. ● Options: – routes => [ – {route => '/ado-users', via => ['GET'], – to => 'ado-users#list',}, – ... – ], – base_url_path =>'/'
  • 16. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::MarkdownRenderer is a markdown renderer. ● Text::MultiMarkdown is the default renderer. Support for other is planned. ● Create a controller and use the md_to_html helper. See Ado::Control::Doc for an example. ● Many options. See the docs.
  • 17. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::MarkdownRenderer Helpers: – markdown - Accepts markdown text and options. Returns HTML. #in a template %==markdown($text) – md_to_html <%= md_to_html($file_path) %> % #<article>$html</article> – %# using $c->stash('md_file') <%= md_to_html() %> % #<article>$html</article>
  • 18. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::Auth authenticates users to an Ado system. ● Users can be authenticated locally or (TODO!) using Facebook, Google, Twitter and other authentication service-providers. ● Mojolicious::Plugin::OAuth2 is planned as dependency.
  • 19. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::AdoHelpers will be a collection of helpers for Ado if we need even more. ● Mojolicious::Plugin::DefaultHelpers, Mojolicious::Plugin::TagHelpers
  • 20. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::version shows version information for installed core and optional modules. – $ ado version – ADO: – 0.55 - U+2C04 GLAGOLITIC CAPITAL LETTER DOBRO ( )Ⰴ – Thanks for testing a development release, you are awesome! – CORE – Perl (v5.18.2, linux) – Mojolicious (5.18, Tiger Face) – OPTIONAL – EV 4.0+ (4.17) – IO::Socket::IP 0.20+ (0.29) – IO::Socket::SSL 1.84+ (1.962) – This version is up to date, have fun! –
  • 21. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::adduser adds a user to an Ado application. It is a facade for Ado::Model::Users. ● $ ado adduser USAGE: # Minimal required options to add a user bin/ado adduser --login_name USERNAME --email user@example.com --first_name John --last_name Smith # Add a user to an additional group bin/ado adduser --login_name USERNAME --ingroup GROUPNAME # Change password / disable a user bin/ado adduser --login_name USERNAME --ingroup GROUPNAME --disabled --login_password !@#$%^& See perldoc Ado::Command::adduser for full set of options.
  • 22. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::generate::apache2vhost generates a minimal Apache2 Virtual Host configuration file for your Ado application. ● On the command-line: $ bin/ado generate apache2vhost --ServerName example.com -s > etc/001-example.com.vhost.conf In your code: use Ado::Command::generate::apache2vhost; my $vhost = Ado::Command::generate::apache2vhost->new; $vhost->run('--ServerName' => 'example.com', '-p' => 8080);
  • 23. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::generate::apache2htaccess generates an Apache2 .htaccess configuration file. Use this command on a shared hosting too. – ado generate apache2htaccess --module cgi,fcgid > .htaccess
  • 24. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::generate::adoplugin generates an Ado::Plugin. – $ ado generate adoplugin --name MyBlog – $ ado generate adoplugin --name MyBlog –crud -t 'articles,news' ● Ado::Command::generate::crud generates MVC set of files. – $ ado generate crud --tables='news,articles'
  • 25. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● dsc_dump_schema.pl is a script to dump a schema from a database. Comes with DBIx::Simple::Class. ● #dump all tables dsc_dump_schema.pl --dsn DBI:mysql:database=mydb;host=127.0.0.1;mysql_enable_utf8=1 -u me -p mypassword --overwrite 1 --lib_root ./lib ● #or dump only the "users" table - using short options and choosing a namespace dsc_dump_schema.pl -dsn dbi:SQLite:database=etc/ado.sqlite -n Ado::Model -l lib -t users
  • 26. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Applications ● Entire custom applications can be created by just using your own plugins. ● You can directly inherit Ado. Ado ISA Mojolicious. ● Use Mojolicious Plugins – Preferably written by someone of the Mojolicious core development-team. – Look in the code and decide if it is well written. – Make sure it is often updated and works with latest Mojo.
  • 27. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Contributors? Investors? Sponsors? ● See Ado::Manual::Contributing. ● Hire me to implement your Ideas. ● Use Ado and report issues. ● Convince your boss Ado worths it.
  • 28. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Credits ● Вълчо Неделчев (Valcho Nedelchev) – Helped by writing code, moral support and feedback. ● Станислав Лечев (Stanislav Lechev) – Helped by providing free hosting for the Ado demo site http://ado.0xaf.org/, moral support and feedback. ● You? – Ideas, feature requests, code, design, Mojo mastery...
  • 29. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Create one or more tables to be used by your plugin. ● CREATE TABLE blog ( id INTEGER PRIMARY KEY, title VARCHAR NOT NULL UNIQUE, body TEXT NOT NULL, published BOOL DEFAULT '0', deleted BOOL NOT NULL DEFAULT '0', user_id INTEGER REFERENCES users(id), group_id INTEGER REFERENCES groups(id), permissions VARCHAR(10) DEFAULT '-rwxr-xr-xr' ); CREATE INDEX blog_published ON blog(published); CREATE INDEX blog_deleted ON blog(deleted);
  • 30. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Add some dummy records. ● INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey','Hello world',3,3); INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey You','Hello Universe',3,3);
  • 31. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Generate your plugin: ● $ ado generate adoplugin -n Blog --crud -t blog ● [mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin/Blog.pm [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Control/Blog.pm [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/list.html.ep [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/create.html.ep … [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/t/plugin/blog-00.t [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/Build.PL [mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/blog.conf
  • 32. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Add some dummy records. ● INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey','Hello world',3,3); INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey You','Hello Universe',3,3);
  • 33. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Copy blog.conf to blog.development.conf and edit blog.development.conf ● $ ado generate adoplugin -n Blog --crud -t blog ● cd /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/ ● cp blog.conf blog.development.conf ● Edit etc/ado.development.conf to make Ado know about it: ● plugins => [ … 'blog', ]
  • 34. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Run Ado with your new plugin to see if it works. ● $ export PERL5LIB=$HOME/opt/public_dev/Ado-Plugin-Blog/lib:$PERL5LIB ● $ ado daemon
  • 35. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● It works: ●
  • 36. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Благодаря! ● Thanks! ● Merci! ● Díky!! ● Multumesc! ● Спасибо!