wt.htmlutil
Class ProcessTemplate

java.lang.Object
  extended bywt.htmlutil.ProcessTemplate

public class ProcessTemplate
extends Object

ProcessTemplate contains those methods used to read an HTML input stream, search for any embedded Windchill scripts and invoke the methods specified in any Windchill scripts. 7/23/99: Alternately, ProcessTemplate will return a CachedHTMLTemplate, a cached representation of the parsed template.


Field Summary
private static int BUFFER_SIZE
          Deprecated.  
private static String COMMENT_STR
          Deprecated.  
private static boolean DEBUG
          Deprecated.  
private static String END_COMMENT_STR
          Deprecated.  
private static String END_SCRIPT_STR
          Deprecated.  
private  PushbackInputStream in
          Deprecated.  
private static String LOCALIZED_METHODS
          Deprecated.  
private static String RECURSE_KEY
          Deprecated.  
private static String RESOURCE
          Deprecated.  
private static String SCRIPT_STR
          Deprecated.  
private static boolean VERBOSE
          Deprecated.  
private static String versionID
          Deprecated.  
private static String WINDCHILL_STR
          Deprecated.  
 
Constructor Summary
ProcessTemplate()
          Deprecated.  
 
Method Summary
private  byte[] expandBuffer(byte[] buffer, int size)
          Deprecated. Expands the specified buffer by size bytes and returns the new buffer
static void main(String[] args)
          Deprecated.  
private  String newLocalizedString(String encoding, byte[] buffer, int start, int length)
          Deprecated. Creates a string from a byte buffer and encoding.
private  void parseTemplate(PushbackInputStream in, OutputStream out, Object context)
          Deprecated. ParseTemplate reads through the input looking for Windchill scripts.
private  void parseTemplate(PushbackInputStream in, OutputStream out, Object context, Locale locale, boolean includeLocale)
          Deprecated. ParseTemplate reads through the input looking for Windchill scripts.
private  CachedHTMLTemplate parseTemplate(PushbackInputStream in, OutputStream out, Object context, Locale locale, boolean includeLocale, boolean isCached)
          Deprecated.  
private  CachedHTMLTemplate processMethod(String method_line, OutputStream out, Object context, Locale locale, boolean includeLocale, boolean isCached, CachedHTMLTemplate inputTemplate, boolean retTemplate)
          Deprecated. Process a script method line.
 void processTemplate(InputStream in, OutputStream out)
          Deprecated. Called initially to process an HTML 'template'.
 void processTemplate(InputStream in, OutputStream out, Locale locale)
          Deprecated. Called initially to process an HTML 'template'.
 void processTemplate(InputStream in, OutputStream out, Object context)
          Deprecated. Called initially to process an HTML 'template'.
 void processTemplate(InputStream in, OutputStream out, Object context, Locale locale)
          Deprecated. Called initially to process an HTML 'template'.
 CachedHTMLTemplate processTemplateCached(InputStream in, Object context, Locale locale)
          Deprecated. Called initially to process an HTML 'template' and cache the results of the parsing.
 String scriptOutput(String script, Object context, Locale locale, boolean includeLocale)
          Deprecated.  
private  Object scriptOutput(String script, Object context, Locale locale, boolean includeLocale, boolean isCached, CachedHTMLTemplate cachedTemplate, boolean retTemplate)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
Deprecated. 
See Also:
Constant Field Values

in

private PushbackInputStream in
Deprecated. 

END_SCRIPT_STR

private static final String END_SCRIPT_STR
Deprecated. 
See Also:
Constant Field Values

SCRIPT_STR

private static final String SCRIPT_STR
Deprecated. 
See Also:
Constant Field Values

WINDCHILL_STR

private static final String WINDCHILL_STR
Deprecated. 
See Also:
Constant Field Values

COMMENT_STR

private static final String COMMENT_STR
Deprecated. 
See Also:
Constant Field Values

END_COMMENT_STR

private static final String END_COMMENT_STR
Deprecated. 
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
Deprecated. 
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE
Deprecated. 

DEBUG

private static final boolean DEBUG
Deprecated. 

BUFFER_SIZE

private static final int BUFFER_SIZE
Deprecated. 
See Also:
Constant Field Values

LOCALIZED_METHODS

private static final String LOCALIZED_METHODS
Deprecated. 

RECURSE_KEY

private static final String RECURSE_KEY
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

ProcessTemplate

public ProcessTemplate()
Deprecated. 
Method Detail

newLocalizedString

private String newLocalizedString(String encoding,
                                  byte[] buffer,
                                  int start,
                                  int length)
Deprecated. 
Creates a string from a byte buffer and encoding.

