com.sage.swt.client.ui.builder
Class ApplicationParameters

java.lang.Object
  extended by com.sage.swt.client.ui.builder.ApplicationParameters

public final class ApplicationParameters
extends java.lang.Object

A class that can be used to identify all URL parameters that are related to a specific application, as well as helpers used to build such URLs. In each URL you specify a list of applications that there are parameters for using the parameter APPL. For example you can specify parameters for the application sageERP, and sageCRM by listing the applications by using the following URL:

http://myserver?APPL=sageERP&APPL=sageCRM

To specify application specific parameters they must be prefixed with the application name followed by an underscore followed by the parameter name. For example you can specify parameters for applications sageERP, and sageCRM by using the following URL:

http://myserver?APPL=sageERP&APPL=sageCRM&sageERP_DATASET=SAMINC& sageCRM_DATASET=myCompany

In the above example the application sageERP has one parameter namely DATASET whose value is SAMINC, and the application sageCRM has one parameter namely DATASET whose value is myCompany.

Note: When the parameters are referenced or enumerated for each application the are not prefixed by there application name. So if the parameters are enumerated for sageERP the values returned would be DATASET=SAMINC.


Field Summary
static java.lang.String SAGEERP_APP
           
 
Method Summary
static java.lang.String buildSageERPURL(java.lang.String urlPath, java.util.Map<java.lang.String,java.lang.String> parameters)
          Builds a URL that includes the specified path, a special parameter indicating that the application name for parameters will have a SAGEERP prefix, and parameters relating to the SAGEERP application.
static java.lang.String buildURL(java.lang.String urlPath, java.lang.String appName, java.util.Map<java.lang.String,java.lang.String> parameters)
          Builds a URL that includes the specified path, a special parameter indicating the application name, and parameters relating to that application.
static java.lang.String get(java.lang.String applicationName, java.lang.String parameterName)
          This method returns a parameter for a given application and parameter name.
static java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getAllParameters(java.lang.String application)
          This method performs a case insensitive lookup for the parameters for a given application.
static java.util.List<java.lang.String> getApplications()
          This method returns a list of applications that there are parameters for.
static java.lang.String getDebugName()
          Class debug name.
static boolean getKeepSessionAlive()
          Returns true if the KEEPSESSIONALIVE_PARAMETER is set to "true" or "yes".
static java.lang.String getQueryString()
          This method returns the application specific parameter query string.
static java.lang.String getQueryString(java.lang.String applicationName)
          This method returns a query string for a specific application.
static java.lang.String getSageERPDataset()
          Gets the DATASET for the Sage ERP application, or null if that dataset has not been set yet.
static java.lang.String getSageERPLanguage()
          Gets the LANGUAGE for the Sage ERP application, or null if that has not been set yet.
static java.util.Date getSageERPSessionDate()
          Gets the session date for the Sage ERP application, or null if that date has not been set yet.
static java.lang.String getSwtServicesDataset()
          Gets the DATASET for the SWT Services application, or null if that dataset has not been set yet.
static java.util.List<java.lang.String> getValues(java.lang.String applicationName, java.lang.String parameterName)
          This method returns a list of parameter values for a given application and parameter name.
static boolean isKeepSessionAliveSet()
          Returns whether or not the KEEPSESSIONALIVE parameter for the Sage ERP application has been specified.
static boolean isSageERPDatasetSet()
          Returns whether or not the DATASET for the Sage ERP application has been specified.
static boolean isSageERPLanguageSet()
          Returns whether or not the LANGUAGE parameter for the Sage ERP application has been specified.
static boolean isSageERPSessionDateSet()
          Returns whether or not the Sage ERP application's Session Date has been set.
static boolean isSwtServicesDatasetSet()
          Returns whether or not the DATASET for the Sage ERP application has been specified.
static void setKeepSessionAlive(boolean keepSessionAlive)
          Sets the keep session alive parameter.
