wt.lifecycle
Class LoadLifeCycle

java.lang.Object
  extended bywt.lifecycle.LoadLifeCycle

public class LoadLifeCycle
extends Object

This class is used by wt.load.StandardLoadService to create and persist life cycle objects based on input from a comma seperated value file. (ie. predefined_lifecycle.csv)

Included are methods which are referenced in the StandardLoadService map file (ie. csvmapfile.txt) and called by StandardLoadService. The method wt.load.StandardLoadService.load reads records from the life cycle .csv file and passes the fields in a hashtable to the methods defined in this class. These methods then create and persist the appropriate life cycle objects.



Supported API: false

See Also:
StandardLoadService

Field Summary
private static String CACHE_ADHOCACL
           
private static String CACHE_CRITERIA
           
private static String CACHE_CURRENTPROJECT
           
private static String CACHE_CURRENTPT
           
private static String CACHE_LCT
           
private static String CACHE_PHASES
           
private static String CACHE_PREVPT
           
private static String CACHE_SUCCESSORTABLE
           
private static WTContainerRef containerContext
           
private static String FOLDER_SEPARATOR
           
private static boolean ITERATION
           
private static ResourceBundle rb
           
private static String RESOURCE
           
private static String SYSTEM_CABINET
           
private static boolean VERBOSE
           
private static Vector windchillClasses
           
 
Constructor Summary
LoadLifeCycle()
           
 
Method Summary
private static boolean contextCurrent(LifeCycleTemplate template, WTContainerRef context)
           
static boolean createCriterion(Hashtable fileFields, Hashtable cmd_line, Vector return_objects)
          Persists a Criterion object using data from the lifecycle.csv input file.
static boolean createLifeCycleTemplate(Hashtable fileFields, Hashtable cmd_line, Vector return_objects)
          Creates and persists a LifeCycleTemplate object.
static boolean createLifeCycleTemplate(Hashtable fileFields, Hashtable cmd_line, Vector return_objects, WTContainerRef context)
          Creates and persists a LifeCycleTemplate object.
static boolean createLifeCycleTemplateEnd(Hashtable fileFields, Hashtable cmd_line, Vector return_objects)
           
static boolean createPhaseSuccessionBegin(Hashtable fileFields, Hashtable cmd_line, Vector return_objects)
          Creates and persists a PhaseSuccession object.
static boolean createPhaseTemplateBegin(Hashtable fileFields, Hashtable cmd_line, Vector return_objects)
          Creates and persists a PhaseTemplate object.
static boolean createPhaseTemplateEnd(Hashtable fileFields, Hashtable cmd_line, Vector return_objects)
          Performs activities to finish the creation of a new PhaseTemplate.
static boolean createWTAclEntry(Hashtable fileFields, Hashtable cmd_line, Vector return_objects)
          Adds an adhoc access control entry to the cached AdHocAclSpec (CACHE_ADHOCACL).
private static LifeCycleTemplateMaster findTemplateMasterByName(String name, WTContainerRef context, boolean onlyEnabled)
           
static boolean getBooleanValue(Hashtable fileFields, Hashtable cmd_line, String fieldName, boolean nullValueOk, boolean defaultValue)
          Obtains a boolean value from the input file.
private static Folder getFolder(WTContainerRef context, String strValue)
           
private static String getFolderPath(WTContainer context, String folder_name)
           
private static Role getRole(String roleString)
           
static Role getRoleValue(Hashtable fileFields, Hashtable cmd_line, String fieldName, boolean nullValueOk, boolean nullRoleOk)
          Obtains a string from the input file which represents a Role.
static String getStringValue(Hashtable fileFields, Hashtable cmd_line, String fieldName, boolean nullValueOk)
          Obtains string value from input file.
protected static void printException(String methodName, Exception e)
          Helper method to print stack trace of exception to Method Server log.
private static boolean validateSupportedClass(String a_classname)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_LCT

private static String CACHE_LCT

CACHE_CRITERIA

private static String CACHE_CRITERIA

CACHE_PREVPT

private static String CACHE_PREVPT

CACHE_CURRENTPT

