App-Office-CMS
view release on metacpan or search on metacpan
lib/App/Office/CMS.pm view on Meta::CPAN
or unpack the distro, and then either:
perl Build.PL
./Build
./Build test
sudo ./Build install
or:
perl Makefile.PL
make (or dmake)
make test
make install
Either way, you need to install all the other files which are shipped in the distro.
=head2 Install the L<Text::Xslate> (HTML and Javascript) template files
Copy the distro's htdocs/assets/ directory to your web server's doc root.
Specifically, my doc root is /dev/shm/html, so I end up with /dev/shm/html/assets/.
/dev/shm is Debian's RAM disk. Your doc root might be /var/www, or even /var/www/html.
=head2 Install the FAQ web page
This FAQ is for using C<App::Office::CMS> via its CGI scripts, not for the generated web site.
In lib/App/Office/CMS/.htoffice.cms.conf there is a line:
program_faq_url=/assets/templates/app/office/cms/cms.help.html
This page is displayed when the user clicks FAQ on the About tab.
A sample page is shipped in docs/html/cms.help.html. It has been built from
docs/pod/cms.help.pod (by running a script I wrote, pod2html.pl, which in turn
is a simple wrapper around L<Pod::Simple::HTML>).
So, copy the sample HTML file into your web server's doc root, or generate another version
of the page, using docs/pod/cms.faq.pod as input.
=head2 Install the trivial CGI script and the Plack script
Copy the distro's httpd/cgi-bin/office/ directory to your web server's cgi-bin/
directory, and make I<cms.cgi> executable.
If I used Apache, my cgi-bin/ dir would be /usr/lib/cgi-bin/, so I would end up
with /usr/lib/cgi-bin/office/cms.cgi.
Actually, I run nginx (Engine X) L<http://wiki.nginx.org/Main>, which does not serve
CGI scripts, and tiny (thttpd) L<http://acme.com/software/thttpd/>, which does.
See L<http://wiki.nginx.org/ThttpdCGI> for patching tiny.
See also L<http://savage.net.au/Perl/html/env.report.html>.
=head2 Start testing
Try:
starman -l 127.0.0.1:5006 --workers 1 httpd/cgi-bin/office/cms.psgi &
Or, for good debug output:
plackup -l 127.0.0.1:5006 httpd/cgi-bin/office/cms.psgi &
Or, install cms.cgi and point your browser at:
http://127.0.0.1/cgi-bin/cms.cgi.
=head1 The Generate Button
Mostly, you'll be working on the Edit Content tab, so that's where the [Generate] button is.
Clicking [Generate] generates all of the pages in the current design. You do not have to be
editing content for the homepage to use the [Generate] button.
The disk directory structure created matches the tree structure you have created via the Edit Pages tab.
So, if you created a page called Offices, and under that 2 children called Locations and Staff, then
these files will be output:
=over 4
=item o offices.html
=item o offices/locations.html
=item o offices/staff.html
=back
There are various things to note:
=over 4
=item o Case: File and Directory names are output in lower case
This conversion is done with L<String::Dirify>.
=item o Hierarchy: Child nodes are in a sub-directory under their parent
This structure is generated by tracing the ancestors of each page up the tree of pages,
to the root (but excluding the root), and using the parent, grand-parent, etc, names as
directory names.
=item o Root directory
When a site is created, you specify an output directory, and the directories mentioned in
the previous items are created under the site's directory.
So, if this site's output directory was in Debian's RAM disk at /dev/shm/html, then the output files'
full paths would be:
=over 4
=item o /dev/shm/html/offices.html
=item o /dev/shm/html/offices/locations.html
=item o /dev/shm/html/offices/staff.html
( run in 0.950 second using v1.01-cache-2.11-cpan-e93a5daba3e )