org.ceryle.tm
Class PSIPublisher

java.lang.Object
  extended by org.ceryle.tm.PSIPublisher

public class PSIPublisher
extends Object

Provided with either a TopicMap and/or a Map of property-value pairs, generates a PSI publication document in XHTML.

TO DO:
Rather than having the publishTopicMap() method include paramters for the PSI metadata, this should be included in the TopicMap document as topics having a recognizable PSI, whose occurrences are typed with PSIs for each of the metadata contents.

Since:
JDK1.3
Version:
$Id: PSIPublisher.java,v 3.7 2007-06-15 12:09:32 altheim Exp $
Author:
Murray Altheim

Field Summary
static String footerFilename
          The filename of the optional XHTML footer.
static String stylesheetURI
          The URI (generally relative) of the CSS stylesheet.
 
Constructor Summary
PSIPublisher()
          Default constructor.
 
Method Summary
protected  void addFooter(Element body, String timestamp, String locator)
          Append a document footer to the document.
 Document generateDocument(String doctitle, String description, String locator, String intro, String version, Map map)
          Generates a PSI-style document provided with various strings and a Map containing the PSI and description strings (with the PSI String as the map key).
 boolean isXTMTopic(Topic topic)
          Returns true if the Topic is an XTM 1.0-based Topic.
 void publishTopicMap(TopicMap topicmap, String[] metadata)
          Provided with a TopicMap topicmap, an array of metadata strings and a map of name-property values, writes the result to an XHTML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stylesheetURI

public static String stylesheetURI
The URI (generally relative) of the CSS stylesheet. Default is "../psi.css".


footerFilename

public static String footerFilename
The filename of the optional XHTML footer. Default is "psi-footer.html".

Constructor Detail

PSIPublisher

public PSIPublisher()
             throws TopicMapException,
                    ProcessException
Default constructor.

Throws:
TopicMapException
ProcessException
Method Detail

publishTopicMap

public void publishTopicMap(TopicMap topicmap,
                            String[] metadata)
Provided with a TopicMap topicmap, an array of metadata strings and a map of name-property values, writes the result to an XHTML file. The metadata is composed of five Strings: document title, description, URI locator, intro text, and finally, the export file path. Any other array contents are ignored.


isXTMTopic

public boolean isXTMTopic(Topic topic)
Returns true if the Topic is an XTM 1.0-based Topic. A Topic is an "XTM" Topic if:


generateDocument

public Document generateDocument(String doctitle,
                                 String description,
                                 String locator,
                                 String intro,
                                 String version,
                                 Map map)
Generates a PSI-style document provided with various strings and a Map containing the PSI and description strings (with the PSI String as the map key).

Parameters:
doctitle - 0. a String containing the document title.
description - 1. a String containing the PSI set description.
locator - 2. a String containing the URI locator for the set.
intro - 3. an optional String containing a brief text introduction.
map - 4. a Map containing the PSI and description Strings.

addFooter

protected void addFooter(Element body,
                         String timestamp,
                         String locator)
Append a document footer to the document. If the file psi-footer.html (set by the member variable footerFilename) exists, it is used. Otherwise, a default footer is attached. The timestamp will be substituted for instances of "%1" in the footer String, the document locator for "%2".

While not required, it is recommended that the included content be a valid or well-formed XHTML fragment.

Parameters:
body - the DOM 'body' Element
timestamp - an optional timestamp String
locator - an optional document locator (URI) String


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.