wt.help
Class HelpLinkHelper

java.lang.Object
  extended by wt.help.HelpLinkHelper

public class HelpLinkHelper
extends Object

This class is used in conjunction with the URLFactory to generate HREF links for help files within the Windchill System. There are two methods provided for generating help files.

The first follows the pattern of the ServletHelpers where a resource is provided and URLFactory generates the HREF from this. An example of this might be



This resource name is taken from the help_XX path downward, where XX is the help locale (such as en or fr).

The second method involves a lookup from the services.properties file for a action and context. An example of this might be


This would utilize the resource referenced in services.properties to create a HREF for the correct language locale for the specific object with the action of CREATE. See the methods below for details on implementation.

If a null URLFactory is passed to the HelpLinkHelper methods a new URLFactory for the current default Method Server will be instantiated and used. All HREFs will be fully qualified by default in this case.

Helpfiles are unique that the localized resources are contained in localized directories, not localized filenames. As well, some locales do not map to an equivalent directory. For example, en_US and en_GB both map to en. As such, specific processing of the locale is required. This is performed by the determineHelpLocale(Locale) method as detailed below, which uses the property wt.help.locales in wt.properties to determine the valid locale from the supported locales. This method supports locale backoff, such that a locale like en_US backs off to en.

Supported API: true

Extendable: false

See Also:
URLFactory, WTServiceProviderFromProperties

Method Summary
static String createHelpHREF(wt.help.HelpLinkContext helpContext, Locale locale, HashMap props)
          This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale.
static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale)
          This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale.
static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale, HashMap props)
          This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale.
static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale, HashMap props, HelpLinkHelper helper)
          This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale.
static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale, HelpLinkHelper helper)
          This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale.
static String createHelpHREF(URLFactory factory, String resource, Locale locale)
          This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale.
static String createHelpHREF(URLFactory factory, String resource, Locale locale, HashMap props)
          This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale.
static String createHelpHREF(URLFactory factory, String resource, Locale locale, HashMap props, HelpLinkHelper helper)
          This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale.
static String createHelpHREF(URLFactory factory, String resource, Locale locale, HelpLinkHelper helper)
          This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale.
static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale)
          This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale.
static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale, HashMap props)
          This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale.
static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale, HashMap props, HelpLinkHelper helper)
          This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale.
static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale, HelpLinkHelper helper)
          This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale.
static String determineHelpLocale(Locale locale)
          This method will take the input locale and utilizing the property wt.help.locales from wt.properties will determine the optimal locale for the help pages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String service_name,
                                    Object context,
                                    String action,
                                    Locale locale,
                                    HashMap props)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
service_name - The name of the service which contains help link
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
props - Optional Hashmap of properties (null valid)
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(wt.help.HelpLinkContext helpContext,
                                    Locale locale,
                                    HashMap props)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
helpContext - The help context object
locale - The locale of the client
props - Optional Hashmap of properties (null valid)
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String service_name,
                                    Object context,
                                    String action,
                                    Locale locale,
                                    HashMap props,
                                    HelpLinkHelper helper)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
service_name - The name of the service which contains help link
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
props - Optional Hashmap of properties (null valid)
helper - The Helper to use to generate the link (allowing for externalized helpers)
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String service_name,
                                    Object context,
                                    String action,
                                    Locale locale)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
service_name - The name of the service which contains help link
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String service_name,
                                    Object context,
                                    String action,
                                    Locale locale,
                                    HelpLinkHelper helper)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated service_name, context and action for the given locale. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
service_name - The name of the service which contains help link
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
helper - The helper to use to generate the link
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    Object context,
                                    String action,
                                    Locale locale,
                                    HashMap props)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale. The service name will be DEFAULT_SERVICE_NAME which is defined to be wt.templateutil.processor.HelpHTMLTemplate by default. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
props - Optional Hashmap of properties (null valid)
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    Object context,
                                    String action,
                                    Locale locale,
                                    HashMap props,
                                    HelpLinkHelper helper)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale. The service name will be DEFAULT_SERVICE_NAME which is defined to be wt.templateutil.processor.HelpHTMLTemplate by default. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
