wt.clients.homepage
Class WindchillHome

java.lang.Object
  extended bywt.clients.homepage.WindchillHome
All Implemented Interfaces:
CGIConstants

public class WindchillHome
extends Object
implements CGIConstants

WindchillHome contains those methods needed to dynamically generate the main Windchill page.

Supported API: true
Extendable: true


Field Summary
protected static String BLANK_SPACE
           
protected static String BREAK_SEPARATOR
           
protected static String BREAK_TAG
           
private static String CODEBASE
           
protected static String displayLabel
           
static String ID_SEPARATOR
           
static String JSPPAGE
           
private static boolean OLD_ENTERPRISE_SEARCH
           
private static String PORTALFILE
           
private static String PORTALPATH
           
protected static WTProperties properties
           
private static boolean VERBOSE
           
private static String versionID
           
 
Fields inherited from interface wt.httpgw.CGIConstants
CGI_ACCEPT, CGI_ACCEPT_CHARSET, CGI_ACCEPT_LANGUAGE, CGI_AUTH_TYPE, CGI_AUTHORIZATION, CGI_CONNECTION, CGI_CONTENT_LENGTH, CGI_CONTENT_TYPE, CGI_CONTEXT_PATH, CGI_DELETE_METHOD, CGI_GATEWAY_INTERFACE, CGI_GET_METHOD, CGI_HEAD_METHOD, CGI_HOST, CGI_IF_MODIFIED_SINCE, CGI_MULTIPART_BOUNDARY, CGI_PATH_INFO, CGI_PATH_TRANSLATED, CGI_POST_METHOD, CGI_PRAGMA, CGI_PROPERTY_PREFIX, CGI_PROTOCOL, CGI_PUT_METHOD, CGI_QUERY_STRING, CGI_REFERER, CGI_REMOTE_ADDR, CGI_REMOTE_HOST, CGI_REMOTE_IDENT, CGI_REMOTE_USER, CGI_REQUEST_METHOD, CGI_SCHEME, CGI_SCRIPT_NAME, CGI_SERVER_NAME, CGI_SERVER_PORT, CGI_SERVER_PROTOCOL, CGI_SERVER_SOFTWARE, CGI_SERVLET_SESSION, CGI_TRACE_METHOD, CGI_UA_COLOR, CGI_UA_CPU, CGI_UA_OS, CGI_UA_PIXELS, CGI_URI, CGI_URL, CGI_USER_AGENT
 
Constructor Summary
WindchillHome()
           
 
Method Summary
static void displayURLString(Properties props, Locale locale, OutputStream os)
          Uses URLTemplateAction to build a URL.
static String getHomeURL()
          Returns a string representation of the Windchill home page URL.
static String getHomeURL(Properties props, Locale locale)
          Method for returning a String representation of the URL to the homepage.
static String getKeyAsURL(String key, boolean localize, Locale locale)
          Returns a String which represents a URL which is retrieved from wt.properties properties file.
static void getPage(HTTPRequest req, HTTPResponse resp)
          Construct the main Windchill page.
static String getPageAsURL(String page)
          Returns a String which represents a URL to the given HTML file.
static void getPageName(Properties prop, Locale locale, OutputStream os)
          This method is invoked when dynamically generating the main Windchill page.
private static PrintWriter getPrintWriter(OutputStream os, Locale locale)
           
static String getUrlFromMethod(String class_name, String method, Class[] param_classes, Object target, Object[] params)
          This static method returns a string representation of a URL which is retrieved by invoking a specified method.
static String getURLString(Properties props)
          Returns a String representation of a URL to be generated by the URLTemplateAction method of URLProcessor.
static void insertHomeLocation(Properties prop, Locale locale, OutputStream os)
          This method's function is to get and write out the URL of the Home page.
static void insertLocalSearchLocation(Properties prop, Locale locale, OutputStream os)
          This method is invoked dynamically when generating the main Windchill page.
static void insertPageLocation(Properties prop, Locale locale, OutputStream os)
          This method is invoked when dynamically generating the main Windchill page.
static void insertSALocation(Properties prop, Locale locale, OutputStream os)
          This method is invoked when dynamically generating the main Windchill page.
static void insertWorkflowLocation(Properties prop, Locale locale, OutputStream os)
          This method is invoked when dynamically generating the main Windchill page.
static void insertWTPropertiesURL(Properties prop, Locale locale, OutputStream os)
          Convenience method which prints out a URL by looking it up in wt.properties.