static void setSageERPDataset(java.lang.String dataset)
          Set the DATASET parameter for the Sage ERP application.
static void setSageERPLanguage(java.lang.String language)
          Set the LANGUAGE parameter for the Sage ERP application.
static void setSageERPSessionDate(java.util.Date sessionDate)
          Set the session date parameter for the Sage ERP application.
static void setSwtServicesDataset(java.lang.String dataset)
          Set the DATASET parameter for the SWT Services application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAGEERP_APP

public static final java.lang.String SAGEERP_APP
See Also:
Constant Field Values
Method Detail

getDebugName

public static java.lang.String getDebugName()
Class debug name.

Returns:
"Application Parameters"

getAllParameters

public static java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getAllParameters(java.lang.String application)
This method performs a case insensitive lookup for the parameters for a given application.

For example: getApplicationsParameters("sageERP") would return all of the application parameters specified for sageERP.

Parameters:
application - name to look up the parameters for. The look up is case insensitive.
Returns:
name and value pairs representing the parameters for the given application. Returns null if the applications was not specified.

get

public static java.lang.String get(java.lang.String applicationName,
                                   java.lang.String parameterName)
This method returns a parameter for a given application and parameter name. The lookup of the application and parameter are case insensitive.

Parameters:
applicationName - for example "sageERP"
parameterName - for example "DATASET"
Returns:
a list of values for the given application and parameter name.

getValues

public static java.util.List<java.lang.String> getValues(java.lang.String applicationName,
                                                         java.lang.String parameterName)
This method returns a list of parameter values for a given application and parameter name. The lookup of the application and parameter are case insensitive.

Parameters:
applicationName - for example "sageERP"
parameterName - for example "DATASET"
Returns:
a list of values for the given application and parameter name.

getApplications

public static java.util.List<java.lang.String> getApplications()
This method returns a list of applications that there are parameters for.

Returns:
a list of applications there are parameters for.

getQueryString

public static java.lang.String getQueryString()
This method returns the application specific parameter query string. Any additional parameters that are not application specific are not returned as part of the query string.

For example:

&APPL=SAGEERP&APPL=SAGECRM&SAGEERP_DATASET=SAMINC&SAGEERP_SESSIONDATE= 2000-12-31&SAGECRM_DATASET=SAGE

Returns:
application query string.

getQueryString

public static java.lang.String getQueryString(java.lang.String applicationName)
This method returns a query string for a specific application. Any additional parameters that are not application specific are not returned as part of the query string.

For example:

&APPL=SAGEERP&SAGEERP_DATASET=SAMINC&SAGEERP_SESSIONDATE=2000-12-31

Parameters:
applicationName - the application name for example SAGEERP
Returns:
Query string

getSageERPDataset

public static java.lang.String getSageERPDataset()
Gets the DATASET for the Sage ERP application, or null if that dataset has not been set yet.

Returns:
The DATASET for the Sage ERP application, or null if that dataset has not been set yet.

setSageERPDataset

public static void setSageERPDataset(java.lang.String dataset)
Set the DATASET parameter for the Sage ERP application.

Parameters:
dataset - The DATASET parameter for the Sage ERP application.

getSageERPLanguage

public static java.lang.String getSageERPLanguage()
Gets the LANGUAGE for the Sage ERP application, or null if that has not been set yet. This is typically set to the default language of the user after they sign on.

Returns:
The LANGUAGE for the Sage ERP application, or null if that has not been set yet.

setSageERPLanguage

public static void setSageERPLanguage(java.lang.String language)
Set the LANGUAGE parameter for the Sage ERP application. This is typically set to the default language of the user after they sign on.

Parameters:
language - The LANGUAGE parameter for the Sage ERP application.

isSageERPLanguageSet

public static boolean isSageERPLanguageSet()
Returns whether or not the LANGUAGE parameter for the Sage ERP application has been specified.

Returns:
true if the LANGUAGE parameter is set to any value, otherwise returns false.

