(and that you boot up on the "host machine").
B<Note:> Throughout the tutorial, we will shows the UNIX shell prompt
as "C<$>". If you are using Tutorial VM, the prompt will really be
-"C<root@catalyst:~#>", but we will keep it short (and also use "C<$>" in
+"C<catalyst@catalyst:~#>", but we will keep it short (and also use "C<$>" in
lieu of "C<#>", since "C<#>" looks too much like a Perl comment).
=item 4
-Once you get a login prompt, enter the username B<root> and a password
-for C<catalyst>. You should now be at a prompt that looks like:
+Once you get a login prompt, enter the username B<catalyst> and a
+password for C<catalyst>. You should now be at a prompt that looks
+like:
- catalyst login: root
+ catalyst login: catalyst
Password: catalyst
...
- root@catalyst:~#
+ catalyst@catalyst:~#
=item 5
B<From your main desktop machine>, open an SSH client and connect to the
IP address found in the previous step. You should get a login prompt
(accept the SSH key if you get a warning message about that). Login
-with the same username and password as we used in Step 4: B<root> /
+with the same username and password as we used in Step 4: B<catalyst> /
B<catalyst>
- catalyst login: root
+ catalyst login: catalyst
Password: catalyst
...
- root@catalyst:~#
+ catalyst@catalyst:~#
=item 7
You may note that the Tutorial Virtual Machine uses L<local::lib> so
-that the Perl modules are run from ~/perl5 (in this case, /root/perl5)
-vs. the usual location of your "system Perl". We recommend that you
-also consider using this very handy module. It can greatly ease the
-process of maintaining and testing different combinations or Perl
-modules across development, staging, and production servers. (The
-"relocatable Perl" feature can also be used to to run both the modules
-B<and> Perl itself from your home directory [or any other directory you
-chose]).
+that the Perl modules are run from ~/perl5 (in this case,
+/home/catalyst/perl5) vs. the usual location of your "system Perl". We
+recommend that you also consider using this very handy module. It can
+greatly ease the process of maintaining and testing different
+combinations or Perl modules across development, staging, and production
+servers. (The "relocatable Perl" feature can also be used to to run
+both the modules B<and> Perl itself from your home directory [or any
+other directory you chose]).
B<Note>: Please provide feedback on how the Virtual Machine approach for
the tutorial works for you. If you have suggestions or comments, you
[debug] Loaded dispatcher "Catalyst::Dispatcher"
[debug] Loaded engine "Catalyst::Engine"
- [debug] Found home "/root/Hello"
- [debug] Loaded Config "/root/Hello/hello.conf"
+ [debug] Found home "/home/catalyst/Hello"
+ [debug] Loaded Config "/home/catalyst/Hello/hello.conf"
[debug] Loaded components:
.-----------------------------------------------------------------+----------.
| Class | Type |
get output similar to the following:
Saw changes to the following files:
- - /root/Hello/lib/Hello/Controller/Root.pm (modify)
+ - /home/catalyst/Hello/lib/Hello/Controller/Root.pm (modify)
Attempting to restart the server
...
environment where we can explore a variety of features used in virtually
all web applications.
-Source code for the tutorial in included in the F</root/Final> directory
-of the Tutorial Virtual machine (one subdirectory per chapter). There
-are also instructions for downloading the code in
+Source code for the tutorial in included in the F</home/catalyst/Final>
+directory of the Tutorial Virtual machine (one subdirectory per
+chapter). There are also instructions for downloading the code in
L<Catalyst::Manual::Tutorial::01_Intro>.
Please take a look at
actions:
$ script/myapp_create.pl controller Books
- exists "/root/MyApp/script/../lib/MyApp/Controller"
- exists "/root/MyApp/script/../t"
- created "/root/MyApp/script/../lib/MyApp/Controller/Books.pm"
- created "/root/MyApp/script/../t/controller_Books.t"
+ exists "/home/catalyst/MyApp/script/../lib/MyApp/Controller"
+ exists "/home/catalyst/MyApp/script/../t"
+ created "/home/catalyst/MyApp/script/../lib/MyApp/Controller/Books.pm"
+ created "/home/catalyst/MyApp/script/../t/controller_Books.t"
Then edit C<lib/MyApp/Controller/Books.pm> (as discussed in
L<Chapter 2|Catalyst::Manual::Tutorial::02_CatalystBasics> of
C<TT> style of view rendering:
$ script/myapp_create.pl view HTML TT
- exists "/root/MyApp/script/../lib/MyApp/View"
- exists "/root/MyApp/script/../t"
- created "/root/MyApp/script/../lib/MyApp/View/HTML.pm"
- created "/root/MyApp/script/../t/view_HTML.t"
+ exists "/home/catalyst/MyApp/script/../lib/MyApp/View"
+ exists "/home/catalyst/MyApp/script/../t"
+ created "/home/catalyst/MyApp/script/../lib/MyApp/View/HTML.pm"
+ created "/home/catalyst/MyApp/script/../t/view_HTML.t"
This creates a view called C<HTML> (the first argument) in a file called
C<HTML.pm> that uses L<Catalyst::View::TT> (the second argument) as the
$ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
create=static dbi:SQLite:myapp.db \
on_connect_do="PRAGMA foreign_keys = ON"
- exists "/root/MyApp/script/../lib/MyApp/Model"
- exists "/root/MyApp/script/../t"
- Dumping manual schema for MyApp::Schema to directory /root/MyApp/script/../lib ...
+ exists "/home/catalyst/MyApp/script/../lib/MyApp/Model"
+ exists "/home/catalyst/MyApp/script/../t"
+ Dumping manual schema for MyApp::Schema to directory /home/catalyst/MyApp/script/../lib ...
Schema dump completed.
- created "/root/MyApp/script/../lib/MyApp/Model/DB.pm"
- created "/root/MyApp/script/../t/model_DB.t"
+ created "/home/catalyst/MyApp/script/../lib/MyApp/Model/DB.pm"
+ created "/home/catalyst/MyApp/script/../t/model_DB.t"
Please note the '\' above. Depending on your environment, you might be
able to cut and paste the text as shown or need to remove the '\'
[debug] Loaded dispatcher "Catalyst::Dispatcher"
[debug] Loaded engine "Catalyst::Engine"
- [debug] Found home "/root/MyApp"
- [debug] Loaded Config "/root/MyApp/myapp.conf"
+ [debug] Found home "/home/catalyst/MyApp"
+ [debug] Loaded Config "/home/catalyst/MyApp/myapp.conf"
[debug] Loaded components:
.-----------------------------------------------------------------+----------.
| Class | Type |
quick and easy. For example, see L<Catalyst::Plugin::AutoCRUD>,
L<CatalystX::CRUD>, and L<CatalystX::CRUD::YUI>.
-Source code for the tutorial in included in the F</root/Final> directory
-of the Tutorial Virtual machine (one subdirectory per chapter). There
-are also instructions for downloading the code in
+Source code for the tutorial in included in the F</home/catalyst/Final>
+directory of the Tutorial Virtual machine (one subdirectory per
+chapter). There are also instructions for downloading the code in
L<Catalyst::Manual::Tutorial::01_Intro>.
$ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
create=static components=TimeStamp dbi:SQLite:myapp.db \
on_connect_do="PRAGMA foreign_keys = ON"
- exists "/root/dev/MyApp/script/../lib/MyApp/Model"
- exists "/root/dev/MyApp/script/../t"
- Dumping manual schema for MyApp::Schema to directory /root/dev/MyApp/script/../lib ...
+ exists "/home/catalyst/dev/MyApp/script/../lib/MyApp/Model"
+ exists "/home/catalyst/dev/MyApp/script/../t"
+ Dumping manual schema for MyApp::Schema to directory /home/catalyst/dev/MyApp/script/../lib ...
Schema dump completed.
- exists "/root/dev/MyApp/script/../lib/MyApp/Model/DB.pm"
+ exists "/home/catalyst/dev/MyApp/script/../lib/MyApp/Model/DB.pm"
Notice that we modified our use of the helper slightly: we told it to
include the L<DBIx::Class::TimeStamp> in the C<load_components> line of
This chapter of the tutorial is divided into two main sections: 1)
basic, cleartext authentication and 2) hash-based authentication.
-Source code for the tutorial in included in the F</root/Final> directory
+Source code for the tutorial in included in the F</home/catalyst/Final> directory
of the Tutorial Virtual machine (one subdirectory per chapter). There
are also instructions for downloading the code in
L<Catalyst::Manual::Tutorial::01_Intro>.
$ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
create=static components=TimeStamp dbi:SQLite:myapp.db \
on_connect_do="PRAGMA foreign_keys = ON"
- exists "/root/dev/MyApp/script/../lib/MyApp/Model"
- exists "/root/dev/MyApp/script/../t"
- Dumping manual schema for MyApp::Schema to directory /root/dev/MyApp/script/../lib ...
+ exists "/home/catalyst/dev/MyApp/script/../lib/MyApp/Model"
+ exists "/home/catalyst/dev/MyApp/script/../t"
+ Dumping manual schema for MyApp::Schema to directory /home/catalyst/dev/MyApp/script/../lib ...
Schema dump completed.
- exists "/root/dev/MyApp/script/../lib/MyApp/Model/DB.pm"
+ exists "/home/catalyst/dev/MyApp/script/../lib/MyApp/Model/DB.pm"
$
$ ls lib/MyApp/Schema/Result
Author.pm BookAuthor.pm Book.pm Role.pm User.pm UserRole.pm
second half looks at how moving your authorization code to your model
can simplify your code and make things easier to maintain.
-Source code for the tutorial in included in the F</root/Final> directory
-of the Tutorial Virtual machine (one subdirectory per chapter). There
-are also instructions for downloading the code in
+Source code for the tutorial in included in the F</home/catalyst/Final>
+directory of the Tutorial Virtual machine (one subdirectory per
+chapter). There are also instructions for downloading the code in
L<Catalyst::Manual::Tutorial::01_Intro>.
This chapter of the tutorial takes a brief look at the primary options
available for troubleshooting Catalyst applications.
+Source code for the tutorial in included in the F</home/catalyst/Final>
+directory of the Tutorial Virtual machine (one subdirectory per
+chapter). There are also instructions for downloading the code in
+L<Catalyst::Manual::Tutorial::01_Intro>.
+
+
Note that when it comes to debugging and troubleshooting, there are two
camps:
C<MyApp::Controller::list> method, the console session running the
development server will drop to the Perl debugger prompt:
- MyApp::Controller::Books::list(/root/MyApp/script/../lib/MyApp/Controller/Books.pm:48):
+ MyApp::Controller::Books::list(/home/catalyst/MyApp/script/../lib/MyApp/Controller/Books.pm:48):
48: $c->stash->{books} = [$c->model('DB::Book')->all];
DB<1>
DB<1> n
SELECT me.id, me.title, me.rating, me.created, me.updated FROM book me:
- MyApp::Controller::Books::list(/root/MyApp/script/../lib/MyApp/Controller/Books.pm:53):
+ MyApp::Controller::Books::list(/home/catalyst/MyApp/script/../lib/MyApp/Controller/Books.pm:53):
53: $c->stash->{template} = 'books/list.tt2';
DB<1>
but also provide automated regression testing as you upgrade various
pieces of your application over time.
-Source code for the tutorial in included in the F</root/Final> directory
-of the Tutorial Virtual machine (one subdirectory per chapter). There
-are also instructions for downloading the code in
+Source code for the tutorial in included in the F</home/catalyst/Final>
+directory of the Tutorial Virtual machine (one subdirectory per
+chapter). There are also instructions for downloading the code in
L<Catalyst::Manual::Tutorial::01_Intro>.
For an excellent introduction to learning the many benefits of testing
See L<Catalyst::Manual::Tutorial::09_AdvancedCRUD> for additional form
management options other than L<HTML::FormFu>.
-Source code for the tutorial in included in the F</root/Final> directory
-of the Tutorial Virtual machine (one subdirectory per chapter). There
-are also instructions for downloading the code in
+Source code for the tutorial in included in the F</home/catalyst/Final>
+directory of the Tutorial Virtual machine (one subdirectory per
+chapter). There are also instructions for downloading the code in
L<Catalyst::Manual::Tutorial::01_Intro>.