protected static boolean isInstalled(String installed_key)
          Returns a boolean value indicating whether the optional application specified by the given String key is installed.
static void printTableEntry(Properties parameters, Locale locale, OutputStream os)
           
protected static String splitString(String string_to_split)
          Removes the ID_SEPARATOR characters in the given string and replaces them with spaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

CODEBASE

private static String CODEBASE

VERBOSE

private static boolean VERBOSE

PORTALPATH

private static final String PORTALPATH

PORTALFILE

private static final String PORTALFILE

JSPPAGE

public static final String JSPPAGE

ID_SEPARATOR

public static final String ID_SEPARATOR
See Also:
Constant Field Values

properties

protected static WTProperties properties

BLANK_SPACE

protected static String BLANK_SPACE

BREAK_SEPARATOR

protected static String BREAK_SEPARATOR

BREAK_TAG

protected static String BREAK_TAG

displayLabel

protected static String displayLabel

OLD_ENTERPRISE_SEARCH

private static boolean OLD_ENTERPRISE_SEARCH
Constructor Detail

WindchillHome

public WindchillHome()
Method Detail

getPage

public static void getPage(HTTPRequest req,
                           HTTPResponse resp)
                    throws WTException
Construct the main Windchill page. This method causes the main Windchill page to be dynamically generated.

Supported API: true

Parameters:
req - The HTTPRequest.
resp - The HTTPResponse object. This object holds the OutputStream to write to.
Throws:
WTException - Thrown if an IO error occurs.

getHomeURL

public static String getHomeURL()
                         throws WTException
Returns a string representation of the Windchill home page URL. The homepage URL is assumed to require authentication, and as such the authenticated GatewayURL instance is used to create it.

Returns:
The home page URL, as a String
Throws:
WTException

getHomeURL

public static String getHomeURL(Properties props,
                                Locale locale)
                         throws WTException
Method for returning a String representation of the URL to the homepage. Although this method does not use the parameters passed in, they are necessary to invoke this method dynamically

Throws:
WTException

insertHomeLocation

public static void insertHomeLocation(Properties prop,
                                      Locale locale,
                                      OutputStream os)
                               throws WTException
This method's function is to get and write out the URL of the Home page.

Supported API: true

Parameters:
prop - Properties used by this method. This parameter is not checked as it is expected to be null.
locale - The prefered Locale of the client. Since this method only writes out a URL, this parameter is not checked.
os - The OutputStream to write the URL to.
Throws:
WTException - Thrown if the URL cannot be obtained.

insertSALocation

public static void insertSALocation(Properties prop,
                                    Locale locale,
                                    OutputStream os)
                             throws WTException
This method is invoked when dynamically generating the main Windchill page. It's function is to get and write out the URL of the System Administration page.

Supported API: true

Parameters:
prop - Properties used by this method. This parameter is not checked as it is expected to be null.
locale - The prefered Locale of the client. Since this method only writes out a URL, this parameter is not checked.
os - The OutputStream to write the URL to.
Throws:
WTException - Thrown if the URL cannot be obtained.

insertWorkflowLocation

public static void insertWorkflowLocation(Properties prop,
                                          Locale locale,
                                          OutputStream os)
                                   throws WTException
This method is invoked when dynamically generating the main Windchill page. It's function is to get and write out the URL of the Worklist Processor page.

Supported API: true

Parameters:
prop - Properties used by this method. This parameter is not checked as it is expected to be null.
locale - The prefered Locale of the client. Since this method only writes out a URL, this parameter is not checked.
os - The OutputStream to write the URL to.
Throws:
WTException - Thrown if the URL cannot be obtained.

insertLocalSearchLocation

public static void insertLocalSearchLocation(Properties prop,
                                             Locale locale,
                                             OutputStream os)
                                      throws WTException
This method is invoked dynamically when generating the main Windchill page. It's function is to get and write out the URL to the Local Search page.

Supported API: true

Parameters:
prop - Properties used by this method.
locale - The prefered Locale of the client. Since this method only writes out a URL, this parameter is not checked.
os - The OutputStream to write the URL to.
Throws:
WTException - Thrown if the URL cannot be obtained.

insertWTPropertiesURL

public static void insertWTPropertiesURL(Properties prop,
                                         Locale locale,
                                         OutputStream os)
                                  throws WTException
Convenience method which prints out a URL by looking it up in wt.properties. The key to use in the wt.properties is specified by the value of "key" which is passed as a parameter in the script call and retrieved from the Properties object. The value of the key in wt.properties is assumed to be a url. The script call can also have a parameter which specifies whether or not the value in wt.properties needs to be localize with LocaleHelper.translateURLString. If the value of parameter "localize" is true, then the URL will be translated. By default, the URL will not be localized.