isKeepSessionAliveSet

public static boolean isKeepSessionAliveSet()
Returns whether or not the KEEPSESSIONALIVE parameter for the Sage ERP application has been specified.

Returns:
true if the Keep Alive parameter is set to any value, otherwise returns false.

getKeepSessionAlive

public static boolean getKeepSessionAlive()
Returns true if the KEEPSESSIONALIVE_PARAMETER is set to "true" or "yes".

Returns:
true if the KEEPSESSIONALIVE_PARAMETER is set to "true" or "yes". Returns false otherwise.

setKeepSessionAlive

public static void setKeepSessionAlive(boolean keepSessionAlive)
Sets the keep session alive parameter. If this parameter is already set then it will be reset to this value.

Parameters:
keepSessionAlive -

isSageERPDatasetSet

public static boolean isSageERPDatasetSet()
Returns whether or not the DATASET for the Sage ERP application has been specified.

Returns:
Whether or not the DATASET for the Sage ERP application has been specified.

getSageERPSessionDate

public static java.util.Date getSageERPSessionDate()
Gets the session date for the Sage ERP application, or null if that date has not been set yet.

Returns:
The session date for the Sage ERP application, or null if that date has not been set yet.

setSageERPSessionDate

public static void setSageERPSessionDate(java.util.Date sessionDate)
Set the session date parameter for the Sage ERP application.

Parameters:
sessionDate - The session date parameter for the Sage ERP application.

isSageERPSessionDateSet

public static boolean isSageERPSessionDateSet()
Returns whether or not the Sage ERP application's Session Date has been set.

Returns:
Whether or not the Sage ERP application's Session Date has been set.

getSwtServicesDataset

public static java.lang.String getSwtServicesDataset()
Gets the DATASET for the SWT Services application, or null if that dataset has not been set yet.

Returns:
The DATASET for the SWT Services application, or null if that dataset has not been set yet.

setSwtServicesDataset

public static void setSwtServicesDataset(java.lang.String dataset)
Set the DATASET parameter for the SWT Services application.

Parameters:
dataset - The DATASET parameter for the SWT Services application.

isSwtServicesDatasetSet

public static boolean isSwtServicesDatasetSet()
Returns whether or not the DATASET for the Sage ERP application has been specified.

Returns:
Whether or not the DATASET for the Sage ERP application has been specified.

buildSageERPURL

public static java.lang.String buildSageERPURL(java.lang.String urlPath,
                                               java.util.Map<java.lang.String,java.lang.String> parameters)
Builds a URL that includes the specified path, a special parameter indicating that the application name for parameters will have a SAGEERP prefix, and parameters relating to the SAGEERP application. This method is useful for building URLs for launching UIs with initialization data.

Parameters:
urlPath - The path portion of the URL, which does not include any parameters and which is not encoded.
parameters - An optional map of parameters, keyed by their non-prefixed names (in other words, those names do not include "SAGEERP_"), and whose values are not encoded.
Returns:
The URL that includes the specified path and parameters relating to the SAGEERP application.

buildURL

public static java.lang.String buildURL(java.lang.String urlPath,
                                        java.lang.String appName,
                                        java.util.Map<java.lang.String,java.lang.String> parameters)
Builds a URL that includes the specified path, a special parameter indicating the application name, and parameters relating to that application. This method takes care of encoding the URL parameter values. This method is useful for building URLs for launching UIs with initialization data.

Parameters:
urlPath - The path portion of the URL, which does not include any parameters and which is not encoded.
appName - The application name that will be the prefix for the parameter names (for example, "SAGEERP").
parameters - An optional map of parameters, keyed by their non-prefixed names (in other words, those names do not include "[appName]_"), and whose values are not encoded.
Returns:
The URL that includes the specified path, a special parameter indicating the application name, and parameters relating to that application.


Copyright © 2011 Sage Software, Inc. All rights reserved.