PAJES 3.0.21

org.pajes.html.tree
Class TreeFactory

java.lang.Object
  extended by org.pajes.html.PajeFactory
      extended by org.pajes.html.tree.TreeFactory

public class TreeFactory
extends PajeFactory

Factory to produce TreePaje instances.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.pajes.html.PajeFactory
PajeFactory.Document
 
Field Summary
 
Fields inherited from class org.pajes.html.PajeFactory
CHECK_FOR_FILE_CHANGES_ATTRIBUTE, INTERNATIONALISATION_ATTRIBUTE
 
Constructor Summary
TreeFactory(javax.servlet.ServletContext context)
          Creates a factory that produces TreePaje instances.
TreeFactory(javax.servlet.ServletContext context, java.lang.String pathPattern)
          Creates a factory that produces TreePaje instances from a source HTML document containing an appropriate frame set.
 
Method Summary
protected  Paje create(java.text.MessageFormat keyBase, java.util.Enumeration<?> locales, PajeFactory.Document defaultDocument)
          Creates a new localized Paje object.
 
Methods inherited from class org.pajes.html.PajeFactory
addResource, addResource, create, create, create, find, find, find, getKeyBase, getPajeResource, getServletContext, getTemplate, setDestroyAfterWrite, setFileModificationChecking, setInternationalisationChecking, setTemplate, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeFactory

public TreeFactory(javax.servlet.ServletContext context)
            throws java.io.IOException,
                   java.lang.IllegalAccessException,
                   java.lang.InstantiationException
Creates a factory that produces TreePaje instances.

Parameters:
context - the servlet context.
Throws:
java.io.IOException - if an I/O error occurs.
java.lang.IllegalAccessException - if the specified class is not accesible.
java.lang.InstantiationException - if the specified class is an interface or an abstract class.

TreeFactory

public TreeFactory(javax.servlet.ServletContext context,
                   java.lang.String pathPattern)
            throws java.io.IOException,
                   java.lang.IllegalAccessException,
                   java.lang.InstantiationException
Creates a factory that produces TreePaje instances from a source HTML document containing an appropriate frame set. For example:
   <html>
    <head>
     <title>Tree</title>
     <script language="JavaScript" type="text/javascript">
         // Specifies the style sheet used to format the tree display
         var styleSheet = "servlet/org.pajes.html.tree.TreeStyleSheet";
         // Relative image URLs
         var imageTreeBottomChildClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeBottomChildClosed.gif";
         var imageTreeBottomChildOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeBottomChildOpen.gif";
         var imageTreeBottomParentClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeBottomParentClosed.gif";
         var imageTreeBottomParentOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeBottomParentOpen.gif";
         var imageTreeJoiner = "servlet/org.pajes.html.tree.TreeImage?image=TreeJoiner.gif";
         var imageTreeMiddleChildClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeMiddleChildClosed.gif";
         var imageTreeMiddleChildOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeMiddleChildOpen.gif";
         var imageTreeMiddleParentClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeMiddleParentClosed.gif";
         var imageTreeMiddleParentOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeMiddleParentOpen.gif";
         var imageTreeSpacer = "servlet/org.pajes.html.tree.TreeImage?image=TreeSpacer.gif";
         var imageTreeTopChildClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopChildClosed.gif";
         var imageTreeTopChildOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopChildOpen.gif";
         var imageTreeTopParentClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopParentClosed.gif";
         var imageTreeTopParentOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopParentOpen.gif";
         var imageTreeTopSiblingChildClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopSiblingChildClosed.gif";
         var imageTreeTopSiblingChildOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopSiblingChildOpen.gif";
         var imageTreeTopSiblingParentClosed = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopSiblingParentClosed.gif";
         var imageTreeTopSiblingParentOpen = "servlet/org.pajes.html.tree.TreeImage?image=TreeTopSiblingParentOpen.gif";
     </script>
     <script language="JavaScript" type="text/javascript"
             src="/servlet/org.pajes.html.tree.TreeScript">
     </script>
    </head>
    <frameset onload="draw();"
              cols="30%,*"
              border="0"
              framespacing="0">
     <frame name="out" src="/servlet/org.pajes.servlet.BlankPajeServlet" />
     <frame name="doc" src="/servlet/org.pajes.servlet.BlankPajeServlet" />
    </frameset>
   </html>
 

The <script> tags in the header, the onload handler on the <frameset> and the named frames are all mandatory. Unpredicatable errors will occur if they are not provided.

Parameters:
context - the servlet context which will be requested to return the resource represented by the pathPattern.
pathPattern - the path pattern of the resource. This resource MUST NOT use replaceable parameters.
Throws:
java.io.IOException - if an I/O error occurs.
java.lang.IllegalAccessException - if the specified class is not accesible.
java.lang.InstantiationException - if the specified class is an interface or an abstract class.
Method Detail

create

protected Paje create(java.text.MessageFormat keyBase,
                      java.util.Enumeration<?> locales,
                      PajeFactory.Document defaultDocument)
               throws java.io.IOException
Creates a new localized Paje object. See the public create methods for a description of the processing logic.

Sub-classes may over-ride this method to effect changes to every document returned by this factory.

Overrides:
create in class PajeFactory
Parameters:
keyBase - a MessageFormat instance that has a single replaceable parameter where the locale string(s) will be inserted.
locales - an Enumeration of Locale objects (in decreasing order starting with the preferred locale). Any non-Locale objects in the Enumeration will be silently ignored. This parameter may be null, in which case the default document will be returned.
defaultDocument - the default document to be used if a localized version cannot be found.
Returns:
a new Paje instance.
Throws:
java.io.IOException - if a resulting path, after substituting the supplied arguments, is not in the correct form.

PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.