Package wt.load
Class LoadServerHelper
java.lang.Object
wt.load.LoadServerHelper
Provides helper methods for use in load classes such as LoadDoc and LoadPart.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUsed to set the required flag for getValue.static final intUsed to set the required flag for getValue.static final intUsed to set the required flag for getValue.static final StringMap key used to store the target container in the parameter list. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangePrincipal(String desiredPrincipal) Set the principal for operation on Windchill if the desiredPrincipal is different than the current principal.static ObjectgetCacheValue(String key) Retrieve some object or value that was being stored for a latter command in the load process.static ObjectgetFromCache(Object key) Retrieve some object or value that was being stored for a latter command in the load process.static final WTContainerRefgetTargetContainer(Hashtable cmd_line) Returns the container ref to use for the load.static final WTContainerRefgetTargetContainer(Hashtable cmd_line, String cont_pathKey) Returns the container ref to use for the load.static final WTContainerRefgetTargetContainer(Hashtable cmd_line, String cont_pathKey, boolean useCache) Returns the container ref to use for the load.static final WTContainerRefgetTargetContainer(Hashtable nv, Hashtable cmd_line) Returns the container ref to use for the load.This signature assumes that the csvmapfile.txt uses following string for the container path: parentContainerPath If you are using a different key, use the signature that allows you to specify the lookup key.static final WTContainerRefgetTargetContainer(Hashtable nv, Hashtable cmd_line, String cont_pathKey) Returns the container ref to use for the load.static final WTContainerRefgetTargetContainer(Hashtable nv, Hashtable cmd_line, String cont_pathKey, boolean useCache) Returns the container ref to use for the load.static StringGet the value for the variable from either the file or the command line.static voidprintMessage(String text) Prints a message to both the MethodServer log and the session window that started the load.static voidputCacheValue(Object key, Object value) Save some object or value that can be used by a latter command in the load process.static voidremoveCacheValue(String key) Remove an object or value that was stored for the load process.static ObjectremoveFromCache(Object key) Remove an object or value that was stored for the load process.static voidsetCacheValue(String key, Object value) Save some object or value that can be used by a latter command in the load process.
-
Field Details
-
REQUIRED
public static final int REQUIREDUsed to set the required flag for getValue.
Supported API: true- See Also:
-
NOT_REQUIRED
public static final int NOT_REQUIREDUsed to set the required flag for getValue.
Supported API: true- See Also:
-
BLANK_OKAY
public static final int BLANK_OKAYUsed to set the required flag for getValue.
Supported API: true- See Also:
-
TARGET_CONTAINER_KEY
Map key used to store the target container in the parameter list.
Supported API: true- See Also:
-
-
Method Details
-
changePrincipal
Set the principal for operation on Windchill if the desiredPrincipal is different than the current principal.
Supported API: true- Parameters:
desiredPrincipal- The principal that is desired for this operation.- Throws:
WTException
-
getCacheValue
Retrieve some object or value that was being stored for a latter command in the load process.
Supported API: true- Parameters:
key- Key to hashtable storing the value.- Returns:
- Object
- Throws:
WTException
-
setCacheValue
Save some object or value that can be used by a latter command in the load process.
Supported API: true- Parameters:
key- Key to hashtable storing the value.value- Value to be stored in the hashtable for latter use in the load process.- Throws:
WTException
-
removeCacheValue
Remove an object or value that was stored for the load process.
Supported API: true- Parameters:
key- Key to hashtable storing the value.- Throws:
WTException
-
printMessage
Prints a message to both the MethodServer log and the session window that started the load.
Supported API: true- Parameters:
text- The message to be written to the log and the current session screen.
-
getValue
Get the value for the variable from either the file or the command line. The name of the variable must be in the csvmapfile.txt. Does not throw exceptions on missing required attributes so that all attributes can be checked first.
Supported API: true- Parameters:
name- Name of attribute to retrieve.nv- Hashtable with values from data file.cmd_line- Hashtable with misc values from the command line.required- Flag if this is a required variable or not.- Returns:
- String
-
getTargetContainer
Returns the container ref to use for the load. If ixb processing is being used, the container reference is set in the cmd_line hash by the framework. If this is not set, then the container_path is queried. This signature assumes that the csvmapfile.txt uses following string for the container path: parentContainerPath
Supported API: true- Parameters:
cmd_line- The framework that calls you loader has populated this for you. It is a representation of the csv/xml file contents.- Returns:
- WTContainerRef
- Throws:
WTException
-
getTargetContainer
public static final WTContainerRef getTargetContainer(Hashtable nv, Hashtable cmd_line) throws WTException Returns the container ref to use for the load.This signature assumes that the csvmapfile.txt uses following string for the container path: parentContainerPath If you are using a different key, use the signature that allows you to specify the lookup key. The nv hash is consulted first, and the value is trumped by the command line. The target container ref is then cached for future use.
Supported API: true- Parameters:
nv- Although it hard-wiring container values in an input file is strongly discouraged, if you wish to do so you can.cmd_line- The framework that calls you loader has populated this for you. It is a representation of the csv/xml file contents.- Returns:
- WTContainerRef
- Throws:
WTException
-
getTargetContainer
public static final WTContainerRef getTargetContainer(Hashtable cmd_line, String cont_pathKey) throws WTException Returns the container ref to use for the load. If ixb processing is being used, the container reference is set in the cmd_line hash by the framework. If this is not set, then the container_path is queried. This signature is to be used if the containerPath is keyed by a string other than parentContainerPath
Supported API: true- Parameters:
cmd_line- The framework that calls you loader has populated this for you. It is a representation of the csv/xml file contents.cont_pathKey- The key for the containerPath used in the csvmapfile.txt definition for your object.- Returns:
- WTContainerRef
- Throws:
WTException
-
getTargetContainer
public static final WTContainerRef getTargetContainer(Hashtable nv, Hashtable cmd_line, String cont_pathKey) throws WTException Returns the container ref to use for the load. If ixb processing is being used, the container reference is set in the cmd_line hash by the framework. If this is not set, then the container_path is queried. This signature is to be used if the containerPath is keyed by a string other than parentContainerPath
Supported API: true- Parameters:
nv-cmd_line- The framework that calls you loader has populated this for you. It is a representation of the csv/xml file contents.cont_pathKey- The key for the containerPath used in the csvmapfile.txt definition for your object.- Returns:
- WTContainerRef
- Throws:
WTException
-
getTargetContainer
public static final WTContainerRef getTargetContainer(Hashtable cmd_line, String cont_pathKey, boolean useCache) throws WTException Returns the container ref to use for the load. If ixb processing is being used, the container reference is set in the cmd_line hash by the framework. If this is not set, then the container_path is queried. This signature is to be used if the containerPath is keyed by a string other than parentContainerPath. If the path is not in the hashtable, then we try to use the cached value of the containerPath
Supported API: true- Parameters:
cmd_line- The framework that calls you loader has populated this for you. It is a representation of the csv/xml file contents.cont_pathKey- The key for the containerPath used in the csvmapfile.txt definition for your object.useCache- Use cache value if not defined in cmd_line.- Returns:
- WTContainerRef
- Throws:
WTException
-
getTargetContainer
public static final WTContainerRef getTargetContainer(Hashtable nv, Hashtable cmd_line, String cont_pathKey, boolean useCache) throws WTException Returns the container ref to use for the load. If ixb processing is being used, the container reference is set in the cmd_line hash by the framework. If this is not set, then the container_path is queried. This signature is to be used if the containerPath is keyed by a string other than parentContainerPath. If the path is not in the hashtable, then we try to use the cached value of the containerPath
Supported API: true- Parameters:
nv-cmd_line- The framework that calls you loader has populated this for you. It is a representation of the csv/xml file contents.cont_pathKey- The key for the containerPath used in the csvmapfile.txt definition for your object.useCache- Use cache value if not defined in cmd_line.- Returns:
- WTContainerRef
- Throws:
WTException
-
getFromCache
Retrieve some object or value that was being stored for a latter command in the load process.
Supported API: true- Parameters:
key- Key to cache- Returns:
- Object
- Throws:
WTException
-
putCacheValue
Save some object or value that can be used by a latter command in the load process.
Supported API: true- Parameters:
key- Key to the cachevalue- Value to be cached- Throws:
wt.util.WTException82WTException
-
removeFromCache
Remove an object or value that was stored for the load process.
Supported API: true- Parameters:
key- Key to the cache- Returns:
- The previously cached value, if any
- Throws:
WTException
-