com.plumtree.uiinfrastructure.helpers
Class ConfigService

java.lang.Object
  extended by com.plumtree.uiinfrastructure.helpers.ConfigService
All Implemented Interfaces:
IConfigHelper
Direct Known Subclasses:
PTConfigService

public class ConfigService
extends java.lang.Object
implements IConfigHelper

A service that provides access to the config helper object.


Constructor Summary
protected ConfigService()
           
 
Method Summary
 java.lang.String GetApplicationBaseURL(AActivitySpace asSpace)
          JF- Returns the Application URL according to the URL Mapping.
 java.lang.String GetApplicationBaseURL(java.lang.String _sNormalizedBaseURL)
          JF- Returns the Application URL according to the URL Mapping.
 java.lang.String GetApplicationBaseURL(java.lang.String _sNormalizedBaseURL, boolean _bSecure)
          JF- Returns the Application URL according to the URL Mapping and the security.
 java.lang.String GetApplicationBaseURLToAS(java.lang.String _sNormalizedBaseURL, java.lang.String _sASName, boolean _bIsSubSpace)
          JF- Returns the Application URL according to the URL Mapping and determines the security according to the space name in argument.
 java.lang.String GetHTTPEntryPoint()
          JF- Returns the value of the HTTP Entry point from x_config.xml E.g.: server.pt
 java.lang.String GetImageServerBaseURL(AActivitySpace asSpace)
          This method used to return the Portal Image Server Base URL.
static IConfigHelper getInstance()
           
 java.lang.String GetJSIncluderComponentPath(java.lang.String strJSComponentName, java.lang.String strImageServerURL)
           
 HTMLElementCollection GetJSIncluderJSComponentInclude(java.lang.String strJSComponentName, AActivitySpace owner)
          HTMLElement with a script blocks including the javascript files for the given jscomponent.
 HTMLElementCollection GetJSIncluderJSComponentInclude(java.lang.String strJSComponentName, boolean bEnableDebug, AActivitySpace owner, XPLocale locale)
          HTMLElement with a script blocks including the javascript files for the given jscomponent.
 java.lang.String GetJSIncluderVersionPrefix(java.lang.String strJSComponentName)
           
 java.lang.String GetMainServerApplicationURL(boolean _bIsSecure)
          JF- Returns the Main server URL from x_config.xml
 java.lang.String GetNormalizedBaseURL(java.lang.String _sURL)
          DLH- Helper method to return the normalized base URL for use in determining the correct application base url.
static void setTestInstance(IConfigHelper testHelper)
          Unit tests should use this method to overwrite/teardown existing helper singleton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigService

protected ConfigService()
Method Detail

getInstance

public static IConfigHelper getInstance()
Returns:
The singleton config helper.

setTestInstance

public static void setTestInstance(IConfigHelper testHelper)
Unit tests should use this method to overwrite/teardown existing helper singleton. DO NOT USE for production code. NOTE: When finished with a unit test, this should be set back to null so as not to interfere with other tests.


GetJSIncluderComponentPath

public java.lang.String GetJSIncluderComponentPath(java.lang.String strJSComponentName,
                                                   java.lang.String strImageServerURL)
Specified by:
GetJSIncluderComponentPath in interface IConfigHelper
Returns:
the path to a particular JS component

GetJSIncluderJSComponentInclude

public HTMLElementCollection GetJSIncluderJSComponentInclude(java.lang.String strJSComponentName,
                                                             AActivitySpace owner)
Description copied from interface: IConfigHelper
HTMLElement with a script blocks including the javascript files for the given jscomponent.

Specified by:
GetJSIncluderJSComponentInclude in interface IConfigHelper
Parameters:
strJSComponentName - JSComponent name. For example "jsxml" or "jsutil", the common components have constants defined in ConfigHelper.
owner - Current activityspace
Returns:

GetJSIncluderJSComponentInclude

public HTMLElementCollection GetJSIncluderJSComponentInclude(java.lang.String strJSComponentName,
                                                             boolean bEnableDebug,
                                                             AActivitySpace owner,
                                                             XPLocale locale)
Description copied from interface: IConfigHelper
HTMLElement with a script blocks including the javascript files for the given jscomponent.