props - Optional Hashmap of properties (null valid)
helper - The helper to use for link generation
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    Object context,
                                    String action,
                                    Locale locale)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale. The service name will be DEFAULT_SERVICE_NAME which is defined to be wt.templateutil.processor.HelpHTMLTemplate by default. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    Object context,
                                    String action,
                                    Locale locale,
                                    HelpLinkHelper helper)
                             throws Exception
This method will generate a Help HREF using the services.properties entry defined by the designated context and action for the given locale. The service name will be DEFAULT_SERVICE_NAME which is defined to be wt.templateutil.processor.HelpHTMLTemplate by default. If this service is not found, an attempt to obtain the filename for the context of 'Object' and 'DEFAULT_HELP_PAGE' action will be made. if this fails, an exception will be thrown.

Supported API: true

Parameters:
factory - The URLFactory to use to instantiate the link.
context - The context object to apply the help link to
action - The action to apply to the context for the help
locale - The locale of the client
helper - The helper to use for help link generation
Returns:
The HREF generated for the correct locale for the desired help context from the services.properties.
Throws:
Exception - If the service is not found.

determineHelpLocale

public static String determineHelpLocale(Locale locale)
This method will take the input locale and utilizing the property wt.help.locales from wt.properties will determine the optimal locale for the help pages.

Supported API: true

Parameters:
locale - The browser/client locale
Returns:
the matching locale or null if no match

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String resource,
                                    Locale locale,
                                    HashMap props)
                             throws Exception
This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale. For example, to obtain the correct HREF for the resource "wt/helpfiles/help_XX/online/vc/MyHelp.html" the resource should be "online/vc/MyHelp.html". If URLFactory mapping is being used to remap a component the entire resource name should be remapped (for example: "wt/helpfiles/help_en/online/vc/MyHelp.html").

Supported API: true

Parameters:
factory - The URLFactory to use to generate the link
resource - The desired help resource
locale - The locale of the client
props - The properties for the HREF.
Returns:
the HREF to the help resource.
Throws:
Exception

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String resource,
                                    Locale locale,
                                    HashMap props,
                                    HelpLinkHelper helper)
                             throws Exception
This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale. For example, to obtain the correct HREF for the resource "wt/helpfiles/help_XX/online/vc/MyHelp.html" the resource should be "online/vc/MyHelp.html". If URLFactory mapping is being used to remap a component the entire resource name should be remapped (for example: "wt/helpfiles/help_en/online/vc/MyHelp.html").

Supported API: true

Parameters:
factory - The URLFactory to use to generate the link
resource - The desired help resource
locale - The locale of the client
props - The properties for the HREF.
helper - The helper to use to generate the HREF
Returns:
the HREF to the help resource.
Throws:
Exception

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String resource,
                                    Locale locale)
                             throws Exception
This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale. For example, to obtain the correct HREF for the resource "wt/helpfiles/help_XX/online/vc/MyHelp.html" the resource should be "online/vc/MyHelp.html". If URLFactory mapping is being used to remap a component the entire resource name should be remapped (for example: "wt/helpfiles/help_en/online/vc/MyHelp.html").

Supported API: true

Parameters:
factory - The URLFactory to use to generate the link
resource - The desired help resource
locale - The locale of the client
Returns:
the HREF to the help resource.
Throws:
Exception

createHelpHREF

public static String createHelpHREF(URLFactory factory,
                                    String resource,
                                    Locale locale,
                                    HelpLinkHelper helper)
                             throws Exception
This method will generate a HREF for the help resource referenced post the /help_XX path for the desired locale. For example, to obtain the correct HREF for the resource "wt/helpfiles/help_XX/online/vc/MyHelp.html" the resource should be "online/vc/MyHelp.html". If URLFactory mapping is being used to remap a component the entire resource name should be remapped (for example: "wt/helpfiles/help_en/online/vc/MyHelp.html").

Supported API: true

Parameters:
factory - The URLFactory to use to generate the link
resource - The desired help resource
locale - The locale of the client
helper - The helper to use to build the href
Returns:
the HREF to the help resource.
Throws:
Exception