Stellent
HowToComponents
JavaDoc

intradoc.common
Class ResourceContainer

java.lang.Object
  |
  +--intradoc.common.ResourceContainer
All Implemented Interfaces:
HtmlResourceBinder

public class ResourceContainer
extends java.lang.Object
implements HtmlResourceBinder

Reads and caches resources loaded from html pages.


Field Summary
static char[] DD_TAG
           
static char[][] ENDROW_TAGS
           
static char[][] ITEM_TAGS
           
 java.util.Hashtable m_dynamicHtml
          Hashtable with each item being a DynamicHtml object.
 java.util.Vector m_dynamicHtmlList
          Keeps track of DynamicHtml objects loaded (useful for merging and presenting in Component Wizard).
 boolean m_dynamicHtmlLoaded
          Indicates whether or not a dynamic HTML resource include was loaded (or at least an attempt at a load) into this container during last load of resources from file.
 java.util.Hashtable m_dynamicHtmlOL
          A hashtable of all dynamichtml chunks overloaded with components.
 boolean m_dynamicResourceLoaded
          Indicates whether or not a dynamic resource has loaded into this container during last load of resources from file.
 boolean m_dynamicStringLoaded
          Indicates whether or not a dynamic string has loaded into this container during last load of resources from file.
 java.util.Vector m_resourceList
          The list of resources loaded into this container during last load of resources from file.
 java.util.Hashtable m_stringArrays
          Hashtable with each item being an array of strings.
 java.util.Hashtable m_stringArraysOL
          A hashtable of all string arrays overloaded with components.
 java.util.Hashtable m_strings
          Hashtable with each item being a string.
 java.util.Vector m_stringsList
          Keeps track of String loaded (useful for merging and presenting in Component Wizard).
 java.util.Hashtable m_stringsOL
          A hashtable of all strings overloaded with components.
 java.util.Hashtable m_tables
          Hashtable of Table objects (Vector of string arrays with field names for each column).
 java.util.Hashtable m_tablesOL
          A hashtable of all tables overloaded with components.
 java.util.Vector m_xmlNodes
          Vector of top-level xml nodes.
static char[][] NESTED_TABLE_TAGS
           
static short RES_DYNAMIC_HTML
           
static short RES_END
           
static short RES_STRING
           
static short RES_STRINGARRAY
           
static short RES_STRINGLIST
           
static short RES_TABLE
           
static java.lang.String[] RESOURCE_TYPES
           
static char[] SLASHDD_TAG
           
static char[] SLASHTABLE_TAG
           
static char[] SLASHTD_TAG
           
static char[] SLASHTR_TAG
           
static char[] TABLE_TAG
           
static char[] TD_TAG
           
static char[] TR_TAG
           
 
Constructor Summary
ResourceContainer()
           
 
Method Summary
 void addDynamicHtml(java.lang.String resName, DynamicHtml newDynHtml, ResourceContainer globalRes)
           
protected  void addResource(java.lang.String resName, java.io.Reader resReader, int curResource, ParseLocationInfo parseInfo)
          Parses a particular resource.
protected  void addResourceEx(java.lang.String resName, java.io.Reader resReader, int curResource, ParseLocationInfo parseInfo, IdcBreakpoints bp)
           
protected  void appendToNodeValue(PropertiesTreeNode currentParent, ParseOutput parseOutput, java.io.CharArrayWriter outbuf)
           
 DynamicHtml getHtmlResource(java.lang.String varName)
          Implements interface HtmlResourceBinder.
protected  java.lang.String getNextHtmlToken(java.util.StringTokenizer tokenizer)
          Finds the next HTML style tag.
 java.lang.String getString(java.lang.String varName)
           
 java.lang.String[] getStringArray(java.lang.String varName)
           
 Table getTable(java.lang.String varName)
           
 boolean isAllowableHtmlTag(java.lang.String key)
           
 java.lang.String leftTrim(java.lang.String s)
           
 void mergeDynamicHtml(ResourceContainer newRes, ResourceContainer globalRes)
          Merge in new versions of resource includes, using the priorScript attribute to backpointer to previous implementation.
 void parseAndAddResources(java.io.Reader reader, java.lang.String filename)
          Reads from a Reader object parsing it for resources stored using an HTML syntax.
 void parseAndAddResourcesEx(java.io.Reader reader, java.lang.String filename, java.lang.String langId, IdcBreakpoints bp)
           
 void parseAndAddXmlResources(java.io.Reader reader, java.lang.String filename)
          Parses xml content into a tree.
 void parseAndAddXmlResourcesEx(java.io.Reader reader, java.lang.String filename, boolean isStrict)
           
