wt.httpgw
Class GatewayURL

java.lang.Object
  extended bywt.httpgw.GatewayURL

public class GatewayURL
extends Object

A URL factory for resources accessed via Windchill gateway URLs. Instances of GatewayURL correspond to a specific gateway base URL and are used to efficiently build URLs for resources accessed through that gateway.

There are three base gateway URLs which may be subject to different access restrictions by the web server: anonymous, authenticated, and administrator.

Instances are obtained using static factory methods by specifying the codebase URL of the Windchill system to be accessed. A null codebase causes the default server of the current WTContext to be accessed. The wt.properties file from the server codebase contains properties defining the base gateway URLs: wt.httpgw.url.anonymous, wt.httpgw.url.authenticated, and wt.sysadm.url. Instances may be cached for efficient reuse, but a reload of the base URLs can be forced by calling WTProperties.reset.

URLs are constructed by calling one of the getURL methods. Multiple getURL methods exist as helpers to construct gateway URLs with path info (additional path elements and optional query string) that will invoke specified processing targets (E.g. class, method, and parameters).

Implementation: As of Windchill R6.0 the GatewayURL class has been deprecated. All URLs and HREFs should be created using the URLFactory and it's associated helpers (GatewayServletHelper, SysAdmServletHelper etc.). The correct procedure would be to instantiate an appropriate URLFactory object and then call the builder methods located in the Servlet Helpers with the appropriate method signature. Please see the javadoc for the ServletHelpers and URLFactory for details and supported API

Deprecated

Supported API:false
Extendable: false

See Also:
file, URLFactory, GatewayServletHelper, SysAdmServletHelper

Nested Class Summary
(package private) static class GatewayURL.FactoryManager
          Deprecated. This inner class is responsible for the determination or creation of an URLFactory instance within the current MethodContext and caching that instance in the MethodContext for further use.
 
Field Summary
private static GatewayURL adminGateway
          Deprecated.  
static int ADMINISTRATOR
          Deprecated.  
private static GatewayURL anonGateway
          Deprecated.  
static int ANONYMOUS
          Deprecated.  
static int AUTHENTICATED
          Deprecated.  
private static GatewayURL authGateway
          Deprecated.  
private  URL codebase
          Deprecated.  
private static GatewayURL IntralinkGW
          Deprecated.  
private static GatewayURL PDMGW
          Deprecated.  
private  String property
          Deprecated.  
private static boolean SERVER
          Deprecated.  
 
Constructor Summary
protected GatewayURL(String property, URL codebase)
          Deprecated. Constructor for use in subclasses.
 
Method Summary
static void appendQueryString(StringBuffer buf, Properties params)
          Deprecated.  
static URL buildAdminURL(String c, String method, Properties params)
          Deprecated. see getAdminGateway, getURL
static URL buildAdminURL(String c, String method, String params)
          Deprecated. see getAdminGateway, getURL
static URL buildAdminURL(String c, String method, String file_name, Properties params)
          Deprecated. see getAdminGateway, getURL
static URL buildAdminURL(String c, String method, String file_name, String params)
          Deprecated. see getAdminGateway, getURL
static URL buildAnonymousURL(String c, String method, Properties params)
          Deprecated. see getAnonymousGateway, getURL
static URL buildAnonymousURL(String c, String method, String params)
          Deprecated. see getAnonymousGateway, getURL
static URL buildAnonymousURL(String c, String method, String file_name, Properties params)
          Deprecated. see getAnonymousGateway, getURL
static URL buildAnonymousURL(String c, String method, String file_name, String params)
          Deprecated. see getAnonymousGateway, getURL
static URL buildAuthenticatedURL(String c, String method, Properties params)
          Deprecated. see getAuthenticatedGateway, getURL
static URL buildAuthenticatedURL(String c, String method, String params)
          Deprecated. see getAuthenticatedGateway, getURL
static URL buildAuthenticatedURL(String c, String method, String file_name, Properties params)
          Deprecated. see getAuthenticatedGateway, getURL
static URL buildAuthenticatedURL(String c, String method, String file_name, String params)
          Deprecated. see getAuthenticatedGateway, getURL
static String buildPathInfo(String c, String method, String tail, Properties params)
          Deprecated. Builds the PATH_INFO portion of a gateway URL from the given information.
