Dashboard > blojsom > ... > Developers Guide > Configuring the WebMacro dispatcher
  blojsom Log In   View a printable version of the current page.  
  Configuring the WebMacro dispatcher
Added by David Czarnecki, last edited by David Czarnecki on Nov 06, 2005  (view change)
Labels: 
(None)

WebMacro is an alternative presentation technology to either JSP or Velocity.

Availability of the WebMacro dispatcher

The WebMacro dispatcher is available as of blojsom 2.28.

Installing the WebMacro dispatcher

You must download the blojsom add-on bundle. It is available as a separate download with each release of blojsom.

  • Unpack the add-on bundle ZIP file.
  • Copy the webmacro-2.0.jar and concurrent.jar files to your blojsom installation's /WEB-INF/lib directory.
  • Add the following line to your /WEB-INF/dispatcher.properties file.
    wm=org.blojsom.dispatcher.WebMacroDispatcher
    
  • In the above configuration, WebMacro templates will be associated with the .wm file extension.
  • You may then add templates to an individual blog's /WEB-INF/(blog-id)/templates directory that use WebMacro.
  • You must restart your server if you are adding the WebMacro dispatcher while blojsom is running.

Configuring the WebMacro dispatcher

The WebMacro dispatcher is configured by configuring WebMacro. The WebMacro configuration file is specified in the following initialization parameter for the blojsom servlet in /WEB-INF/web.xml.

<init-param>
    <param-name>webmacro-properties</param-name>
    <param-value>/WEB-INF/WebMacro.properties</param-value>
</init-param>

Please read the WebMacro documentation for the particulars on configuring WebMacro.

You may download a sample WebMacro.properties file for use on your server.

Configuring a flavor template to use the WebMacro dispatcher

You can configure individual flavors to use the WebMacro dispatcher by changing the properties in your /WEB-INF/(blog-id)/flavor.properties file. For example:

html=html.vm, text/html;charset=UTF-8

This line in the flavor.properties file configures the html flavor to use the html.vm template, where in the standard blojsom installation, templates with a .vm extension are associated with the Velocity dispatcher.

To configure the html flavor to use the WebMacro dispatcher, change the line above to the following:

html=html.wm, text/html;charset=UTF-8

You will then need to create the appropriate /WEB-INF/(blog-id)/templates/html.wm file using the WebMacro template syntax.

Writing templates using WebMacro

Please read the WebMacro reference documentation for the details on the WebMacro template syntax.

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators