wt.templateutil.processor
Class HelpHTMLTemplateFactory

java.lang.Object
  extended bywt.templateutil.processor.AbstractHTMLTemplateFactory
      extended bywt.templateutil.processor.DefaultHTMLTemplateFactory
          extended bywt.templateutil.processor.HelpHTMLTemplateFactory
All Implemented Interfaces:
ApplicationContextChild, ContextHolder, TemplateNameProcessor
Direct Known Subclasses:
TutorialTemplateFactory

public class HelpHTMLTemplateFactory
extends DefaultHTMLTemplateFactory

Deprecation Notice: This class is still valid for this release, however this serves as advance notice that it will be removed in the future. All user interfaces built using the Windchill HTML Template Processing client architecture will be rewritten using a different framework in an upcoming release. This class provides a context based, HTML Help Page service. This service functions very much like the DefaultHTMLTemplateFactory that is subclasses. The main difference is that the DefaultHTMLTemplateFactory localizes the name of the HTML template file while the HelpHTMLTemplateFactory localizes the directory path to the HTML Template file.

This service will first try and generate the Help File URL to the localized help based the Release 5.0 Help file localization scheme. If this fails, then the Release 4.0 localization scheme is tried to generate the URL to a localized help file. If both fail, an exception is thrown.

In Release 4.0, the directory path to a Help File was localized on the the last directory in the path. For example, the path to

/wt/helpfiles/search/help/htmlsearch.html

would be localized as

/wt/helpfiles/search/help_en_US/htmlsearch.html

In Release 5.0 the directory path to the Help File is localized on the directory named help assuming that the relative path from codebase begins with

/wt/helpfiles/help/...

In this case, an example of the localization would be

/wt/helpfiles/help/search/htmlsearch.html

would be localized as

/wt/helpfiles/help_en_US/search/htmlsearch.html

The service name for the HelpHTMLTemplateFactory is "wt.templateutil.processor.HelpHTMLTemplate". As is the case with the DefaultHTMLTemplateFactory, you can set the service name with the method setServiceName.

An example of code using the HelpHTMLTemplateFactory is

wt.templateutil.processor.HelpHTMLTemplateFactory templateFactory = new wt.templateutil.processor.HelpHTMLTemplateFactory();
templateFactory.setLocale( locale );
templateFactory.setContextAction( helpContext );
if ( getContextObj() != null )
{
templateFactory.setContextObj( getContextObj() );
}
else if ( getContextClassName() != null)
{
templateFactory.setContextClassName( getContextClassName() );
}
String templateName = templateFactory.getHTMLHelpPagePath();


Supported API: true

Extendable: false


Field Summary
private static String CLASSNAME
          Deprecated.  
private static Hashtable directoryCache
          Deprecated.  
private  String fileKey
          Deprecated.  
private  String fileName
          Deprecated.  
private static String HELP_HOME
          Deprecated.  
static String PDM_HELP_HOME
          Deprecated.  
private  String relativeFilePath
          Deprecated.  
private  String relativeURL
          Deprecated.  
private static String RESOURCE
          Deprecated.  
private  String trueFilePath
          Deprecated.  
private static boolean VERBOSE
          Deprecated.  
private static String wt_home
          Deprecated.  
 
Fields inherited from class wt.templateutil.processor.DefaultHTMLTemplateFactory
CODEBASE, newFileSeparator, oldFileSeparator
 
Fields inherited from class wt.templateutil.processor.AbstractHTMLTemplateFactory
 
Fields inherited from interface wt.services.applicationcontext.ApplicationContextChild
APPLICATION_CONTEXT
 
Fields inherited from interface wt.templateutil.processor.ContextHolder
CONTEXT_ACTION, CONTEXT_CLASS_NAME, CONTEXT_OBJ, CONTEXT_PROPERTIES, FORM_DATA, QUERY_DATA, RESPONSE_EXCEPTIONS, RESPONSE_FOOTERS, RESPONSE_HEADERS, RESPONSE_MESSAGES, RESPONSE_STRING, STATUS
 
Constructor Summary
HelpHTMLTemplateFactory()
          Deprecated.  
 
Method Summary
protected static Hashtable getDirectoryCache()
          Deprecated.  
protected  String getFileKey()
          Deprecated.  
protected  String getFileName()
          Deprecated.  
static String getHELP_HOME()
          Deprecated.  
 boolean getHelpDirectory(String localeString, HelpDirectoryGenerator directoryGenerator)
          Deprecated.  
 String getHelpLink()
          Deprecated.  
 String getHTMLHelpPagePath()
          Deprecated.  
protected  String getRelativeFilePath()
          Deprecated.  
protected  String getRelativeURL()
          Deprecated.  
protected  String getTrueFilePath()
          Deprecated.  
static String getWt_home()
          Deprecated.  
 void initFileInfo()
          Deprecated.  
 void initLocale()
          Deprecated.  
protected static boolean isVERBOSE()
          Deprecated.  
static void main(String[] args)
          Deprecated. The main method can be used to find out is a particular HTML Help file is being found.
protected  LocalizedResource newLocalizedResource(String resourceName, String[] alternateExtensions)
          Deprecated.  
protected static void setDirectoryCache(Hashtable a_DirectoryCache)
          Deprecated.  
protected  void setFileKey(String a_FileKey)
          Deprecated.  
protected  void setFileName(String a_FileName)
          Deprecated.  
static void setHELP_HOME(String a_HELP_HOME)
          Deprecated.  
protected  void setRelativeFilePath(String a_RelativeFilePath)
          Deprecated.  
protected  void setRelativeURL(String a_RelativeURL)
          Deprecated.  
protected  void setTrueFilePath(String a_TrueFilePath)
          Deprecated.  
protected static void setVERBOSE(boolean a_VERBOSE)
          Deprecated.  
static void setWt_home(String a_Wt_home)
          Deprecated.  
 
Methods inherited from class wt.templateutil.processor.DefaultHTMLTemplateFactory
getHTMLTemplate, getNameProcessor, processTemplateName, setNameProcessor
 
Methods inherited from class wt.templateutil.processor.AbstractHTMLTemplateFactory
addToResponseExceptions, addToResponseFooters, addToResponseHeaders, addToResponseMessages, copyContextFrom, getApplicationContext, getContextAction, getContextClassName, getContextObj, getContextProperties, getFormData, getLanguagePreferences, getLocale, getQueryData, getResponseExceptions, getResponseFooters, getResponseHeaders, getResponseMessages, getResponseString, getServiceName, getState, getStatus, setApplicationContext, setContextAction, setContextClassName, setContextObj, setContextProperties, setFormData, setLanguagePreferences, setLanguagePreferences, setLanguagePreferences, setLocale, setQueryData, setResponseExceptions, setResponseFooters, setResponseHeaders, setResponseMessages, setResponseString, setServiceName, setState, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

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

CLASSNAME

private static final String CLASSNAME
Deprecated. 

HELP_HOME

private static String HELP_HOME
Deprecated. 

directoryCache

private static Hashtable directoryCache
Deprecated. 

VERBOSE

private static boolean VERBOSE
Deprecated. 

fileName

private String fileName
Deprecated. 

relativeFilePath

private String relativeFilePath
Deprecated. 

relativeURL

private String relativeURL
Deprecated. 

fileKey

private String fileKey
Deprecated. 

trueFilePath

private String trueFilePath
Deprecated. 

wt_home

private static String wt_home
Deprecated. 

PDM_HELP_HOME

public static final String PDM_HELP_HOME
Deprecated. 
Constructor Detail

HelpHTMLTemplateFactory

public HelpHTMLTemplateFactory()
                        throws UnableToLoadServiceProperties
Deprecated.  

Initializes the service name to "wt.templateutil.processor.HelpHTMLTemplate".