static String buildPathInfo(String c, String method, String tail, String params)
          Deprecated. Builds the PATH_INFO portion of a gateway URL from the given information.
static String buildQueryString(Properties params)
          Deprecated. Builds a URL encoded query string of the values in a Properties object.
static URL buildURL(int type, String c, String method, Properties params)
          Deprecated.  
static URL buildURL(int type, String c, String method, String params)
          Deprecated.  
static String escape(String str)
          Deprecated. Escape special characters in accordance with URL path segment encoding requirements.
static GatewayURL getAdminGateway(URL codebase)
          Deprecated. Get the system administration gateway for a system.
static GatewayURL getAnonymousGateway(URL codebase)
          Deprecated.  
static GatewayURL getAuthenticatedGateway(URL codebase)
          Deprecated.  
private  URLFactory getFactory(URL aCodebase)
          Deprecated. Method for re-direction to Server-Only inner class FactorManager.
static GatewayURL getIntralinkGWURL(URL codebase)
          Deprecated. Get the Intralink Gateway for a system.
static GatewayURL getPDMGWURL(URL codebase)
          Deprecated. Get the PDM Gateway for a system.
 URL getURL(String path_info)
          Deprecated.  
 URL getURL(String c, String method, String tail, Properties params)
          Deprecated. Build a URL relative to this gateway using the given information.
 URL getURL(String c, String method, String tail, String params)
          Deprecated. Build a URL relative to this gateway using the given information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTHENTICATED

public static final int AUTHENTICATED
Deprecated. 
See Also:
Constant Field Values

ANONYMOUS

public static final int ANONYMOUS
Deprecated. 
See Also:
Constant Field Values

ADMINISTRATOR

public static final int ADMINISTRATOR
Deprecated. 
See Also:
Constant Field Values

SERVER

private static final boolean SERVER
Deprecated. 

anonGateway

private static GatewayURL anonGateway
Deprecated. 

authGateway

private static GatewayURL authGateway
Deprecated. 

adminGateway

private static GatewayURL adminGateway
Deprecated. 

IntralinkGW

private static GatewayURL IntralinkGW
Deprecated. 

PDMGW

private static GatewayURL PDMGW
Deprecated. 

property

private String property
Deprecated. 

codebase

private URL codebase
Deprecated. 
Constructor Detail

GatewayURL

protected GatewayURL(String property,
                     URL codebase)
Deprecated. 
Constructor for use in subclasses. Subclasses should be used to encapsulate knowlege of properties used to configure gateway URL values and any special knowlege of path info or query string encoding that is specific to a particular application area.

Supported API: false

Parameters:
property - name of property defining URL value in server's wt.properties file.
codebase - the gateway system's codebase URL (null = local system)
Method Detail

getAdminGateway

public static GatewayURL getAdminGateway(URL codebase)
Deprecated. 
Get the system administration gateway for a system.

Supported API: false

Parameters:
codebase - the gateway system's codebase URL (null = local system)
Returns:
the resulting URL

getIntralinkGWURL

public static GatewayURL getIntralinkGWURL(URL codebase)
Deprecated. 
Get the Intralink Gateway for a system.

Supported API: false

Parameters:
codebase - the gateway system's codebase URL (null = local system)
Returns:
the resulting URL

getPDMGWURL

public static GatewayURL getPDMGWURL(URL codebase)
Deprecated. 
Get the PDM Gateway for a system.

Supported API: false

Parameters:
codebase - the gateway system's codebase URL (null = local system)
Returns:
the resulting URL

getAnonymousGateway

public static GatewayURL getAnonymousGateway(URL codebase)
Deprecated.  

Get the anonymous access gateway for a system.

Supported API: false

See: Notes in Class Description on replacement

Parameters:
codebase - the gateway system's codebase URL (null = local system)
Returns:
the resulting URL

getAuthenticatedGateway

public static GatewayURL getAuthenticatedGateway(URL codebase)
Deprecated.  

Get the authenticated gateway for a system.

Supported API: false

See: Notes in Class Description on replacement

Parameters:
codebase - the gateway system's codebase URL (null = local system)
Returns:
the resulting URL

getURL

public URL getURL(String path_info)
           throws WTException
Deprecated.  

Build a URL relative to this gateway using the given information.

Supported API: false

Parameters:
path_info - String containing the class name.
Returns:
the resulting URL
Throws:
WTException