static DynamicHtml parseDynamicHtml(java.io.Reader reader, ParseLocationInfo parseInfo, IdcBreakpoints bp)
          Parses a dynamic html resource include into preparsed chunks.
static java.lang.String[] parseStringArray(java.io.Reader resReader, ParseLocationInfo parseInfo)
          Parses string array.
static Table parseTable(java.io.Reader resReader, java.util.Hashtable strings, ParseLocationInfo parseInfo)
          Parses a table in HTML syntax format.
protected  java.util.Properties parseTagProperties(ParseLocationInfo parseInfo, java.lang.String tag, java.lang.String propStr)
           
 java.lang.String unencodeResourceString(java.lang.String val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_dynamicHtml

public java.util.Hashtable m_dynamicHtml
Hashtable with each item being a DynamicHtml object.


m_dynamicHtmlOL

public java.util.Hashtable m_dynamicHtmlOL
A hashtable of all dynamichtml chunks overloaded with components.


m_dynamicHtmlList

public java.util.Vector m_dynamicHtmlList
Keeps track of DynamicHtml objects loaded (useful for merging and presenting in Component Wizard). The Hashtable does not preserve the order the resources were loaded.


m_strings

public java.util.Hashtable m_strings
Hashtable with each item being a string.


m_stringsList

public java.util.Vector m_stringsList
Keeps track of String loaded (useful for merging and presenting in Component Wizard). The Hashtable does not preserve the order the resources were loaded.


m_stringsOL

public java.util.Hashtable m_stringsOL
A hashtable of all strings overloaded with components.


m_stringArrays

public java.util.Hashtable m_stringArrays
Hashtable with each item being an array of strings.


m_stringArraysOL

public java.util.Hashtable m_stringArraysOL
A hashtable of all string arrays overloaded with components.


m_tables

public java.util.Hashtable m_tables
Hashtable of Table objects (Vector of string arrays with field names for each column).


m_tablesOL

public java.util.Hashtable m_tablesOL
A hashtable of all tables overloaded with components.


m_xmlNodes

public java.util.Vector m_xmlNodes
Vector of top-level xml nodes.


m_dynamicHtmlLoaded

public boolean m_dynamicHtmlLoaded
Indicates whether or not a dynamic HTML resource include was loaded (or at least an attempt at a load) into this container during last load of resources from file. This is used to determine what type of cache state monitoring is needed for the resource file.


m_dynamicResourceLoaded

public boolean m_dynamicResourceLoaded
Indicates whether or not a dynamic resource has loaded into this container during last load of resources from file.


m_dynamicStringLoaded

public boolean m_dynamicStringLoaded
Indicates whether or not a dynamic string has loaded into this container during last load of resources from file.


m_resourceList

public java.util.Vector m_resourceList
The list of resources loaded into this container during last load of resources from file.


RES_STRING

public static final short RES_STRING
See Also:
Constant Field Values

RES_TABLE

public static final short RES_TABLE
See Also:
Constant Field Values

RES_DYNAMIC_HTML

public static final short RES_DYNAMIC_HTML
See Also:
Constant Field Values

RES_STRINGLIST

public static final short RES_STRINGLIST
See Also:
Constant Field Values

RES_STRINGARRAY

public static final short RES_STRINGARRAY
See Also:
Constant Field Values

RES_END

public static final short RES_END
See Also:
Constant Field Values

RESOURCE_TYPES

public static final java.lang.String[] RESOURCE_TYPES

DD_TAG

public static final char[] DD_TAG

SLASHDD_TAG

public static final char[] SLASHDD_TAG

TD_TAG

public static final char[] TD_TAG

SLASHTD_TAG

public static final char[] SLASHTD_TAG

TR_TAG

public static final char[] TR_TAG

SLASHTR_TAG

public static final char[] SLASHTR_TAG

TABLE_TAG

public static final char[] TABLE_TAG

SLASHTABLE_TAG

public static final char[] SLASHTABLE_TAG

ENDROW_TAGS

public static final char[][] ENDROW_TAGS

ITEM_TAGS

public static final char[][] ITEM_TAGS

NESTED_TABLE_TAGS

public static final char[][] NESTED_TABLE_TAGS
Constructor Detail

ResourceContainer

public ResourceContainer()
Method Detail

parseAndAddResources

public void parseAndAddResources(java.io.Reader reader,
                                 java.lang.String filename)
                          throws java.io.IOException,
                                 ParseSyntaxException
Reads from a Reader object parsing it for resources stored using an HTML syntax.

java.io.IOException
ParseSyntaxException

parseAndAddResourcesEx

public void parseAndAddResourcesEx(java.io.Reader reader,
                                   java.lang.String filename,
                                   java.lang.String langId,
                                   IdcBreakpoints bp)
                            throws java.io.IOException,
                                   ParseSyntaxException
java.io.IOException
ParseSyntaxException

addResource

protected void addResource(java.lang.String resName,
                           java.io.Reader resReader,
                           int curResource,
                           ParseLocationInfo parseInfo)
                    throws java.io.IOException,
                           ParseSyntaxException
Parses a particular resource.

java.io.IOException
ParseSyntaxException

addResourceEx

protected void addResourceEx(java.lang.String resName,
                             java.io.Reader resReader,
                             int curResource,
                             ParseLocationInfo parseInfo,
                             IdcBreakpoints bp)
                      throws java.io.IOException,
                             ParseSyntaxException
java.io.IOException
ParseSyntaxException

mergeDynamicHtml

public void mergeDynamicHtml(ResourceContainer newRes,
                             ResourceContainer globalRes)
                      throws java.lang.IllegalArgumentException
Merge in new versions of resource includes, using the priorScript attribute to backpointer to previous implementation. Note: priorScript may be in the global set of resources.

java.lang.IllegalArgumentException

addDynamicHtml

public void addDynamicHtml(java.lang.String resName,
                           DynamicHtml newDynHtml,
                           ResourceContainer globalRes)
                    throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException

getNextHtmlToken

protected java.lang.String getNextHtmlToken(java.util.StringTokenizer tokenizer)
Finds the next HTML style tag.


parseStringArray

public static java.lang.String[] parseStringArray(java.io.Reader resReader,
                                                  ParseLocationInfo parseInfo)
                                           throws java.io.IOException,
                                                  ParseSyntaxException
Parses string array. Array must follow a very precise syntax for each string. * Strings are preceded by
tags. (Indent list tag.) * Strings are terminated by
tags.

java.io.IOException
ParseSyntaxException

parseTable

public static Table parseTable(java.io.Reader resReader,
                               java.util.Hashtable strings,
                               ParseLocationInfo parseInfo)
                        throws java.io.IOException,
                               ParseSyntaxException
Parses a table in HTML syntax format. The parameter 'strings' is used for tables that are also string lists. String lists are tables where the first two columns are meant to describe a name=value pair relationship. The name->value mapping is put into the 'strings' parameter. Pass null as a parameter if the table should not be treated as a string list. Known limitations: * No way to comment out portions of table. * Nested tables will break syntax parsing. * No way to specify extra formatting components that do not get loaded into the Table object. * First row must container header names. * No support for fields spanning multiple columns or variable length rows. I apologize for the clever optimizations in this routine (SPW 6/7/97).

java.io.IOException
ParseSyntaxException

parseDynamicHtml

public static DynamicHtml parseDynamicHtml(java.io.Reader reader,
                                           ParseLocationInfo parseInfo,
                                           IdcBreakpoints bp)
                                    throws java.io.IOException,
                                           ParseSyntaxException
Parses a dynamic html resource include into preparsed chunks.

java.io.IOException
ParseSyntaxException

parseAndAddXmlResources

public void parseAndAddXmlResources(java.io.Reader reader,
                                    java.lang.String filename)
                             throws java.io.IOException,
                                    ParseSyntaxException
Parses xml content into a tree.

java.io.IOException
ParseSyntaxException

parseAndAddXmlResourcesEx

public void parseAndAddXmlResourcesEx(java.io.Reader reader,
                                      java.lang.String filename,
                                      boolean isStrict)
                               throws java.io.IOException,
                                      ParseSyntaxException
java.io.IOException
ParseSyntaxException

appendToNodeValue

protected void appendToNodeValue(PropertiesTreeNode currentParent,
                                 ParseOutput parseOutput,
                                 java.io.CharArrayWriter outbuf)
                          throws java.io.IOException
java.io.IOException

parseTagProperties

protected java.util.Properties parseTagProperties(ParseLocationInfo parseInfo,
                                                  java.lang.String tag,
                                                  java.lang.String propStr)
                                           throws ParseSyntaxException
ParseSyntaxException

isAllowableHtmlTag

public boolean isAllowableHtmlTag(java.lang.String key)

unencodeResourceString

public java.lang.String unencodeResourceString(java.lang.String val)

leftTrim

public java.lang.String leftTrim(java.lang.String s)

getString

public java.lang.String getString(java.lang.String varName)

getStringArray

public java.lang.String[] getStringArray(java.lang.String varName)

getTable

public Table getTable(java.lang.String varName)

getHtmlResource

public DynamicHtml getHtmlResource(java.lang.String varName)
Implements interface HtmlResourceBinder.

Specified by:
getHtmlResource in interface HtmlResourceBinder
See Also:
HtmlResourceBinder


(c) 1996-2005  All rights reserved.  Stellent, Inc.