|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.help.HelpLinkHelper
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
HelpLinkHelper helper = new HelpLinkHelper();
String href = HelpLinkHelper.createHelpHREF(
factory,"online/vc/VCIterationHistoryView.html",locale,helper);
services.properties
file for a action and context. An example of this might be String href = HelpLinkHelper.createHelpHREF(
factory,new Object(), "CREATE", locale);
CREATE
. See the methods below for details on implementation.
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.
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
.
URLFactory
,
WTServiceProviderFromProperties
Field Summary | |
private static String |
DEFAULT_EXTENSION
static for the default extension |
private static String |
DEFAULT_LOCALE
static for the default locale |
private static String |
DEFAULT_SERVICE_NAME
static for the default service name |
static String |
HELP_HOME
static for the help home directory |
static String |
HELP_KEY
static for the help key path |
static String |
HELP_PATH
static for the help path name |
private String |
ivHelp_Home
|
private String |
ivHelp_Key
|
private String |
ivHelp_Path
|
private static Vector |
locales
static list of locales |
private static HelpLinkHelper |
localHelper
|
private static ApplicationContextServices |
provider
The service provider |
Constructor Summary | |
HelpLinkHelper()
|
|
HelpLinkHelper(String path,
String home)
This constructor will create a new help link helper set to the desired path and home. |
Method Summary | |
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. |
static void |
setHelpHome(String home)
This method will set the help home to be used when generating the help resource paths. |
static void |
setHelpPath(String path)
This method will set the help path to be used when generating the help resource paths. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String HELP_HOME
public static final String HELP_PATH
public static final String HELP_KEY
private static String DEFAULT_SERVICE_NAME
private static String DEFAULT_EXTENSION
private static String DEFAULT_LOCALE
private static Vector locales
private static ApplicationContextServices provider
private String ivHelp_Home
private String ivHelp_Path
private String ivHelp_Key
private static HelpLinkHelper localHelper
Constructor Detail |
public HelpLinkHelper()
public HelpLinkHelper(String path, String home)
path
- The Path for the help (typically "help")home
- The home of the help files ("wt/helpfiles" in foundation)Method Detail |
public static void setHelpPath(String path)
help
. This will
get translated to a localized name such as help_en
at runtime.
NOTE: This can be clobbered by multiple threads and is not thread safe!
public static void setHelpHome(String home)
wt/helpfiles
NOTE: This can be clobbered by multiple threads and is not thread safe!
home
- The help home pathpublic static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale, HashMap props) throws Exception
factory
- The URLFactory to use to instantiate the link.service_name
- The name of the service which contains help linkcontext
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the clientprops
- Optional Hashmap of properties (null valid)
Exception
- If the service is not found.public static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale, HashMap props, HelpLinkHelper helper) throws Exception
factory
- The URLFactory to use to instantiate the link.service_name
- The name of the service which contains help linkcontext
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the clientprops
- Optional Hashmap of properties (null valid)helper
- The Helper to use to generate the link (allowing for externalized helpers)
Exception
- If the service is not found.public static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale) throws Exception
factory
- The URLFactory to use to instantiate the link.service_name
- The name of the service which contains help linkcontext
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the client
Exception
- If the service is not found.public static String createHelpHREF(URLFactory factory, String service_name, Object context, String action, Locale locale, HelpLinkHelper helper) throws Exception
factory
- The URLFactory to use to instantiate the link.service_name
- The name of the service which contains help linkcontext
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the clienthelper
- The helper to use to generate the link
Exception
- If the service is not found.public static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale, HashMap props) throws Exception
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.
factory
- The URLFactory to use to instantiate the link.context
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the clientprops
- Optional Hashmap of properties (null valid)
Exception
- If the service is not found.public static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale, HashMap props, HelpLinkHelper helper) throws Exception
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.
factory
- The URLFactory to use to instantiate the link.context
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the clientprops
- Optional Hashmap of properties (null valid)helper
- The helper to use for link generation
Exception
- If the service is not found.public static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale) throws Exception
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.
factory
- The URLFactory to use to instantiate the link.context
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the client
Exception
- If the service is not found.public static String createHelpHREF(URLFactory factory, Object context, String action, Locale locale, HelpLinkHelper helper) throws Exception
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.
factory
- The URLFactory to use to instantiate the link.context
- The context object to apply the help link toaction
- The action to apply to the context for the helplocale
- The locale of the clienthelper
- The helper to use for help link generation
Exception
- If the service is not found.public static String determineHelpLocale(Locale locale)
wt.help.locales
from wt.properties
will
determine the optimal locale for the help pages.
locale
- The browser/client locale
public static String createHelpHREF(URLFactory factory, String resource, Locale locale, HashMap props) throws Exception
factory
- The URLFactory to use to generate the linkresource
- The desired help resourcelocale
- The locale of the clientprops
- The properties for the HREF.
Exception
public static String createHelpHREF(URLFactory factory, String resource, Locale locale, HashMap props, HelpLinkHelper helper) throws Exception
factory
- The URLFactory to use to generate the linkresource
- The desired help resourcelocale
- The locale of the clientprops
- The properties for the HREF.helper
- The helper to use to generate the HREF
Exception
public static String createHelpHREF(URLFactory factory, String resource, Locale locale) throws Exception
factory
- The URLFactory to use to generate the linkresource
- The desired help resourcelocale
- The locale of the client
Exception
public static String createHelpHREF(URLFactory factory, String resource, Locale locale, HelpLinkHelper helper) throws Exception
factory
- The URLFactory to use to generate the linkresource
- The desired help resourcelocale
- The locale of the clienthelper
- The helper to use to build the href
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |