com.ptc.windchill.cadx.common.util
Class ContextUtilities

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.util.ContextUtilities

public class ContextUtilities
extends Object


Field Summary
static String PRO_FTP_SERVER_TYPE
           
static String PRO_INTRALINK_SERVER_TYPE
           
static String PRO_NONE_SERVER_TYPE
           
static String PRO_PDMLINK_SERVER_TYPE
           
static String PRO_PROJECTLINK_SERVER_TYPE
           
static String PRO_WINDCHILL_SERVER_TYPE
           
static boolean PROIntralinkInstalled
           
private static String PROJECLINK_TOKENS_SEPARATOR
           
private static String PROJECLINK_VALUE_SEPARATOR
           
static String PROJECTLINK_CTX
           
private static boolean VERBOSE
           
 
Constructor Summary
ContextUtilities()
           
 
Method Summary
static WTContainer getContext(HTTPRequest request)
          Gets the context of an action/page.
static WTContainer getContext(HTTPRequest request, boolean considerActiveWs)
          Gets the context of an action/page.
static WTContainer getContext(HTTPState state)
          Gets the context of an action/page.
static WTContainer getContext(HTTPState state, boolean considerActiveWs)
          Gets the context of an action/page.
static String getProEServerType(HTTPRequest request)
           
static int getSolutionTypeNumber(HTTPRequest request)
           
static int getSolutionTypeNumber(HTTPState state)
           
static int getSolutionTypeNumber(Object object)
           
static String getSolutionTypeString(HTTPRequest request)
           
static String getSolutionTypeString(HTTPState state)
           
static String getSolutionTypeString(Object object)
           
static boolean isPDMLinkContext(HTTPRequest request)
          Checks if the context associated with the given request is a PDMLink context.
static boolean isPDMLinkContext(HTTPState state)
          Checks if the context assocated with given HTTPState is a PDMLink context
static boolean isPDMLinkContext(Object object)
          Checks if context associated with given object is a PDMLink context
static boolean isProIContext()
           
static boolean isProjectLinkContext(HTTPRequest request)
          Checks if the context associated with the given request is a ProjectLink context.
static boolean isProjectLinkContext(HTTPRequest request, boolean considerActiveWorkspaceContainerContext)
          Checks if the context associated with the given request is a ProjectLink context.
static boolean isProjectLinkContext(HTTPState state)
          Checks if the context assocated with given HTTPState is a ProjectLink context
static boolean isProjectLinkContext(HTTPState state, boolean considerActiveWorkspaceContainerContext)
          Checks if the context assocated with given HTTPState is a ProjectLink context.
static boolean isProjectLinkContext(Object object)
          Checks if context associated with given object is a ProjectLink context
static boolean isStandaloneProjectLinkContext()
          Returns true if it's stand-alone ProjectLink context.
static boolean isStandaloneWindchillPDMContext()
          Returns true if it's stand-alone Windchill PDM context.
static boolean isWindchillClassicContext(HTTPRequest request)
          Checks if the context associated with the given request is a Windchill Classic context.
static boolean isWindchillClassicContext(HTTPState state)
          Checks if the context assocated with given HTTPState is a Windchill Classic context
static boolean isWindchillClassicContext(Object object)
          Checks if context associated with given object is a Windchill Classic context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

private static boolean VERBOSE

PROJECTLINK_CTX

public static String PROJECTLINK_CTX

PROJECLINK_TOKENS_SEPARATOR

private static final String PROJECLINK_TOKENS_SEPARATOR
See Also:
Constant Field Values

PROJECLINK_VALUE_SEPARATOR

private static final String PROJECLINK_VALUE_SEPARATOR
See Also:
Constant Field Values

PROIntralinkInstalled

public static boolean PROIntralinkInstalled

PRO_NONE_SERVER_TYPE

public static final String PRO_NONE_SERVER_TYPE
See Also:
Constant Field Values

PRO_WINDCHILL_SERVER_TYPE

public static final String PRO_WINDCHILL_SERVER_TYPE
See Also:
Constant Field Values

PRO_INTRALINK_SERVER_TYPE

public static final String PRO_INTRALINK_SERVER_TYPE
See Also:
Constant Field Values

PRO_FTP_SERVER_TYPE

public static final String PRO_FTP_SERVER_TYPE
See Also:
Constant Field Values

PRO_PROJECTLINK_SERVER_TYPE

public static final String PRO_PROJECTLINK_SERVER_TYPE
See Also:
Constant Field Values

PRO_PDMLINK_SERVER_TYPE

public static final String PRO_PDMLINK_SERVER_TYPE
See Also:
Constant Field Values
Constructor Detail

ContextUtilities

public ContextUtilities()
Method Detail

isProIContext

public static boolean isProIContext()

isProjectLinkContext

public static boolean isProjectLinkContext(HTTPRequest request)
                                    throws WTException
Checks if the context associated with the given request is a ProjectLink context.

