com.ptc.windchill.enterprise.dataops.server
Class TaskHelper

java.lang.Object
  extended bycom.ptc.windchill.enterprise.dataops.server.TaskHelper

public class TaskHelper
extends Object


Nested Class Summary
private static class TaskHelper.PurgeParams
           
 
Field Summary
private static String CRITERION_ATTR_DISPLAY_NAME
           
private static String CRITERION_ATTR_DISPLAY_VALUE
           
private static String CRITERION_ATTR_NAME
           
private static String CRITERION_ATTR_TYPE
           
private static String CRITERION_ATTR_VALUE
           
private static String FIELD_ARCHIVE
           
private static String FIELD_CAD_DEPENDENTS
           
private static String FIELD_CRITERIA_REF
           
private static String FIELD_DESCRIPTION
           
private static String FIELD_NAME
           
private static String FIELD_OVERRIDE_SHARED
           
private static String FIELD_OVERRIDE_WORKSPACE
           
private static String FIELD_VERS_N_ITERS
           
private static String PREF_NODE
           
private static String RESOURCE
           
protected static boolean VERBOSE
           
 
Constructor Summary
TaskHelper()
           
 
Method Summary
(package private) static void addAttributeCriteria(CollectionCriteria cc, Map paramMap)
           
private static void addContextCriterion(CollectionCriteria cc, Map paramMap)
           
(package private) static void addCreateDateCriterion(CollectionCriteria cc, Collection valColl)
           
(package private) static void addCreatedByCriterion(CollectionCriteria cc, Collection valColl)
           
private static void addCriterion(CollectionCriteria cc, String type, Collection valColl)
           
private static void addCriterion(CollectionCriteria cc, String type, InputValue[] ivList)
           
private static void addFolderCriteria(CollectionCriteria cc, Collection containerColl)
           
(package private) static void addIterationCriterion(CollectionCriteria cc, Collection valColl)
           
(package private) static void addLifecycleCriterion(CollectionCriteria cc, Collection valColl)
           
(package private) static void addObjectTypeCriterion(CollectionCriteria cc, Collection valColl)
           
(package private) static void addVAMCriterion(CollectionCriteria cc, Collection valColl)
           
(package private) static void addVersionCriterion(CollectionCriteria cc, Collection valColl)
           
(package private) static void addViewCriterion(CollectionCriteria cc, Collection valColl)
           
private static PurgeRecord collectAndPurgeObjects(TaskHelper.PurgeParams recParams)
           
private static WTCollection collectItemsImpl(CollectionCriteria criteria)
           
private static WTCollection collectItemsImpl(CollectionCriteria criteria, String previewKey)
           
static CollectionCriteria createCollectionCriteriaTask(Map paramMap)
           
private static Vector createConflictResolutions(boolean overrideInWs, boolean overrideShared)
           
private static Element createElement(InputValue inputValue, String value)
           
private static List createElementList(InputValue inputValue)
           
private static InputValue[] createInputsForContextCriterion(Collection containerRefs)
           
private static InputValue[] createInputsForCreateDateCriterion(String value)
           
private static InputValue[] createInputsForCreatedByCriterion(String objRef)
           
private static InputValue[] createInputsForFolderCriterion(String oidList, String incList)
           
private static InputValue[] createInputsForIterationCriterion(String iteration)
           
private static InputValue[] createInputsForLifecycleCriterion(String name)
           
private static InputValue[] createInputsForTypeCriterion(String value, boolean allowSub)
           
private static InputValue[] createInputsForVersionCriterion(String version)
           
private static InputValue[] createInputsForViewCriterion(String viewRef)
           
private static InputValue createInputValue(String name, InputType type, String value)
           
private static PurgeRecord createPurgeForPreviewLater(TaskHelper.PurgeParams recParams, String previewMode, String previewLimit)
           
private static PurgeRecord createPurgeRecord(TaskHelper.PurgeParams purgeParams)
           
private static PurgeRecord createPurgeRecordTask_impl(TaskHelper.PurgeParams recParams, String ufidList)
           
static PurgeRecord createTmpTextPreviewRecord(Map paramMap)
           
private static PurgeRecord createTmpTextPreviewRecord(TaskHelper.PurgeParams purgeParams, String previewKey)
           
static PurgeRecord finishPurgeJob(Map paramMap, String ufidList)
           
static String getContextCriteriaTaskParameter(String criteriaUfid)
           
private static BaseCriterionDef getContextCriterionDef()
           
private static String getCreateDateInputDisplayValue(String createDate)
           
private static String getDisplayValue(InputValue inputValue, String value)
           
static String getFolderCriteriaValue(String criteriaUfid)
           
static String getFolderPath(String ufid)
           
private static String getIETaskParam(String key, Map paramMap, String defaultValue, boolean first)
           
static Collection getItemCollection(CollectionCriteria criteria, String previewKey)
           
static Element getItemCollectionInfo(CollectionCriteria criteria)
           
private static WTContainerRef getLaunchContainerRef(Map paramMap)
           
static Persistable getReferencedObject(Element elem, String refAttrName)
           
private static RelationshipMap getRelationshipMapByName(String mapName, WTContainerRef cRef)
           
private static String getRelationshipMapName(String versAndIters, String cadDependents)
           
private static Map getSessionContext()
           
static String getTaskEventConsoleUrl(String recordUfid)
           
static Collection listObjects(PurgeRecord record)
           
static void log(String tag, Object msg)
           
static void log(String tag, Object msg, Element elem)
           
static void log(String tag, Object msg, Group group)
           
(package private) static CollectionCriteria newCollectionCriteria(Map paramMap)
           
private static String object2string(Object obj)
           
static RestoreRecord restoreArchive(Map paramMap)
          This method creates Restore Job (RestoreRecord) and associated command task, and activates command task to perform restore operation.
static PurgeRecord resumeJob(PurgeRecord record, String ufidList)
           
private static PurgeRecord resumeTmpJob(String ufid, TaskHelper.PurgeParams recParams)
           
static Collection retrieveAttributeCriteria(CollectionCriteria criteria)
           
private static Collection retrieveCriterions(CollectionCriteria criteria)
           
private static Collection retrieveCriterions(String criteriaUfid)
           
static void setAttribute(Element elem, String name, Object value)
           
(package private) static void setRecordStatus(PurgeRecord record, EnumeratedType status)
           
private static Persistable ufid2obj(String ufid)
           
private static String ufid2oid(String ufid)
          Converts UFID format to OID format.
