How to start from scratch an Ado application?

31 views
Skip to first unread message

fortizmu

unread,
Mar 9, 2015, 11:56:34 AM3/9/15
to ado...@googlegroups.com
Hi Krasi,

you mentioned in a previous thread:

"
Ado is a regular Mojo application.
You only need to create a controller under the Ado::Control namespace
I hope you have read http://mojolicio.us/perldoc/Mojolicious/Guides/Growing
Ado is build following these principles.

You can try
$ ado generate crud
to generate a stub set of files
or
$ ado generate adoplugin

Also look at
$ ado generate apache2vhost
$ ado generate apache2htaccess
if you want to run ado with Apache and fcgid
"

I must admit that I have to take a detailed look to http://mojolicio.us/perldoc/Mojolicious/Guides/Growing for a better understanding.

Please take into account that I'm starting from scratch, without deep previous knowledge about Mojolicious.
The commands help messages are self explanatory. I tried out, and got the following messages:

[fortizmu@web433 learningmojo]$ ado generate crud --tables='hello,news,articles'
  [mkdir] /home/fortizmu/lib/perl5/perls/perl-5.18.0/lib/Ado/Control
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/lib/Ado/Control/Hello.pm
  [mkdir] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello/list.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello/create.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello/read.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/hello/delete.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/lib/Ado/Control
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/lib/Ado/Control/News.pm
  [mkdir] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news/list.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news/create.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news/read.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/news/delete.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/lib/Ado/Control
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/lib/Ado/Control/Articles.pm
  [mkdir] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles/list.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles/create.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles/read.html.ep
  [exist] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles
  [write] /home/fortizmu/lib/perl5/perls/perl-5.18.0/templates/articles/delete.html.ep

[fortizmu@web433 learningmojo]$  ado generate adoplugin --name MyAdoTest
  [mkdir] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest/lib/Ado/Plugin
  [write] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest/lib/Ado/Plugin/MyAdoTest.pm
  [mkdir] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest/t/plugin
  [write] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest/t/plugin/my_ado_test-00.t
  [exist] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest
  [write] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest/Build.PL
  [mkdir] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest/etc/plugins
  [write] /home/fortizmu/webapps/learningmojo/Ado-Plugin-MyAdoTest/etc/plugins/my_ado_test.conf

[fortizmu@web433 learningmojo]$ ado generate apache2htaccess --modules cgi,fcgid > .htaccess
Can't open file "/home/fortizmu/webapps/learningmojo/templates/partials/apache2htaccess.ep": No such file or directory at /home/fortizmu/lib/perl5/perls/perl-5.18.0/lib/site_perl/5.18.0/Mojo/Template.pm line 239.


Taking a look to the last output, it looks like there is something missing, maybe I have to run another command? or any other needed setup?
 
Kind regards,
Francisco




Krasimir Berov

unread,
Mar 9, 2015, 7:33:04 PM3/9/15
to fortizmu, ado...@googlegroups.com
Ah :), so it is time for me to write a tutorial :).
I have something basic now.
https://metacpan.org/pod/distribution/Ado/lib/Ado/Manual/Plugins.pod
An overview of Ado
http://www.slideshare.net/kberov/ado-yapceu2014

Ado expects at least basic knowledge of Mojo.
I simply followed the Growing guide and created Ado, so this work is already done. but one still needs to understand how Mojo works.

Regards,


--
You received this message because you are subscribed to the Google Groups "Ado-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ado-dev+u...@googlegroups.com.
To post to this group, send email to ado...@googlegroups.com.
Visit this group at http://groups.google.com/group/ado-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/ado-dev/cec86de5-8a98-4a02-bd43-6c2d669177f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--
---------------------------------------------------
With Regards: Краси Беров
https://www.linkedin.com/in/berov
--------------------------------------------------
Reply all
Reply to author
Forward
0 new messages