Supported API: true

Throws:
UnableToLoadServiceProperties
Method Detail

getHELP_HOME

public static String getHELP_HOME()
Deprecated.  

Gets the value of the attribute: HELP_HOME; Defines the default parent path for all help files that are using the Release 5.0 Help file organization

Supported API: true

Returns:
String

setHELP_HOME

public static void setHELP_HOME(String a_HELP_HOME)
Deprecated.  

Sets the value of the attribute: HELP_HOME; Defines the default parent path for all help files that are using the Release 5.0 Help file organization

Supported API: true

Parameters:
a_HELP_HOME -

getDirectoryCache

protected static Hashtable getDirectoryCache()
Deprecated.  

Gets the value of the attribute: directoryCache; Contains the mapping between <Relative Directory, Locale> and the <Best match available localized directory>. The purpose of this cache to prevent the continual reading of the drive to find the best match for a relative directory and a browser's locale.

Supported API: true

Returns:
Hashtable

setDirectoryCache

protected static void setDirectoryCache(Hashtable a_DirectoryCache)
Deprecated.  

Sets the value of the attribute: directoryCache; Contains the mapping between <Relative Directory, Locale> and the <Best match available localized directory>. The purpose of this cache to prevent the continual reading of the drive to find the best match for a relative directory and a browser's locale.

Supported API: true

Parameters:
a_DirectoryCache -

isVERBOSE

protected static boolean isVERBOSE()
Deprecated.  

Gets the value of the attribute: VERBOSE; This is a flag that will turn on progress messages and grounded exception stack traces.

Supported API: true

Returns:
boolean

setVERBOSE

protected static void setVERBOSE(boolean a_VERBOSE)
Deprecated.  

Sets the value of the attribute: VERBOSE; This is a flag that will turn on progress messages and grounded exception stack traces.

Supported API: true

Parameters:
a_VERBOSE -

getFileName

protected String getFileName()
Deprecated.  

Gets the value of the attribute: fileName; The file name as read in from the property file entry. The entry in the property is found based in the current contextObj and the current contextAction. The entry in the property file should be relative path from codebase and end with a file name and, optionally, an anchor in the web page.

Supported API: true

Returns:
String

setFileName

protected void setFileName(String a_FileName)
Deprecated.  

Sets the value of the attribute: fileName; The file name as read in from the property file entry. The entry in the property is found based in the current contextObj and the current contextAction. The entry in the property file should be relative path from codebase and end with a file name and, optionally, an anchor in the web page.

Supported API: true

Parameters:
a_FileName -

getRelativeFilePath

protected String getRelativeFilePath()
Deprecated.  

Gets the value of the attribute: relativeFilePath.

Supported API: true

Returns:
String

setRelativeFilePath

protected void setRelativeFilePath(String a_RelativeFilePath)
Deprecated.  

Sets the value of the attribute: relativeFilePath.

Supported API: true

Parameters:
a_RelativeFilePath -

getRelativeURL

protected String getRelativeURL()
Deprecated.  

Gets the value of the attribute: relativeURL; The anchor, if specified, from the entry in the properties file.

The entry in the property file should be relative path from codebase and end with a file name and, optionally, an anchor in the web page.

Supported API: true

Returns:
String

setRelativeURL

protected void setRelativeURL(String a_RelativeURL)
Deprecated.  

Sets the value of the attribute: relativeURL; The anchor, if specified, from the entry in the properties file.

The entry in the property file should be relative path from codebase and end with a file name and, optionally, an anchor in the web page.

Supported API: true

Parameters:
a_RelativeURL -

getFileKey

protected String getFileKey()
Deprecated.  

Gets the value of the attribute: fileKey; Defines the key used to locate, is available, the best match for a <Relative Directory, Locale> pair in the directoryCache.

The key is generated from the <Relative Directory, Locale> pair.

Supported API: true

Returns:
String

setFileKey

protected void setFileKey(String a_FileKey)
Deprecated.  