private static String CACHE_CURRENTPT

CACHE_CURRENTPROJECT

private static String CACHE_CURRENTPROJECT

CACHE_ADHOCACL

private static String CACHE_ADHOCACL

CACHE_SUCCESSORTABLE

private static String CACHE_SUCCESSORTABLE

CACHE_PHASES

private static String CACHE_PHASES

FOLDER_SEPARATOR

private static String FOLDER_SEPARATOR

RESOURCE

private static String RESOURCE

containerContext

private static WTContainerRef containerContext

VERBOSE

private static final boolean VERBOSE

ITERATION

private static final boolean ITERATION

rb

private static final ResourceBundle rb

SYSTEM_CABINET

private static final String SYSTEM_CABINET

windchillClasses

private static Vector windchillClasses
Constructor Detail

LoadLifeCycle

public LoadLifeCycle()
Method Detail

getStringValue

public static String getStringValue(Hashtable fileFields,
                                    Hashtable cmd_line,
                                    String fieldName,
                                    boolean nullValueOk)
                             throws LifeCycleException
Obtains string value from input file. Used by the createXXXX methods of this class.

Parameters:
fileFields - hashtable containing the values read from the input file
fieldName - name of the input field
nullValueOk - true if a null value for the parameter is acceptable, false otherwise
Returns:
data field obtained from the file
Throws:
LifeCycleException - if a null value is not acceptable and was discovered
See Also:
wt.load.StandardLoadService.load

getRoleValue

public static Role getRoleValue(Hashtable fileFields,
                                Hashtable cmd_line,
                                String fieldName,
                                boolean nullValueOk,
                                boolean nullRoleOk)
                         throws LifeCycleException
Obtains a string from the input file which represents a Role. Determines if the Role exists and returns the Role object which matches the name. Used by the createXXXX methods in this class.

Parameters:
fileFields - Hashtable containing the values read in from the input file.
fieldName - Name of the input field
nullValueOk - true if a null value from input file is acceptable, false otherwise
nullRoleOk - true if it is ok for the role to be nonexistent, false otherwise
Returns:
Role object which of the role indicated in the input file
Throws:
LifeCycleException - if a null value is not acceptable and was discovered
See Also:
wt.load.StandardLoadService.load

getBooleanValue

public static boolean getBooleanValue(Hashtable fileFields,
                                      Hashtable cmd_line,
                                      String fieldName,
                                      boolean nullValueOk,
                                      boolean defaultValue)
                               throws LifeCycleException
Obtains a boolean value from the input file. Used by the createXXXX methods of this class.

Parameters:
fileFields - Hashtable containing the values read in from the input file.
fieldName - Name of the input field
nullValueOk - true if a null input value is ok
defaultValue - value returned if nullValueOk is true and there is no value assigned in the input file
Returns:
boolean representing the value stored in the input file
Throws:
LifeCycleException - if a null value is not acceptable and was discovered
See Also:
wt.load.StandardLoadService.load

createLifeCycleTemplate

public static boolean createLifeCycleTemplate(Hashtable fileFields,
                                              Hashtable cmd_line,
                                              Vector return_objects)
Creates and persists a LifeCycleTemplate object. Stores the persisted object to the CACHE_LCT cache. Called by wt.load.StandardLoadService.load

Parameters:
fileFields - Hashtable containing the values read in from the input file.
Returns:
true if LifeCycleTemplate created ok, false otherwise
See Also:
wt.load.StandardLoadService.load

createLifeCycleTemplate

public static boolean createLifeCycleTemplate(Hashtable fileFields,
                                              Hashtable cmd_line,
                                              Vector return_objects,
                                              WTContainerRef context)
Creates and persists a LifeCycleTemplate object. Stores the persisted object to the CACHE_LCT cache. Called by wt.load.StandardLoadService.load

Parameters:
fileFields - Hashtable containing the values read in from the input file.
Returns:
true if LifeCycleTemplate created ok, false otherwise
See Also:
wt.load.StandardLoadService.load

createLifeCycleTemplateEnd