getURL

public URL getURL(String c,
                  String method,
                  String tail,
                  String params)
           throws WTException
Deprecated. 
Build a URL relative to this gateway using the given information.

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
tail - Additional URI tail.
params - String containing the parameters for the method.
Returns:
the resulting URL
Throws:
WTException

getURL

public URL getURL(String c,
                  String method,
                  String tail,
                  Properties params)
           throws WTException
Deprecated. 
Build a URL relative to this gateway using the given information.

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
tail - Additional URI tail.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
the resulting URL
Throws:
WTException

buildPathInfo

public static String buildPathInfo(String c,
                                   String method,
                                   String tail,
                                   String params)
Deprecated. 
Builds the PATH_INFO portion of a gateway URL from the given information.

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
tail - Additional URI tail.
params - String containing the parameters for the method. The string will be encoded using x-www-form-urlencoded MIME format.
Returns:
a string that can be used when constructing URLs relative to base gateway URL.

buildPathInfo

public static String buildPathInfo(String c,
                                   String method,
                                   String tail,
                                   Properties params)
Deprecated. 
Builds the PATH_INFO portion of a gateway URL from the given information.

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
tail - Additional URI tail.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
a string that can be used when constructing URLs relative to base gateway URL.

escape

public static String escape(String str)
Deprecated. 
Escape special characters in accordance with URL path segment encoding requirements. Replaces spaces with %20 and double quotes with %22. In theory, all special characters should be URLEncoded, but the 4.x browsers don't interpret the file name correctly using their native character encoding when that is done.

Supported API: false

Parameters:
str - String to escape.
Returns:
Escaped string value.

buildQueryString

public static String buildQueryString(Properties params)
Deprecated. 
Builds a URL encoded query string of the values in a Properties object.

Supported API: false

Parameters:
params - Properties object.
Returns:
String value of properties as if they were URL encoded form data

appendQueryString

public static void appendQueryString(StringBuffer buf,
                                     Properties params)
Deprecated.  

Appends a URL encoded query string of the values in a Properties object to a StringBuffer. This does not include a leading "?" character.

Supported API: false

Parameters:
params - StringBuffer object.

buildAdminURL

public static URL buildAdminURL(String c,
                                String method,
                                String params)
                         throws WTException
Deprecated. see getAdminGateway, getURL

Creates a URL from the wt.sysadm.url property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.sysadm.url)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - String containing the parameters for the method.
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAdminGateway, getURL

buildAdminURL

public static URL buildAdminURL(String c,
                                String method,
                                Properties params)
                         throws WTException
Deprecated. see getAdminGateway, getURL

Creates a URL from the wt.sysadm.url property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.sysadm.url)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAdminGateway, getURL

buildAdminURL

public static URL buildAdminURL(String c,
                                String method,
                                String file_name,
                                String params)
                         throws WTException
Deprecated. see getAdminGateway, getURL

Creates a URL from the wt.sysadm.url property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.sysadm.url)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
file_name - File name to appear as tail of URI.
params - String containing the parameters for the method.
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAdminGateway, getURL

buildAdminURL

public static URL buildAdminURL(String c,
                                String method,
                                String file_name,
                                Properties params)
                         throws WTException
Deprecated. see getAdminGateway, getURL

Creates a URL from the wt.sysadm.url property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.sysadm.url)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
file_name - File name to appear as tail of URI.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAdminGateway, getURL

buildAnonymousURL

public static URL buildAnonymousURL(String c,
                                    String method,
                                    String params)
                             throws WTException
Deprecated. see getAnonymousGateway, getURL

Creates a URL from the wt.httpgw.url.anonymous property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.anonymous)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - String containing the parameters for the method.
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAnonymousGateway, getURL

buildAnonymousURL

public static URL buildAnonymousURL(String c,
                                    String method,
                                    Properties params)
                             throws WTException
Deprecated. see getAnonymousGateway, getURL

Creates a URL from the wt.httpgw.url.anonymous property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.anonymous)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAnonymousGateway, getURL

buildAnonymousURL

public static URL buildAnonymousURL(String c,
                                    String method,
                                    String file_name,
                                    String params)
                             throws WTException
Deprecated. see getAnonymousGateway, getURL

Creates a URL from the wt.httpgw.url.anonymous property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.anonymous)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
file_name - File name to appear as tail of URI.
params - String containing the parameters for the method.
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAnonymousGateway, getURL

