com.ptc.windchill.counterpart.metadata
Class cApply

java.lang.Object
  extended bycom.ptc.windchill.counterpart.metadata.cApply
Direct Known Subclasses:
cApplyAttributeDefinition, cApplyAttributeOrganizer, cApplyClassificationNode, cApplyMeasurementSystem, cApplyQuantityOfMeasure

public abstract class cApply
extends Object


Field Summary
private static String CLASSNAME
           
private static boolean DEBUG
           
protected  Comparator fCpNameComparator
           
protected  ArrayList fCpObjsToAdd
           
protected  ArrayList fCpObjsToChange
           
protected  ArrayList fErrors
           
private  ArrayList fInitialCpObjs
           
private  ArrayList fInitialWtObjs
           
protected  Comparator fWtNameComparator
           
protected  HashMap fWtObjsSearchMap
           
protected  ArrayList fWtObjsToChange
           
protected  ArrayList fWtObjsToDel
           
(package private) static int kCompareByID
           
(package private) static int kCompareByName
           
private static DebugWriter LOG
           
 
Constructor Summary
protected cApply(ArrayList initialCpObjs, ArrayList initialWtObjs)
           
protected cApply(ArrayList initialCpObjs, ArrayList initialWtObjs, Comparator cpNameComparator, Comparator wtNameComparator)
           
 
Method Summary
protected abstract  boolean areIdentical(cEntry wtObj, Object cpObj)
           
protected  boolean canApply(nitidus.sil.be.core.iEntry obj)
           
protected  boolean canUpdate(cEntry wtObj, nitidus.sil.be.core.iEntry cpObj)
           
protected abstract  int compareByName(cEntry wtObj, Object cpObj)
           
private  void compareLists(ArrayList cpsytems, ArrayList wtsystems, ArrayList cpSysToAdd, ArrayList wtSysToDel, int option)
          Comparison by ID will result in updating of the Windchill MS to be identical to CounterPart entry Comparison by Name will lead to updating of uinits MAP in case both CP and WT measuremetn systems are identical
protected abstract  cEntry create(Object obj)
           
 void createObjects()
          add new objects to WT DB
protected abstract  void delete(cEntry obj)
           
 void deleteObjects()
           
private  void detectInUseConflict()
           
protected  void eraseFromAddList(nitidus.sil.be.core.iEntry cpObj)
           
protected abstract  void fileError(cEntry entry, int confl, String referToID, String comment)
           
protected abstract  void fileError(nitidus.sil.be.core.iEntry entry, int confl, String referToID, String comment)
           
 ArrayList getErrors()
           
 HashMap getWtObjsSearchMap()
           
private  void init()
           
protected  boolean isInAddList(nitidus.sil.be.core.iEntry cpObj)
           
 void prepare()
          compiles the lists of objects to add to Windchill and to delete from Windchill
 void preUpdate()
          changes identity data to temporary value move to temporary folders, temporary change names
protected  void preUpdate(cEntry wtObj, nitidus.sil.be.core.iEntry cpObj)
           
protected  cEntry searchEntryInMap(String id)
           
 void setInUse()
           
protected  void setInUse(cEntry obj, boolean isInUse)
           
protected  void setInUseReferringRecords(nitidus.sil.be.core.iEntry wtobj)
           
protected abstract  void update(cEntry wtObj, Object cpObj)
           
protected abstract  void updateID(cEntry wtObj)
           
 void updateObjects()
           
protected  void updateSearchMap(cEntry newEntry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fCpNameComparator

protected Comparator fCpNameComparator

fWtNameComparator

protected Comparator fWtNameComparator

fCpObjsToAdd

protected ArrayList fCpObjsToAdd

fWtObjsToDel

protected ArrayList fWtObjsToDel

fCpObjsToChange

protected ArrayList fCpObjsToChange

fWtObjsToChange

protected ArrayList fWtObjsToChange

fInitialCpObjs

private ArrayList fInitialCpObjs

fInitialWtObjs

private ArrayList fInitialWtObjs

fErrors

protected ArrayList fErrors

fWtObjsSearchMap

protected HashMap fWtObjsSearchMap

kCompareByID

static final int kCompareByID
See Also:
Constant Field Values

kCompareByName

static final int kCompareByName
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEBUG

private static final boolean DEBUG

LOG

private static final DebugWriter LOG
Constructor Detail

cApply

protected cApply(ArrayList initialCpObjs,
                 ArrayList initialWtObjs,
                 Comparator cpNameComparator,
                 Comparator wtNameComparator)

cApply

protected cApply(ArrayList initialCpObjs,
                 ArrayList initialWtObjs)
Method Detail

init

private final void init()

getWtObjsSearchMap

public final HashMap getWtObjsSearchMap()

getErrors

public final ArrayList getErrors()

fileError

protected abstract void fileError(cEntry entry,
                                  int confl,
                                  String referToID,
                                  String comment)

fileError

protected abstract void fileError(nitidus.sil.be.core.iEntry entry,
                                  int confl,
                                  String referToID,
                                  String comment)

updateSearchMap

protected final void updateSearchMap(cEntry newEntry)

searchEntryInMap

protected final cEntry searchEntryInMap(String id)

prepare

public final void prepare()
compiles the lists of objects to add to Windchill and to delete from Windchill


compareLists

private final void compareLists(ArrayList cpsytems,
                                ArrayList wtsystems,
                                ArrayList cpSysToAdd,
                                ArrayList wtSysToDel,
                                int option)
Comparison by ID will result in updating of the Windchill MS to be identical to CounterPart entry Comparison by Name will lead to updating of uinits MAP in case both CP and WT measuremetn systems are identical

Parameters:
cpsytems - (input) CounterPart measurement systems (of type iUnitSystem), possible candidates to be added to Windchill
wtsystems - (input) Windchill measurement systems candidates to be removed from Windchill
cpSysToAdd - (output) Resulting list of MS to add (of type iUnitSystem)
wtSysToDel - (output) Resulting list of MS to remove (of type cMeasurementSystem)
option - comparison option, one of: kCompareByID or kCompareByName

createObjects

public final void createObjects()
add new objects to WT DB


deleteObjects

public final void deleteObjects()

setInUse

public final void setInUse()

detectInUseConflict

private final void detectInUseConflict()

preUpdate

public final void preUpdate()
changes identity data to temporary value move to temporary folders, temporary change names


updateObjects

public final void updateObjects()

canApply

protected boolean canApply(nitidus.sil.be.core.iEntry obj)

canUpdate

protected boolean canUpdate(cEntry wtObj,
                            nitidus.sil.be.core.iEntry cpObj)

isInAddList

protected boolean isInAddList(nitidus.sil.be.core.iEntry cpObj)

eraseFromAddList

protected void eraseFromAddList(nitidus.sil.be.core.iEntry cpObj)

delete

protected abstract void delete(cEntry obj)

setInUse

protected void setInUse(cEntry obj,
                        boolean isInUse)

setInUseReferringRecords

protected void setInUseReferringRecords(nitidus.sil.be.core.iEntry wtobj)

create

protected abstract cEntry create(Object obj)

update

protected abstract void update(cEntry wtObj,
                               Object cpObj)

preUpdate

protected void preUpdate(cEntry wtObj,
                         nitidus.sil.be.core.iEntry cpObj)

updateID

protected abstract void updateID(cEntry wtObj)

compareByName

protected abstract int compareByName(cEntry wtObj,
                                     Object cpObj)

areIdentical

protected abstract boolean areIdentical(cEntry wtObj,
                                        Object cpObj)