public static boolean createLifeCycleTemplateEnd(Hashtable fileFields,
                                                 Hashtable cmd_line,
                                                 Vector return_objects)

createCriterion

public static boolean createCriterion(Hashtable fileFields,
                                      Hashtable cmd_line,
                                      Vector return_objects)
Persists a Criterion object using data from the lifecycle.csv input file. Stores the persisted Criterion object into a vector, cached to the StandardLoadService CACHE_CRITERIA.

Parameters:
fileFields - Hashtable containing the values read from the input file.
Returns:
true if Criterion object created, persisted and stored to cache ok, false otherwise
See Also:
wt.load.StandardLoadService.load, createPhaseTemplateBegin, createPhaseTemplateEnd

createPhaseTemplateBegin

public static boolean createPhaseTemplateBegin(Hashtable fileFields,
                                               Hashtable cmd_line,
                                               Vector return_objects)
Creates and persists a PhaseTemplate object. Stores the persisted PhaseTemplate to the StandardLoadService cache (CACHE_CURRENTPT)

Parameters:
fileFields - Hashtable containing the values read in from the input file.
Returns:
true if LifeCycle object is created, persisted, and stored to cache ok, false otherwise
See Also:
wt.load.StandardLoadService.load, createPhaseTemplateBegin, createPhaseTemplateEnd

createPhaseTemplateEnd

public static boolean createPhaseTemplateEnd(Hashtable fileFields,
                                             Hashtable cmd_line,
                                             Vector return_objects)
Performs activities to finish the creation of a new PhaseTemplate. Creates and persists a PhaseLink link. Sets up PhaseTemplateId if this is the first PhaseTemplate. Creates and persists PhaseSuccession link. Creates and persists DefaultNotification link. Uses StandardLoadService cache values:

Removes all cache values except CACHE_LCT and CACHE_PREVPT in preparation for setting up the next PhaseTemplate.

Parameters:
fileFields - Hashtable containing the values read in from the input file.
Returns:
true if LifeCycle object is created, persisted, and stored to cache ok, false otherwise
See Also:
wt.load.StandardLoadService.load, createPhaseTemplateBegin, createPhaseTemplateEnd

createPhaseSuccessionBegin

public static boolean createPhaseSuccessionBegin(Hashtable fileFields,
                                                 Hashtable cmd_line,
                                                 Vector return_objects)
Creates and persists a PhaseSuccession object.

Parameters:
fileFields - Hashtable containing the values read in from the input file.
Returns:
true if LifeCycle object is created, persisted, and stored to cache ok, false otherwise
See Also:
wt.load.StandardLoadService.load, createPhaseSuccessionBegin

createWTAclEntry

public static boolean createWTAclEntry(Hashtable fileFields,
                                       Hashtable cmd_line,
                                       Vector return_objects)
Adds an adhoc access control entry to the cached AdHocAclSpec (CACHE_ADHOCACL).

Parameters:
fileFields - Hashtable containing the values read in from the input file.
Returns:
true if template to principal mapping created ok, false otherwise
See Also:
wt.load.StandardLoadService.load

printException

protected static void printException(String methodName,
                                     Exception e)
Helper method to print stack trace of exception to Method Server log.

Parameters:
methodName - Name of the calling method.

validateSupportedClass

private static boolean validateSupportedClass(String a_classname)
                                       throws WTException
Throws:
WTException

getFolder

private static Folder getFolder(WTContainerRef context,
                                String strValue)
                         throws IllegalArgumentException
Throws:
IllegalArgumentException

getFolderPath

private static String getFolderPath(WTContainer context,
                                    String folder_name)
                             throws WTException
Throws:
WTException

contextCurrent

private static boolean contextCurrent(LifeCycleTemplate template,
                                      WTContainerRef context)

getRole

private static Role getRole(String roleString)
                     throws WTInvalidParameterException
Throws:
WTInvalidParameterException

findTemplateMasterByName

private static LifeCycleTemplateMaster findTemplateMasterByName(String name,
                                                                WTContainerRef context,
                                                                boolean onlyEnabled)
                                                         throws LifeCycleException
Throws:
LifeCycleException