buildAnonymousURL

public static URL buildAnonymousURL(String c,
                                    String method,
                                    String file_name,
                                    Properties params)
                             throws WTException
Deprecated. see getAnonymousGateway, getURL

Creates a URL from the wt.httpgw.url.anonymous property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.anonymous)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
file_name - File name to appear as tail of URI.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAnonymousGateway, getURL

buildAuthenticatedURL

public static URL buildAuthenticatedURL(String c,
                                        String method,
                                        String params)
                                 throws WTException
Deprecated. see getAuthenticatedGateway, getURL

Creates a URL from the wt.httpgw.url.authenticated property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.authenticated)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - String containing the parameters for the method.
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAuthenticatedGateway, getURL

buildAuthenticatedURL

public static URL buildAuthenticatedURL(String c,
                                        String method,
                                        Properties params)
                                 throws WTException
Deprecated. see getAuthenticatedGateway, getURL

Creates a URL from the wt.httpgw.url.authenticated property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.authenticated)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAuthenticatedGateway, getURL

buildAuthenticatedURL

public static URL buildAuthenticatedURL(String c,
                                        String method,
                                        String file_name,
                                        String params)
                                 throws WTException
Deprecated. see getAuthenticatedGateway, getURL

Creates a URL from the wt.httpgw.url.authenticated property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.authenticated)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
file_name - File name to appear as tail of URI.
params - String containing the parameters for the method.
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAuthenticatedGateway, getURL

buildAuthenticatedURL

public static URL buildAuthenticatedURL(String c,
                                        String method,
                                        String file_name,
                                        Properties params)
                                 throws WTException
Deprecated. see getAuthenticatedGateway, getURL

Creates a URL from the wt.httpgw.url.authenticated property in the wt.properties file and the supplied inputs. The URL will take the form: <$(wt.httpgw.url.authenticated)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
file_name - File name to appear as tail of URI.
params - Properties object containing the parameters for the method. A query string will be built from the properties taking the form: key=value<&><key=value>...
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getAuthenticatedGateway, getURL

buildURL

public static URL buildURL(int type,
                           String c,
                           String method,
                           String params)
                    throws WTException
Deprecated.  

Creates a URL from the specified property in the wt.properties file (this is specified via the 'type' parameter) and the supplied inputs. The URL will take the form: <$(property indicated by type)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
type - The type of URL to build. Possible values are: AUTHENTICATED, ANONYMOUS, and ADMINISTRATOR. If AUTHENTICATED is chosen, the URL will be built using the value of the wt.httpgw.url.authenticated property. If ANONYMOUS is chosen, the URL will be build with the value of the wt.httpgw.url.anonymous property. Finally, if ADMINISTATOR is chosen, the URL is built using the value of the wt.sysadm.url property.
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - String containing the parameters for the method.
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getURL

buildURL

public static URL buildURL(int type,
                           String c,
                           String method,
                           Properties params)
                    throws WTException
Deprecated.  

Creates a URL from specifed property in the wt.properties file (this is specified via the 'type' parameter) and the supplied inputs. The URL will take the form: <$(property indicated by type)>/<class name>/<method name>?<params>

Supported API: false

Parameters:
type - The type of URL to build. Possible values are: AUTHENTICATED, ANONYMOUS, and ADMINISTRATOR. If AUTHENTICATED is chosen, the URL will be built using the value of the wt.httpgw.url.authenticated property. If ANONYMOUS is chosen, the URL will be build with the value of the wt.httpgw.url.anonymous property. Finally, if ADMINISTATOR is chosen, the URL is built using the value of the wt.sysadm.url property.
c - String containing the class name.
method - String containing the method of the supplied class that will be invoked when the URL is loaded.
params - Properties object containing the parameters for the method. A query string will be build from the properties taking the form: key=value<&><key=value>...
Returns:
The URL.
Throws:
WTException - Thrown if the URL cannot be built.
See Also:
getURL

getFactory

private URLFactory getFactory(URL aCodebase)
Deprecated. 
Method for re-direction to Server-Only inner class FactorManager. This method is required if we wish to have the GatewayURL still function on a client independent of the server. In order to do this, we need to direct the calls to a method which is not compiled by the JIT compiler at runtime but only when required.

Returns:
The URLFactory for the server.