Parameters:
buffer - The byte array
start - The position in the array to start
length - The number of bytes to use

expandBuffer

private byte[] expandBuffer(byte[] buffer,
                            int size)
Deprecated. 
Expands the specified buffer by size bytes and returns the new buffer

Parameters:
buffer - The byte array to expand
size - the amount to expand it

processTemplateCached

public CachedHTMLTemplate processTemplateCached(InputStream in,
                                                Object context,
                                                Locale locale)
                                         throws WTException
Deprecated. 
Called initially to process an HTML 'template' and cache the results of the parsing. Any exceptions thrown by the template processing code are wrapped in a WTException and re-thrown.

Parameters:
in - The input stream
context - The context associated with any methods found
locale - The Locale to send to the invoked method.
Throws:
WTException - Thrown when an error is detected when processing the template

parseTemplate

private void parseTemplate(PushbackInputStream in,
                           OutputStream out,
                           Object context,
                           Locale locale,
                           boolean includeLocale)
                    throws WTException
Deprecated. 
ParseTemplate reads through the input looking for Windchill scripts. If a Windchill script is found, the method specified is invoked.

Parameters:
in - The input stream
out - The output stream
context - The context associated with any methods found, null if the methods are static.
locale - The Locale to send to the invoked methods for localization.
includeLocale - Indicates if the Locale is to be sent as a parameter to the invoked method. If true, the locale is sent as the second to last parameter, with OutputStream being the last.
Throws:
WTException - Thrown if there is an error detected when parsing the template

parseTemplate

private CachedHTMLTemplate parseTemplate(PushbackInputStream in,
                                         OutputStream out,
                                         Object context,
                                         Locale locale,
                                         boolean includeLocale,
                                         boolean isCached)
                                  throws WTException
Deprecated. 
Throws:
WTException

processMethod

private CachedHTMLTemplate processMethod(String method_line,
                                         OutputStream out,
                                         Object context,
                                         Locale locale,
                                         boolean includeLocale,
                                         boolean isCached,
                                         CachedHTMLTemplate inputTemplate,
                                         boolean retTemplate)
                                  throws WTException,
                                         IOException
Deprecated. 
Process a script method line. If !isCached, the method will be executed. If isCached, a CachedHTMLTemplate will be returned for this method.

Throws:
WTException
IOException

scriptOutput

public String scriptOutput(String script,
                           Object context,
                           Locale locale,
                           boolean includeLocale)
                    throws WTException,
                           IOException
Deprecated. 
Throws:
WTException
IOException

scriptOutput

private Object scriptOutput(String script,
                            Object context,
                            Locale locale,
                            boolean includeLocale,
                            boolean isCached,
                            CachedHTMLTemplate cachedTemplate,
                            boolean retTemplate)
                     throws WTException,
                            IOException
Deprecated. 
Throws:
WTException
IOException

parseTemplate

private void parseTemplate(PushbackInputStream in,
                           OutputStream out,
                           Object context)
                    throws WTException
Deprecated. 
ParseTemplate reads through the input looking for Windchill scripts. If a Windchill script is found, the method specified is invoked.

Parameters:
in - The input stream
out - The output stream
context - The context associated with any methods found, null if the methods are static.
Throws:
WTException - Thrown if there is an error detected when parsing the template

processTemplate

public void processTemplate(InputStream in,
                            OutputStream out)
                     throws WTException
Deprecated. 
Called initially to process an HTML 'template'.

Parameters:
in - The input stream
out - The output stream
Throws:
WTException - Thrown when an error is detected when processing the template

processTemplate

public void processTemplate(InputStream in,
                            OutputStream out,
                            Object context)
                     throws WTException
Deprecated. 
Called initially to process an HTML 'template'.

Parameters:
in - The input stream
out - The output stream
context - The context associated with any methods found
Throws:
WTException - Thrown when an error is detected when processing the template

processTemplate

public void processTemplate(InputStream in,
                            OutputStream out,
                            Locale locale)
                     throws WTException
Deprecated. 
Called initially to process an HTML 'template'.

Parameters:
in - The input stream
out - The output stream
locale - The Locale to send to the invoked method.
Throws:
WTException - Thrown when an error is detected when processing the template

processTemplate

public void processTemplate(InputStream in,
                            OutputStream out,
                            Object context,
                            Locale locale)
                     throws WTException
Deprecated. 
Called initially to process an HTML 'template'.

Parameters:
in - The input stream
out - The output stream
context - The context associated with any methods found
locale - The Locale to send to the invoked method.
Throws:
WTException - Thrown when an error is detected when processing the template

main

public static void main(String[] args)
Deprecated.