private static PurgeRecord updateRecord(PurgeRecord purgeRecord, TaskHelper.PurgeParams recParams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

VERBOSE

protected static boolean VERBOSE

PREF_NODE

private static final String PREF_NODE
See Also:
Constant Field Values

FIELD_NAME

private static final String FIELD_NAME
See Also:
Constant Field Values

FIELD_DESCRIPTION

private static final String FIELD_DESCRIPTION
See Also:
Constant Field Values

FIELD_CRITERIA_REF

private static final String FIELD_CRITERIA_REF
See Also:
Constant Field Values

FIELD_ARCHIVE

private static final String FIELD_ARCHIVE
See Also:
Constant Field Values

FIELD_VERS_N_ITERS

private static final String FIELD_VERS_N_ITERS
See Also:
Constant Field Values

FIELD_CAD_DEPENDENTS

private static final String FIELD_CAD_DEPENDENTS
See Also:
Constant Field Values

FIELD_OVERRIDE_WORKSPACE

private static final String FIELD_OVERRIDE_WORKSPACE
See Also:
Constant Field Values

FIELD_OVERRIDE_SHARED

private static final String FIELD_OVERRIDE_SHARED
See Also:
Constant Field Values

CRITERION_ATTR_NAME

private static final String CRITERION_ATTR_NAME
See Also:
Constant Field Values

CRITERION_ATTR_VALUE

private static final String CRITERION_ATTR_VALUE
See Also:
Constant Field Values

CRITERION_ATTR_TYPE

private static final String CRITERION_ATTR_TYPE
See Also:
Constant Field Values

CRITERION_ATTR_DISPLAY_NAME

private static final String CRITERION_ATTR_DISPLAY_NAME
See Also:
Constant Field Values

CRITERION_ATTR_DISPLAY_VALUE

private static final String CRITERION_ATTR_DISPLAY_VALUE
See Also:
Constant Field Values
Constructor Detail

TaskHelper

public TaskHelper()
Method Detail

getContextCriteriaTaskParameter

public static String getContextCriteriaTaskParameter(String criteriaUfid)
                                              throws WTException
Throws:
WTException

getFolderCriteriaValue

public static String getFolderCriteriaValue(String criteriaUfid)
                                     throws WTException
Throws:
WTException

retrieveCriterions

private static Collection retrieveCriterions(String criteriaUfid)
                                      throws WTException
Throws:
WTException

retrieveAttributeCriteria

public static Collection retrieveAttributeCriteria(CollectionCriteria criteria)
                                            throws WTException
Throws:
WTException

retrieveCriterions

private static Collection retrieveCriterions(CollectionCriteria criteria)
                                      throws WTException
Throws:
WTException

createElementList

private static List createElementList(InputValue inputValue)
                               throws WTException
Throws:
WTException

createElement

private static Element createElement(InputValue inputValue,
                                     String value)
                              throws WTException
Throws:
WTException

getDisplayValue

private static String getDisplayValue(InputValue inputValue,
                                      String value)
                               throws WTException
Throws:
WTException

getItemCollectionInfo

public static Element getItemCollectionInfo(CollectionCriteria criteria)
                                     throws WTException
Throws:
WTException

getSessionContext

private static Map getSessionContext()

getItemCollection

public static Collection getItemCollection(CollectionCriteria criteria,
                                           String previewKey)
                                    throws WTException
Throws:
WTException

listObjects

public static Collection listObjects(PurgeRecord record)
                              throws WTException
Throws:
WTException

createTmpTextPreviewRecord

public static PurgeRecord createTmpTextPreviewRecord(Map paramMap)
                                              throws WTException
Throws:
WTException

createTmpTextPreviewRecord

private static PurgeRecord createTmpTextPreviewRecord(TaskHelper.PurgeParams purgeParams,
                                                      String previewKey)
                                               throws WTException
Throws:
WTException

createPurgeRecord

private static PurgeRecord createPurgeRecord(TaskHelper.PurgeParams purgeParams)
                                      throws WTException
Throws:
WTException

finishPurgeJob

public static PurgeRecord finishPurgeJob(Map paramMap,
                                         String ufidList)
                                  throws WTException
Throws:
WTException

collectAndPurgeObjects

private static PurgeRecord collectAndPurgeObjects(TaskHelper.PurgeParams recParams)
                                           throws WTException
Throws:
WTException

createPurgeForPreviewLater

private static PurgeRecord createPurgeForPreviewLater(TaskHelper.PurgeParams recParams,
                                                      String previewMode,
                                                      String previewLimit)
                                               throws WTException
Throws:
WTException

createPurgeRecordTask_impl

private static PurgeRecord createPurgeRecordTask_impl(TaskHelper.PurgeParams recParams,
                                                      String ufidList)
                                               throws WTException
Throws:
WTException

setRecordStatus

static void setRecordStatus(PurgeRecord record,
                            EnumeratedType status)
                     throws WTException
Throws:
WTException

setAttribute

public static void setAttribute(Element elem,
                                String name,
                                Object value)

getReferencedObject

public static Persistable getReferencedObject(Element elem,
                                              String refAttrName)
                                       throws WTException
Throws:
WTException

getTaskEventConsoleUrl

public static String getTaskEventConsoleUrl(String recordUfid)
                                     throws WTException
Throws:
WTException

log

public static void log(String tag,
                       Object msg)

log

public static void log(String tag,
                       Object msg,
                       Element elem)

log

public static void log(String tag,
                       Object msg,
                       Group group)

resumeTmpJob

private static PurgeRecord resumeTmpJob(String ufid,
                                        TaskHelper.PurgeParams recParams)
                                 throws WTException
Throws:
WTException

updateRecord

private static PurgeRecord updateRecord(PurgeRecord purgeRecord,
                                        TaskHelper.PurgeParams recParams)
                                 throws WTException
Throws:
WTException

resumeJob

public static PurgeRecord resumeJob(PurgeRecord record,
                                    String ufidList)
                             throws WTException
Throws:
WTException

restoreArchive

public static RestoreRecord restoreArchive(Map paramMap)
                                    throws WTException
This method creates Restore Job (RestoreRecord) and associated command task, and activates command task to perform restore operation.

Parameters:
paramMap - Should contain the name of RestoreRecord and reference to the Archive object. *
Returns:
Restore Record (updated with the status of the operation).
Throws:
WTException

getFolderPath

public static String getFolderPath(String ufid)
                            throws WTException
Throws:
WTException

ufid2oid

private static String ufid2oid(String ufid)
                        throws WTException
Converts UFID format to OID format. Works for the UFID's in the form of a directory service (LDAP) DN. Example: UFID format: 'OR:wt.doc.WTDocument:32038:868634064-1085504190588-31720052-160-88-253-132@mrapaic03d.ptcnet.ptc.com' OID format: 'wt.doc.WTDocument:32038'

Parameters:
ufid - The UFID format to be converted.
Returns:
Throws:
WTException

ufid2obj

private static Persistable ufid2obj(String ufid)
                             throws WTException
Throws:
WTException

object2string

private static String object2string(Object obj)
                             throws WTException
Throws:
WTException

createCollectionCriteriaTask

public static CollectionCriteria createCollectionCriteriaTask(Map paramMap)
                                                       throws WTException
Throws:
WTException

newCollectionCriteria

static CollectionCriteria newCollectionCriteria(Map paramMap)
                                         throws WTException
Throws:
WTException

addAttributeCriteria

static void addAttributeCriteria(CollectionCriteria cc,
                                 Map paramMap)
                          throws WTException
Throws:
WTException

addCriterion

private static void addCriterion(CollectionCriteria cc,
                                 String type,
                                 Collection valColl)
                          throws WTException
Throws:
WTException

addObjectTypeCriterion

static void addObjectTypeCriterion(CollectionCriteria cc,
                                   Collection valColl)
                            throws WTException
Throws:
WTException

addVersionCriterion

static void addVersionCriterion(CollectionCriteria cc,
                                Collection valColl)
                         throws WTException
Throws:
WTException

addIterationCriterion

static void addIterationCriterion(CollectionCriteria cc,
                                  Collection valColl)
                           throws WTException
Throws:
WTException

addLifecycleCriterion

static void addLifecycleCriterion(CollectionCriteria cc,
                                  Collection valColl)
                           throws WTException
Throws:
WTException

addVAMCriterion

static void addVAMCriterion(CollectionCriteria cc,
                            Collection valColl)
                     throws WTException
Throws:
WTException

addViewCriterion

static void addViewCriterion(CollectionCriteria cc,
                             Collection valColl)
                      throws WTException
Throws:
WTException

addCreatedByCriterion

static void addCreatedByCriterion(CollectionCriteria cc,
                                  Collection valColl)
                           throws WTException
Throws:
WTException

addCreateDateCriterion

static void addCreateDateCriterion(CollectionCriteria cc,
                                   Collection valColl)
                            throws WTException
Throws:
WTException

addCriterion

private static void addCriterion(CollectionCriteria cc,
                                 String type,
                                 InputValue[] ivList)
                          throws WTException
Throws:
WTException

createInputValue

private static InputValue createInputValue(String name,
                                           InputType type,
                                           String value)
                                    throws WTException
Throws:
WTException

createInputsForTypeCriterion

private static InputValue[] createInputsForTypeCriterion(String value,
                                                         boolean allowSub)
                                                  throws WTException
Throws:
WTException

createInputsForFolderCriterion

private static InputValue[] createInputsForFolderCriterion(String oidList,
                                                           String incList)
                                                    throws WTException
Throws:
WTException

createInputsForVersionCriterion

private static InputValue[] createInputsForVersionCriterion(String version)
                                                     throws WTException
Throws:
WTException

createInputsForIterationCriterion

private static InputValue[] createInputsForIterationCriterion(String iteration)
                                                       throws WTException
Throws:
WTException

createInputsForLifecycleCriterion

private static InputValue[] createInputsForLifecycleCriterion(String name)
                                                       throws WTException
Throws:
WTException

createInputsForViewCriterion

private static InputValue[] createInputsForViewCriterion(String viewRef)
                                                  throws WTException
Throws:
WTException

createInputsForCreatedByCriterion

private static InputValue[] createInputsForCreatedByCriterion(String objRef)
                                                       throws WTException
Throws:
WTException

createInputsForCreateDateCriterion

private static InputValue[] createInputsForCreateDateCriterion(String value)
                                                        throws WTException
Throws:
WTException

createInputsForContextCriterion

private static InputValue[] createInputsForContextCriterion(Collection containerRefs)
                                                     throws WTException
Throws:
WTException

addContextCriterion

private static void addContextCriterion(CollectionCriteria cc,
                                        Map paramMap)
                                 throws WTException
Throws:
WTException

addFolderCriteria

private static void addFolderCriteria(CollectionCriteria cc,
                                      Collection containerColl)
                               throws WTException
Throws:
WTException

getLaunchContainerRef

private static WTContainerRef getLaunchContainerRef(Map paramMap)
                                             throws WTException
Throws:
WTException

getContextCriterionDef

private static BaseCriterionDef getContextCriterionDef()
                                                throws WTException
Throws:
WTException

collectItemsImpl

private static WTCollection collectItemsImpl(CollectionCriteria criteria,
                                             String previewKey)
                                      throws WTException
Throws:
WTException

collectItemsImpl

private static WTCollection collectItemsImpl(CollectionCriteria criteria)
                                      throws WTException
Throws:
WTException

createConflictResolutions

private static Vector createConflictResolutions(boolean overrideInWs,
                                                boolean overrideShared)
                                         throws WTException
Throws:
WTException

getRelationshipMapName

private static String getRelationshipMapName(String versAndIters,
                                             String cadDependents)

getRelationshipMapByName

private static RelationshipMap getRelationshipMapByName(String mapName,
                                                        WTContainerRef cRef)
                                                 throws WTException
Throws:
WTException

getIETaskParam

private static String getIETaskParam(String key,
                                     Map paramMap,
                                     String defaultValue,
                                     boolean first)

getCreateDateInputDisplayValue

private static String getCreateDateInputDisplayValue(String createDate)