blib/lib/Labyrinth/Demo.pm

filter: Statementstmt 100% 8 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 10 / 10 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Labyrinth::Demo;
2  
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 our $VERSION = '1.03';
7  
8 5 1;
9  
10 __END__
11  
12 =head1 NAME
13  
14 Labyrinth::Demo - Labyrinth Website Management Framework - Demo Website
15  
16 =head1 DESCRIPTION
17  
18 Documentation overview for the Demo Website of the Labyrinth Website
19 Management Framework.
20  
21 Labyrinth began life in 2002, with a small set of plugins to enable various
22 features of web site management.
23  
24 This demo website uses the core set of plugins to provide an example of a
25 website management system.
26  
27 These plugins provide the functionality to manipulate core aspects of the data
28 used within Labyrinth. Several of these plugins only provide administration
29 features.
30  
31 =head1 ADDITIONAL FILES
32  
33 In order for your website to work with Labyrinth, some additional files are
34 required. This package provides the standard set of files to enable Labyrinth
35 and the Core plugins to work with a blank canvas. These files consist of SQL,
36 template and configuration files, together with some basic CSS and Javascript
37 files.
38  
39 Install these into the website structure and edit as necessary to implement
40 the layout and functionality you require for your purposes.
41  
42 Please note that included with this distribution are files designed and
43 developed by other people. Notable are the following:
44  
45 =head2 PixelGreen
46  
47 Version 1.2
48  
49 CSS Layout and Design by Erwin Aligam, release under the Creative Commons
50 Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
51  
52 See http://www.styleshout.com/ for more details.
53  
54 =head2 TinyMCE
55  
56 Version 3.211
57  
58 A Javascript WYSIWYG Content Editor by Moxiecode Systems AB, released under the
59 GNU Leseer General Public License (LGPL) -
60 http://tinymce.moxiecode.com/js/tinymce/jscripts/tiny_mce/license.txt
61  
62 See http://tinymce.moxiecode.com/ for more details.
63  
64 =head1 INSTALLATION
65  
66 To set up the Demo Website, install via a CPAN client (such as CPAN.pm,
67 CPANPLUS or cpanminus) to ensure you install required prerequisites. Then copy
68 the directory contents under the 'vhost' directory into your web server
69 directory. For this example the path to these files and directories is assumed
70 to be '/var/www/demo'. If you wish to change this, please update the file paths
71 used in 'cgi-bin/pages.cgi' and 'cgi-bin/config/settings.ini'
72  
73 If you use Apache, include the configuration snippet contained in the file
74 'vhosts.conf', in the appropriate Apache configuration file. Directions for
75 other web servers will be included at a later date.
76  
77 Create a MySQL database called 'demo' and use the base file
78 'cgi-bin/db/demo-base.sql' as a starting point. If you wish to specify a fixed
79 user to access the database, you may wish to review the 'grant.sql' file or
80 amend the 'settings.ini' as appropriate.
81  
82 You should now be able to start your Apache instance. Update your hosts file
83 as necessary to point to your new virtual host.
84  
85 A more complete installation and configuration script is planned for the
86 future, which can also install plugins.
87  
88 =head1 LABYRINTH DIRECTORY STRUCTURE
89  
90 ./cgi-bin
91 /config - contains top level configuration files
92 /requests - contains despatch tables
93 /db - database dumps
94 /lib
95 /Labyrinth - Labyrinth Core modules
96 /Plugin - Labyrinth Plugin modules
97 /templates - Template Toolkit templates
98 ./html
99 /cache - cache where reports are produced
100 /css - website CSS files
101 /images - website image files
102 /js - website JavaScript files
103 /tiny_mce - Tiny MCE JavaScript application files
104 ./toolkit
105  
106 As mentioned included in the package is the vhost entry from an Apache
107 configuration file. This file contains the rewrite rules that translate user
108 friendly URLs to the local CGI call. However, it is not necessary to have
109 rewrite rules, in the event you are unable to use them, and the application
110 can quite happily function with full 'cgi-bin/' type paths.
111  
112 The './cgi-bin/pages.cgi' file is the core startup script, that simply passes
113 the settings file, and initiates Labyrinth. The 'act' CGI parameter contains
114 the primary action required. Throughout the duration of a request, the current
115 action may change several times, with each referencing the despatch tables to
116 load and run the correct functions and render the correct templates. Each user
117 has a nominated "realm", which is the section of the site they are given access
118 to. The realm despatch table is used to load and run and default functions, and
119 can thus be used to render different skins and/or layout templates.
120  
121 The CGI parameters are validated against the './cgi-bin/config/parserules.ini'
122 file. The rules are built from these entries and passed to Data::FormValidator.
123 Each entry's fields refer to parameter name, whether mandatory, default value,
124 preprocessing function, constraint function and finally the regular expression.
125 If a constraint is provided the regular expression is ignored. Where the
126 parameter name looks like ':^LISTED', this is a regular expression match
127 against the parameter name (where the ':' character is removed). This enables
128 parameters which have a changeable suffix, can apply the same constraint or
129 regular expression against each matching parameter's value.
130  
131 All SQL statements are called using a Phrasebook Design Pattern. As such the
132 './cgi-bin/config/phrasebook.ini' file contains all each phrase and associated
133 SQL as used within the application. To aid readability SQL can be split onto
134 multiple lines, using the '\' character as the last entry on a line to continue
135 onto the next.
136  
137 Templates are built from the given layout, see the appropriate realm entry in
138 the despatch table, incorporating other templates as required, including the
139 'content' template as specified by the last action command. See the appropriate
140 despatch table to reference the appropriate content template.
141  
142 Tiny MCE is used by Labyrinth where appropriate for text area input. However,
143 this is only activated on the pages where it is appropriate.
144  
145 The set of scripts within the toolkit directory typically provide ad-hoc or
146 timed (e.g. via cron) functionality. The scripts are not intended to be run via
147 the web server, but often provide support functionality, such as creating
148 static pages or running periodic cleanup tasks.
149  
150 =head1 DEMO WEBSITE
151  
152 To see a working example of this distribution, please see the following link:
153  
154 L<http://demo.missbarbell.co.uk>
155  
156 =head1 ADDITION INFORMATION
157  
158 Although Labyrinth has long been in development, documentation has not been a
159 priority. As such much of the documentation you may need to understand how to
160 use Labyrinth is the code itself. If you have the inclination, documentation
161 patches would be very gratefully received.
162  
163 The Labyrinth website [1] will eventually feature a documentation site, wiki
164 and other features which are intended to provide you with the information to
165 use and extend Labyrinth as you wish.
166  
167 [1] http://labyrinth.missbarbell.co.uk
168  
169 =head1 SEE ALSO
170  
171 L<Labyrinth>,
172 L<Labyrinth-Plugin-Core>
173  
174 http://labyrinth.missbarbell.co.uk
175  
176 =head1 AUTHOR
177  
178 Barbie, <barbie@missbarbell.co.uk> for
179 Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
180  
181 =head1 COPYRIGHT & LICENSE
182  
183 Copyright (C) 2002-2014 Barbie for Miss Barbell Productions
184 All Rights Reserved.
185  
186 This module is free software; you can redistribute it and/or
187 modify it under the Artistic License 2.0.
188  
189 =cut
↑ Summary