Parameters:
request -
Returns:
Throws:
WTException

isProjectLinkContext

public static boolean isProjectLinkContext(HTTPRequest request,
                                           boolean considerActiveWorkspaceContainerContext)
                                    throws WTException
Checks if the context associated with the given request is a ProjectLink context. If no explicit container context could be found based upon the request object AND if the considerActiveWorkspaceContainerContext is true, then perform this check (for Project) based upon container context of the active workspace.

Parameters:
request -
considerActiveWorkspaceContainerContext - Use (treat) active workspace's context as context of this HTTPRequest
Returns:
Throws:
WTException

isProjectLinkContext

public static boolean isProjectLinkContext(HTTPState state)
                                    throws WTException
Checks if the context assocated with given HTTPState is a ProjectLink context

Parameters:
state -
Returns:
Throws:
WTException

isProjectLinkContext

public static boolean isProjectLinkContext(HTTPState state,
                                           boolean considerActiveWorkspaceContainerContext)
                                    throws WTException
Checks if the context assocated with given HTTPState is a ProjectLink context. If no explicit container context could be found based upon the state object AND if the considerActiveWorkspaceContainerContext is true, then perform this check (for Project) based upon container context of the active workspace.

Parameters:
state -
considerActiveWorkspaceContainerContext - Use (treat) active workspace's context as context of this HTTPRequest
Returns:
Throws:
WTException

isProjectLinkContext

public static boolean isProjectLinkContext(Object object)
                                    throws WTException
Checks if context associated with given object is a ProjectLink context

Parameters:
object -
Returns:
Throws:
WTException

isPDMLinkContext

public static boolean isPDMLinkContext(HTTPRequest request)
                                throws WTException
Checks if the context associated with the given request is a PDMLink context.

Parameters:
request -
Returns:
Throws:
WTException

isPDMLinkContext

public static boolean isPDMLinkContext(HTTPState state)
                                throws WTException
Checks if the context assocated with given HTTPState is a PDMLink context

Parameters:
state -
Returns:
Throws:
WTException

isPDMLinkContext

public static boolean isPDMLinkContext(Object object)
                                throws WTException
Checks if context associated with given object is a PDMLink context

Parameters:
object -
Returns:
Throws:
WTException

isWindchillClassicContext

public static boolean isWindchillClassicContext(HTTPRequest request)
                                         throws WTException
Checks if the context associated with the given request is a Windchill Classic context.

Parameters:
request -
Returns:
Throws:
WTException

isWindchillClassicContext

public static boolean isWindchillClassicContext(HTTPState state)
                                         throws WTException
Checks if the context assocated with given HTTPState is a Windchill Classic context

Parameters:
state -
Returns:
Throws:
WTException

isWindchillClassicContext

public static boolean isWindchillClassicContext(Object object)
                                         throws WTException
Checks if context associated with given object is a Windchill Classic context

Parameters:
object -
Returns:
Throws:
WTException

getSolutionTypeNumber

public static int getSolutionTypeNumber(HTTPRequest request)

getSolutionTypeNumber

public static int getSolutionTypeNumber(HTTPState state)

getSolutionTypeNumber

public static int getSolutionTypeNumber(Object object)

getSolutionTypeString

public static String getSolutionTypeString(HTTPRequest request)

getSolutionTypeString

public static String getSolutionTypeString(HTTPState state)

getSolutionTypeString

public static String getSolutionTypeString(Object object)

getContext

public static WTContainer getContext(HTTPState state)
                              throws WTException
Gets the context of an action/page.

Throws:
WTException

getContext

public static WTContainer getContext(HTTPRequest request)
                              throws WTException
Gets the context of an action/page.

Throws:
WTException

getContext

public static WTContainer getContext(HTTPState state,
                                     boolean considerActiveWs)
                              throws WTException
Gets the context of an action/page. This will first try to get the context from the active Workspace if action is run in Wildfire and considerActiveWs is true. Else will try to get it from the URL.

Throws:
WTException

getContext

public static WTContainer getContext(HTTPRequest request,
                                     boolean considerActiveWs)
                              throws WTException
Gets the context of an action/page. This will first try to get the context from the active Workspace if action is run in Wildfire and considerActiveWs is true. Else will try to get it from the URL.

Throws:
WTException

isStandaloneWindchillPDMContext

public static boolean isStandaloneWindchillPDMContext()
Returns true if it's stand-alone Windchill PDM context. It is stand-alone Windchill PDM server if the following is true: 1. Windchill PDM is installed and PROJECTLINK is not installed


isStandaloneProjectLinkContext

public static boolean isStandaloneProjectLinkContext()
Returns true if it's stand-alone ProjectLink context. It is stand-alone ProjectLink server if the following is true: 1. Windchill PDM is not installed and PDMLink is not installed and ProjectLink is installed


getProEServerType

public static String getProEServerType(HTTPRequest request)