Sets the value of the attribute: fileKey; Defines the key used to locate, is available, the best match for a <Relative Directory, Locale> pair in the directoryCache.

The key is generated from the <Relative Directory, Locale> pair.

Supported API: true

Parameters:
a_FileKey -

getTrueFilePath

protected String getTrueFilePath()
Deprecated.  

Gets the value of the attribute: trueFilePath; Contains the relative directory that best matches the <Best match available localized directory> based on the fileKey. This value is used to generate the help file path.

Supported API: true

Returns:
String

setTrueFilePath

protected void setTrueFilePath(String a_TrueFilePath)
Deprecated.  

Sets the value of the attribute: trueFilePath; Contains the relative directory that best matches the <Best match available localized directory> based on the fileKey. This value is used to generate the help file path.

Supported API: true

Parameters:
a_TrueFilePath -

getWt_home

public static String getWt_home()
Deprecated.  

Gets the value of the attribute: wt_home; The value of the wt.home entry in wt.properties

Supported API: true

Returns:
String

setWt_home

public static void setWt_home(String a_Wt_home)
Deprecated.  

Sets the value of the attribute: wt_home; The value of the wt.home entry in wt.properties

Supported API: true

Parameters:
a_Wt_home -

getHTMLHelpPagePath

public String getHTMLHelpPagePath()
                           throws WTException
Deprecated.  

Returns the path to the HTML Help Page file relative to the codebase directory. The path of the HTML Help Page file is localized on the path to the file, not on the file name itself. The path to the the HTML Help Page is located from an entry in a *.property file based on the current context object and the current context action.

You can set the context object and the context action directly via the setters for the context object and the context action. You can also simply pass in an HTTPState object with the setState method and the the context object and context action will be retrieved directly from the HTTPState object.



Supported API: true

Returns:
String
Throws:
WTException

initLocale

public void initLocale()
                throws WTException
Deprecated.  

This methods sets the locale based on the preferences passed in from the browser and selects the best locale based on the locales available from the /templates/windchill_*.html templates.

Supported API: true

Throws:
WTException

initFileInfo

public void initFileInfo()
                  throws WTException
Deprecated.  

Retrieves an entry from a properties file based on the current context object and the current context action. If there is not a matching entry, an exception is thrown.

If a match is found, the following values are set :



Supported API: false

Throws:
WTException

getHelpDirectory

public boolean getHelpDirectory(String localeString,
                                HelpDirectoryGenerator directoryGenerator)
Deprecated.  

Returns a valid, localized directory based on Based on the HelpDirectoryGenerator used, the locale passed in and the relative file path are combined to give a localized directory.

If there is not a directory corresponding the locale passed in, the locale is reduced until a directory is found. If after reducing the locale no directory is found, the default localized directory is a directory localized to _en_US.



Supported API: true

Parameters:
localeString -
directoryGenerator -
Returns:
boolean

getHelpLink

public String getHelpLink()
                   throws WTException
Deprecated.  

Uses the currently selected, localized relative directory and the file name to see is an HTML file with that path and name exists. If one exists, a String representing the relative path and name of that HMTL file is returned.

If there is not an HTML file matching that relative file path and file name, a WTException is thrown.



Supported API: true

Returns:
String
Throws:
WTException

newLocalizedResource

protected LocalizedResource newLocalizedResource(String resourceName,
                                                 String[] alternateExtensions)
                                          throws WTException
Deprecated.  

Returns a new initialized wt.util.LocalizedResource for use in the getHelpLink() method.

Supported API: false

Parameters:
resourceName -
alternateExtensions -
Returns:
LocalizedResource
Throws:
WTException

main

public static void main(String[] args)
Deprecated. 
The main method can be used to find out is a particular HTML Help file is being found. The locale can be passed in to see if a localized version of the page is being found.

The correct usage of this method is :

java wt.templateutil.processor.HelpHTMLTemplateFactory