Bricolage Configuration Directives
by David Wheeler
|
Pages: 1, 2, 3, 4
Virtual FTP Server Configuration
Bricolage pushes story documents through formatting templates to generate
output when you preview or publish them. Formatting templates can use Mason,
Template Toolkit, or HTML::Template. If you have a lot of different types of
story documents, or just elements of story documents, you'll likely end up with
a lot of templates to manage. Editing templates in the browser interface's
textarea fields can be a pain. A better approach is to use the
Bricolage virtual FTP server, which provides access to all Bricolage templates
via FTP. If the security of your password isn't a serious consideration
(because FTP sends passwords in the clear, and maybe you work behind a firewall
or over a virtual private network), enable the virtual FTP server and edit
Bricolage templates from within your favorite FTP-enabled editor (Emacs, Vim,
HomeSite, etc.). Here's how.
ENABLE_FTP_SERVER-
This boolean directive enables the virtual FTP server. Set it to a true value, tune the other FTP directives, reboot Bricolage, fire up the bric_ftpd application, and get to work! Just connect to your Bricolage FTP server on the port specified by the
FTP_PORTdirective, login with your Bricolage username and password, and you can browse templates by site, output channel, and category. FTP_PORT-
This directive specifies a TCP/IP port on which the Bricolage virtual FTP server will listen for connections. The default is
2121
. FTP_ADDRESS-
If your host has more than one IP address, specify one of them here to have the virtual FTP server to listen for connections on that IP address only. By default, the FTP server will listen on all of your host's IP addresses.
FTP_LOG-
The location of the virtual FTP server log. By default, it will be in the log subdirectory of your Bricolage root directory.
FTP_PID_FILE-
Specify the location of the PID file for the Bricolage FTP server. bric_ftpd will use this file to record the PID of the server when you start it and to stop the server when you execute
bric_ftpd -k. The default is to store the PID file in the log subdirectory of your Bricolage root directory. FTP_DEPLOY_ON_UPLOAD-
As of Bricolage 1.8 and later, the Bricolage FTP server will save templates to your private sandbox when you upload them. This means that they will be checked out to you, appear in your personal workspace in the UI, and execute when you (and only you) preview stories that use them. To check in and deploy a template to use in production when other users preview and publish documents, simply append the string .deploy to the end of the file name when you upload it and Bricolage will do the rest.
Prior to version 1.8.0, the Bricolage virtual FTP server checked out, updated, checked in, and deployed templates on every upload. If for some reason you prefer this approach (and to be honest, I can't imagine why anyone would!), set the
FTP_DEPLOY_ON_UPLOADdirective to a true value and restart bric_ftpd. FTP_DEBUG-
If for some reason the virtual FTP server isn't behaving the way you expect, set this Boolean directive to a true value and restart bric_ftpd. Then tail the FTP log (specified by the
FTP_LOGdirective) to diagnose the problem.
Preloading Configuration
Because Bricolage runs on Apache 1.3, the parent process loads all of its code at startup time, before it forks off any children. This is memory efficient, because most modern operating systems use a copy-on-write forking design. This means that the children all share memory with the parent until they write to that memory, at which time the kernel copies that memory to the child process.
When loading a lot of code, children never overwrite much of it. It's highly advantageous to load as much code as you think you'll need into the parent process at startup time, to prevent each of the children from loading it themselves and taking up that much more memory. These directives help you to do just that.
PERL_LOADER-
This string directive can be any Perl code you like, as long as it's all on one line in the bricolage.conf file. Bricolage will execute this code at startup time, in the namespace used by the Mason burner. This is very useful for loading Perl modules that your templates use, so that you're not loading them in each child process. The default value loads Apache::Util, which has many useful HTML output utility functions, and Bric::Util::Burner, which exports several constants that you can use in templates to tell what type of burn is being executed (preview or publish). Other common modules you might want to load here include CGI.pm or XML::RSS to assist with HTML and RSS output, respectively. You can load anything here, really.
LOAD_LANGUAGES-
Bricolage has localizations for multiple languages, including German, Portuguese, Italian, Cantonese, Mandarin, and Russian. The localization libraries are Perl modules loaded at server startup time. For the most efficient use of memory, load the languages you expect to use most often by specifying the appropriate language codes (such as
en
for English,pt_pt
for Portuguese,de_de
for German, etc.) in a space-delimited list via theLOAD_LANGUAGESdirective. LOAD_CHAR_SETS-
This directive functions just like the
LOAD_LANGUAGESdirective, except that it loads the libraries that convert to and from UTF-8. Bricolage allows individual users to use different character sets when accessing the Bricolage UI, including ISO-8859-1, ISO-8859-2, Big5, ShiftJIS, GB-2312, and others. To save memory overhead, specify each character set that you expect your users will need to use day-to-day in Bricolage in a space-delimited list in theLOAD_CHAR_SETSdirective.
Thumbnail Configuration
As of Bricolage 1.8.0, Bricolage can generate thumbnail versions of image files uploaded for media documents. All you need to do is install the Imager module from CPAN (along with the necessary libraries for the image formats you use—see the Imager README file for details) and configure thumbnail support via these directives.
USE_THUMBNAILS-
Set this Boolean directive to a true value and restart Bricolage to have thumbnails generated for all image files in Bricolage. You must have Imager installed, of course. You might also want to consider installing media type icons specific to particular types of non-image files. See the README file and script in contrib/copy_gnome_icons in the Bricolage sources for information on which icon files to use and how to install them using the copy_gnome_icons script.
THUMBNAIL_SIZE-
Set this directive to the maximum dimension of thumbnail images, in pixels. Bricolage will use this number to constrain the size of the thumbnail so that its greatest dimension does not exceed this number. For example, if
THUMBNAIL_SIZEhas its default value,75
, and you upload a 150 x 100 pixel image file, Bricolage will generate a 75 x 50 pixel thumbnail.
htmlArea Configuration
Bricolage 1.8.0 added support for WYSIWYG (what you see is what you get)
editing via the htmlArea JavaScript editor, though it has this feature disabled by
default. To enable it, download and install htmlArea 3.0 (in beta release as of
this writing) in the comp/media/htmlarea directory under your
Bricolage root. Then configure it via these directives and restart Bricolage.
You will then be able to specify a WYSIWYG
field type in document
element definitions, and content editors can take advantage of htmlArea's
WYSIWYG features when editing content in those fields.
ENABLE_HTMLAREA-
Set this Boolean directive to a true value to enable Bricolage's htmlArea support. You must have htmlArea installed in the comp/media/htmlarea directory under your Bricolage root.
HTMLAREA_TOOLBAR-
The htmlArea editor offers a lot of WYSIWYG features as controls (buttons) in its interface. The controls handle tasks such as copy, paste, italicize, boldface, link, etc. By default, Bricolage enables only a subset of these controls. The subset excludes layout type features such as font selection and color, line justification, and the like. The idea is to provide only the tools needed for users to easily add semantically meaningful markup rather than layout markup, so as to keep content independent of presentation. If you really need to allow your users to use six different type faces in twelve colors, you can enable the htmlArea controls for these features via the
HTMLAREA_TOOLBARdirective. The value of the directive is a comma-separated list of single-quoted strings with brackets at either end. See the htmlArea documentation for a complete list of supported controls.
Up Next
Now you have all the information you need to configure how Bricolage operates to your heart's content. My next article will explore the nitty-gritty of defining document models in Bricolage.
You must be logged in to the O'Reilly Network to post a talkback.

