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

java.lang.Object
  extended by com.sage.swt.client.ui.builder.URLKey
All Implemented Interfaces:
java.lang.Comparable<URLKey>

public final class URLKey
extends java.lang.Object
implements java.lang.Comparable<URLKey>

URL key used by the caches to key items that are the result of content (such as declarative UI definitions) downloaded from URLs.


Method Summary
 int compareTo(URLKey o)
          
static URLKey createGenericKey(java.lang.String url)
          Creates a new URL key for the given URL.
static URLKey createKeyForDatasourceDefinition(java.lang.String definitionName)
           Creates a new URL key for the external datasource definition that we want to get from the given definition name.
static URLKey createKeyForHelp(java.lang.String webHelpPath, java.lang.String helpTopicID)
           Creates a new URL key from the Web Help url for the application and the id for a topic in the help.
static URLKey createKeyForSDATAQuery(java.lang.String queryURL)
           Creates a new URL key from an SDATA query URL.
static URLKey createKeyForSDataService(java.lang.String invocationURL)
           Creates a new URL key from an SDATA service operation invocation URL, where a tracking ID is not provided.
static URLKey createKeyForSDataService(java.lang.String invocationURL, java.lang.String trackingID)
           Creates a new URL key from an SDATA service invocation URL and a tracking ID.
static URLKey createKeyForSDataServiceProgress(java.lang.String progressTrackingURL)
           Creates a new URL key from an SDATA service progress tracking URL (for services that are invoked asynchronously).
static URLKey createKeyForTypeSchema(java.lang.String typeSchemaURL)
           Creates a new URL key for the type schema that we want to get from the given type schema URL.
static URLKey createKeyForUIDefinition(java.lang.String contractPath, java.lang.String version, java.lang.String category, java.lang.String name)
           Creates a new URL key for the UI definition that we want to get from the given SData contract path and UI definition SData key information (including its version, category, and name).
 boolean equals(java.lang.Object obj)
          
 int hashCode()
          
 java.lang.String toString()
          Gets the string form of the URL key, which is the underlying URL.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createGenericKey

public static URLKey createGenericKey(java.lang.String url)
Creates a new URL key for the given URL. No extra information is added to this URL.

Parameters:
url - The URL used for the key.
Returns:
The newly-created URL key for the URL.

createKeyForUIDefinition

public static URLKey createKeyForUIDefinition(java.lang.String contractPath,
                                              java.lang.String version,
                                              java.lang.String category,
                                              java.lang.String name)

Creates a new URL key for the UI definition that we want to get from the given SData contract path and UI definition SData key information (including its version, category, and name). That key will vary according to whether the application is being run in hosted mode or deployed.

If running in hosted mode, the declarative definition will be downloaded from the public\layouts folder of the project.

For example, if the contract path is "SDataServlet/.../UIDefinitions", the version is "ar60a", the category is "agedReceivables", and the name is "ARATBUIDefinition", the following URL key will be built:

Parameters:
contractPath - The contract portion of the SData path used to get the UI definition, with no path separator at the end (for example, "SDataServlet/.../UIDefinitions").
version - The version that the UI definition belongs to (for example, "ar60a").
category - The category that the UI definition belongs to (for example, "agedReceivables").
name - The name of the UI definition, which is the file name without the "xml" extension (for example, "ARATBUIDefinition").
Returns:
The newly-created URL key for retrieving the UI definition.
Throws:
java.lang.NullPointerException - At least one of the arguments is null.
java.lang.IllegalArgumentException - At least one of the arguments is empty.

createKeyForDatasourceDefinition

public static URLKey createKeyForDatasourceDefinition(java.lang.String definitionName)

Creates a new URL key for the external datasource definition that we want to get from the given definition name.

The datasource definition is retrieved from the public folder of the project. Its filename is the definition name plus the ".xml" extension.

For example, if the definition name is "AR2100DSDefinition", the URL key would be AR2100DSDefinition.xml.

Parameters:
definitionName - The name of the declarative datasources definition. For example, it might be "AR2100DSDefinition".
Returns:
The newly-created URL key for the external datasources definition.
Throws:
java.lang.NullPointerException - The definition name is null.
java.lang.IllegalArgumentException - The definition name is empty.

createKeyForTypeSchema

public static URLKey createKeyForTypeSchema(java.lang.String typeSchemaURL)

Creates a new URL key for the type schema that we want to get from the given type schema URL.