Parameters:
prop - Properties used by this method.
locale - The prefered Locale of the client.
os - The OutputStream to write the URL to.
Throws:
WTException - Thrown if the URL cannot be obtained.

insertPageLocation

public static void insertPageLocation(Properties prop,
                                      Locale locale,
                                      OutputStream os)
                               throws WTException
This method is invoked when dynamically generating the main Windchill page. It's function is to get and write out the location (URL) of the given page. This location uses the server codebase as defined in the wt.properties file.

Supported API: true

Parameters:
prop - Properties used by this method. This parameter contains the page to for which to make the URL.
locale - The prefered Locale of the client. Since this method only writes out a URL, this parameter is not checked.
os - The OutputStream to write the URL to.
Throws:
WTException - Thrown if the server codebase property cannot be obtained.

getPageAsURL

public static String getPageAsURL(String page)
                           throws WTException
Returns a String which represents a URL to the given HTML file.

Parameters:
page - a String representation of the page to which to make a URL to
Returns:
the String URL to the given page
Throws:
WTException

getKeyAsURL

public static String getKeyAsURL(String key,
                                 boolean localize,
                                 Locale locale)
Returns a String which represents a URL which is retrieved from wt.properties properties file. The given String key specifies the key to look up in the wt.properties file. It is assumed that the value of the key is a URL. The given boolean value specifies whether or not the URL needs to be localized.


getPageName

public static void getPageName(Properties prop,
                               Locale locale,
                               OutputStream os)
                        throws WTException
This method is invoked when dynamically generating the main Windchill page. It's function is to get and write out a unique name for the given page. This page name uses the wt.server.id as defined in the wt.properties file.

Supported API: true

Parameters:
prop - Properties used by this method. This parameter contains the name to append to the value of wt.server.id.
locale - The prefered Locale of the client. Since this method only writes out a non-visible, this parameter is not checked.
os - The OutputStream to write the page name to.
Throws:
WTException - Thrown if the wt.server.id property cannot be obtained.

getPrintWriter

private static PrintWriter getPrintWriter(OutputStream os,
                                          Locale locale)

displayURLString

public static void displayURLString(Properties props,
                                    Locale locale,
                                    OutputStream os)
                             throws WTException
Uses URLTemplateAction to build a URL. The given Properties object should contain the action which is used by URLTemplateAction

Throws:
WTException

getURLString

public static String getURLString(Properties props)
                           throws WTException
Returns a String representation of a URL to be generated by the URLTemplateAction method of URLProcessor. The given Properties object is assumed to contain the values (e.g. action ) needed by URLProcessor.

Parameters:
props - the Properties object used by URLProcessor
Returns:
a String representation of the URL
Throws:
WTException - if an error occurs building the URL

printTableEntry

public static void printTableEntry(Properties parameters,
                                   Locale locale,
                                   OutputStream os)

splitString

protected static String splitString(String string_to_split)
Removes the ID_SEPARATOR characters in the given string and replaces them with spaces. This method is useful for allowing arguments with spaces to be passed in to Windchill scripts.

Parameters:
string_to_split - the string to split
Returns:
the given string with spaces replacing the separators

isInstalled

protected static boolean isInstalled(String installed_key)
Returns a boolean value indicating whether the optional application specified by the given String key is installed. The given String key corresponds to the key used in the installed.properties file.

Parameters:
installed_key - the String key corresponding to an entry in the installed.properties file.
Returns:
true if the application corresponding to the given key is installed.

getUrlFromMethod

public static String getUrlFromMethod(String class_name,
                                      String method,
                                      Class[] param_classes,
                                      Object target,
                                      Object[] params)
                               throws WTException
This static method returns a string representation of a URL which is retrieved by invoking a specified method. The method to be invoked, the class on which it is invoked, the class types of parameters the method requires, the actual parameter objects to pass to the method, and the target object on which to invoke the method are all passed in as parameters.

Parameters:
class_name - the class containing the method to invoke. If no class name is given, this class is used
method - the name of the method to be invoked. This parameter is required
param_classes - an array of Class objects specifying the types of the parameters expected by the method
target - the object on which to invoke the method. If the method to invoked is static, this parameter should be null
params - an array of Objects containing the objects to pass as parameters to the method.
Returns:
a String representation of invoking the method.
Throws:
WTException