Package wt.load

Class LoadServerHelper

java.lang.Object
wt.load.LoadServerHelper

public class LoadServerHelper extends Object
Provides helper methods for use in load classes such as LoadDoc and LoadPart.

Supported API: true

Extendable: false
  • Field Details

    • REQUIRED

      public static final int REQUIRED
      Used to set the required flag for getValue.

      Supported API: true
      See Also:
    • NOT_REQUIRED

      public static final int NOT_REQUIRED
      Used to set the required flag for getValue.

      Supported API: true
      See Also:
    • BLANK_OKAY

      public static final int BLANK_OKAY
      Used to set the required flag for getValue.

      Supported API: true
      See Also:
    • TARGET_CONTAINER_KEY

      public static final String TARGET_CONTAINER_KEY
      Map key used to store the target container in the parameter list.

      Supported API: true
      See Also:
  • Method Details

    • changePrincipal

      public static void changePrincipal(String desiredPrincipal) throws WTException
      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

      public static Object getCacheValue(String key) throws WTException
      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

      public static void setCacheValue(String key, Object value) throws WTException
      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

      public static void removeCacheValue(String key) throws WTException
      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

      public static void printMessage(String text)
      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

      public static String getValue(String name, Hashtable nv, Hashtable cmd_line, int required)
      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

      public static final WTContainerRef getTargetContainer(Hashtable cmd_line) 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 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

      public static Object getFromCache(Object key) throws WTException
      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

      public static void putCacheValue(Object key, Object value) throws WTException
      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 cache
      value - Value to be cached
      Throws:
      wt.util.WTException82
      WTException
    • removeFromCache

      public static Object removeFromCache(Object key) throws WTException
      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