Parameters:
typeSchemaURL - The relative URL to the type schema. For example: StubServer/application('dataset')/contract/Customers/$schema
Returns:
The newly-created URL key for the type schema.
Throws:
java.lang.NullPointerException - The type schema path is null.
java.lang.IllegalArgumentException - The type schema path is empty.

createKeyForSDATAQuery

public static URLKey createKeyForSDATAQuery(java.lang.String queryURL)

Creates a new URL key from an SDATA query URL.

Parameters:
queryURL - The relative URL to the SDATA query. For example: StubServer/application /contract/dataset/Customers/?where=IDCUST%20EQ%20'1200'. All elements of the URL must already be encoded ready for transport, especially the resource selectors
Returns:
The newly-created URL key for the SDATA query.
Throws:
java.lang.NullPointerException - The SDATA query URL is null.
java.lang.IllegalArgumentException - The SDATA query URL is empty.

createKeyForSDataService

public static URLKey createKeyForSDataService(java.lang.String invocationURL)

Creates a new URL key from an SDATA service operation invocation URL, where a tracking ID is not provided. Since the tracking ID is not provided, the service operation would be invoked synchronously.

Parameters:
invocationURL - The relative URL for invoking the SDATA service operation. For example: StubServer/application/contract/dataset/Customers/$service /ageReceivables
Returns:
The newly-created URL key for invoking SDATA service operation synchronously.
Throws:
java.lang.NullPointerException - The invocation URL for the SDATA service operation is null.
java.lang.IllegalArgumentException - The invocation URL for the SDATA service operation is empty.

createKeyForSDataService

public static URLKey createKeyForSDataService(java.lang.String invocationURL,
                                              java.lang.String trackingID)

Creates a new URL key from an SDATA service invocation URL and a tracking ID. If the tracking ID is non-empty, the service would be invoked asynchronously. Otherwise, the service would be invoked synchronously.

Parameters:
invocationURL - The relative URL for invoking the SDATA service operation. For example: StubServer/application/contract/dataset/Customers/$service /ageReceivables
trackingID - The tracking ID for an asynchronous service invocation, or "" if the service is to be invoked synchronously.
Returns:
The newly-created URL key for invoking the SDATA service operation.
Throws:
java.lang.NullPointerException - The invocation URL for the SDATA service operation is null.
java.lang.IllegalArgumentException - The invocation URL for the SDATA service operation is empty.

createKeyForSDataServiceProgress

public static URLKey createKeyForSDataServiceProgress(java.lang.String progressTrackingURL)

Creates a new URL key from an SDATA service progress tracking URL (for services that are invoked asynchronously). That URL comes from the "Location" header of a service response that contains progress information (rather than the actual results of the service). That URL is called to get progress updates until the response comes back with the actual results of the service.

Parameters:
progressTrackingURL - The progress tracking URL, which would be a full URL. For example: http://myserver/StubServer/application/contract/dataset/ Customers/$service /ageReceivables('abc42b0d-d110-4f5c-ac79-d3aa11bd20cb')
Returns:
The newly-created URL key for the SDATA service progress tracking URL.
Throws:
java.lang.NullPointerException - The invocation URL for the SDATA service operation is null.
java.lang.IllegalArgumentException - The invocation URL for the SDATA service operation is empty.

createKeyForHelp

public static URLKey createKeyForHelp(java.lang.String webHelpPath,
                                      java.lang.String helpTopicID)

Creates a new URL key from the Web Help url for the application and the id for a topic in the help. For example: if the base URL path is "help/eng" - and the helpID is Portal/index_CSH.htm#111021005 - then the full URL to the online help will be ../help/eng/Portal/index_CSH.htm#111021005

Parameters:
webHelpPath - The base URL path of the Web Help for this application. This will be used by help widgets on this UI to construct the full path to the web help topic - by combining the base path with the path to the topic specified in the HelpID property of the help widget.
helpTopicID - The path to the help topic that you want to dispal
Returns:
The newly-created URL key for the SDATA service progress tracking URL.
Throws:
java.lang.NullPointerException - One of the required parameters is null.
java.lang.IllegalArgumentException - One of the required parameters is empty.

toString

public java.lang.String toString()
Gets the string form of the URL key, which is the underlying URL.

Overrides:
toString in class java.lang.Object
Returns:
The string form of the URL key, which is the underlying URL.

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(URLKey o)

Specified by:
compareTo in interface java.lang.Comparable<URLKey>


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