Specified by:
GetJSIncluderJSComponentInclude in interface IConfigHelper
Parameters:
strJSComponentName - JSComponent name. For example "jsxml" or "jsutil", the common components have constants defined in ConfigHelper.
owner - Current activityspace
Returns:

GetJSIncluderVersionPrefix

public java.lang.String GetJSIncluderVersionPrefix(java.lang.String strJSComponentName)
Specified by:
GetJSIncluderVersionPrefix in interface IConfigHelper
Parameters:
strJSComponentName - JSComponent name included through JSIncluder Example: " jsxml" or "jsutil"
Returns:

GetApplicationBaseURL

public java.lang.String GetApplicationBaseURL(java.lang.String _sNormalizedBaseURL,
                                              boolean _bSecure)
Description copied from interface: IConfigHelper
JF- Returns the Application URL according to the URL Mapping and the security. Warning: depending on the security mode, the security in argument might not make sense. E.g.: in mode 0, it doesn't make sense to request the secure URL (and it might just return an empty URL) The normalized base URL is available either cached on the AActivitySpace or by calling ConfigHelper.GetNormalizedBaseURL with the current request URL.

Specified by:
GetApplicationBaseURL in interface IConfigHelper
Parameters:
_sNormalizedBaseURL - the normalized base URL from the current request.
_bSecure - HTTP or HTTPS
Returns:
String

GetApplicationBaseURL

public java.lang.String GetApplicationBaseURL(AActivitySpace asSpace)
Description copied from interface: IConfigHelper
JF- Returns the Application URL according to the URL Mapping. Warning: In mode 1, it returns the non secure URL by default.

Specified by:
GetApplicationBaseURL in interface IConfigHelper
Returns:
String

GetApplicationBaseURL

public java.lang.String GetApplicationBaseURL(java.lang.String _sNormalizedBaseURL)
Description copied from interface: IConfigHelper
JF- Returns the Application URL according to the URL Mapping. Warning: In mode 1, it returns the non secure URL by default. GetApplicationBaseURL(AActivitySpace) should be used if possible.

Specified by:
GetApplicationBaseURL in interface IConfigHelper
Parameters:
_sNormalizedBaseURL - Normalized Base URL from the AActivity Space (or ConfigHelper.GetNormalizedBaseURL).
Returns:
String

GetApplicationBaseURLToAS

public java.lang.String GetApplicationBaseURLToAS(java.lang.String _sNormalizedBaseURL,
                                                  java.lang.String _sASName,
                                                  boolean _bIsSubSpace)
Description copied from interface: IConfigHelper
JF- Returns the Application URL according to the URL Mapping and determines the security according to the space name in argument.

Specified by:
GetApplicationBaseURLToAS in interface IConfigHelper
Parameters:
_sNormalizedBaseURL - Normalized Base URL from the AActivity Space. (or ConfigHelper.GetNormalizedBaseURL).
_sASName - Name of the destination Activity Space
_bIsSubSpace - Is the target AS a sub space?
Returns:
String

GetHTTPEntryPoint

public java.lang.String GetHTTPEntryPoint()
Description copied from interface: IConfigHelper
JF- Returns the value of the HTTP Entry point from x_config.xml E.g.: server.pt

Specified by:
GetHTTPEntryPoint in interface IConfigHelper
Returns:
String

GetMainServerApplicationURL

public java.lang.String GetMainServerApplicationURL(boolean _bIsSecure)
Description copied from interface: IConfigHelper
JF- Returns the Main server URL from x_config.xml

Specified by:
GetMainServerApplicationURL in interface IConfigHelper
Parameters:
_bIsSecure - HTTP or HTTPS
Returns:
String

GetImageServerBaseURL

public java.lang.String GetImageServerBaseURL(AActivitySpace asSpace)
Description copied from interface: IConfigHelper
This method used to return the Portal Image Server Base URL.

Specified by:
GetImageServerBaseURL in interface IConfigHelper
Returns:
String the Portal image server base URL.

GetNormalizedBaseURL

public java.lang.String GetNormalizedBaseURL(java.lang.String _sURL)
Description copied from interface: IConfigHelper
DLH- Helper method to return the normalized base URL for use in determining the correct application base url.

Specified by:
GetNormalizedBaseURL in interface IConfigHelper
Returns:
String the normalized base URL



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.