com.ptc.windchill.counterpart.metadata.classnode
Class cClassificationNode

java.lang.Object
  extended bycom.ptc.windchill.counterpart.metadata.cEntry
      extended bycom.ptc.windchill.counterpart.metadata.cPrivateClassificationEntry
          extended bycom.ptc.windchill.counterpart.metadata.cPubMappedEntry
              extended bycom.ptc.windchill.counterpart.metadata.classnode.cAbstractClassificationNode
                  extended bycom.ptc.windchill.counterpart.metadata.classnode.cClassificationNode
All Implemented Interfaces:
nitidus.sil.be.core.iConflict, nitidus.sil.be.core.iEntryIO, nitidus.sil.be.clf.iPartClassIO, nitidus.sil.be.clf.iPrivateClassificationEntryIO, nitidus.sil.be.clf.iPubMappedEntryIO, nitidus.sil.be.core.iRecordIO, nitidus.sil.be.core.iRevisionControlledEntryIO, nitidus.sil.be.core.iVetoableEntryIO

public class cClassificationNode
extends cAbstractClassificationNode


Field Summary
private static String CLASSNAME
           
private static boolean DEBUG
           
private  String[] fChildRef
           
private  ClassificationNodeDefaultView fClassificationNode
           
private  cLocalizedStringIO[] fLocalizedNames
           
private  HashMap fOPMOverride
           
private  String fPictureURL
           
private  String[] fProperties
           
private  cLocalizedStringIO[] fTreeName
           
private static DebugWriter LOG
           
 
Fields inherited from class com.ptc.windchill.counterpart.metadata.classnode.cAbstractClassificationNode
 
Fields inherited from class com.ptc.windchill.counterpart.metadata.cPubMappedEntry
 
Fields inherited from class com.ptc.windchill.counterpart.metadata.cPrivateClassificationEntry
 
Fields inherited from class com.ptc.windchill.counterpart.metadata.cEntry
 
Fields inherited from interface nitidus.sil.be.core.iConflict
ctBadName, ctChild, ctDupName, ctMaxBasicAtt, ctMaxBasicClf, ctMaxBasicData, ctMaxBasicGeneral, ctMaxBasicUnit, ctMaxCfnRelatedData, ctMaxPartsLink621Clf, ctMaxPartsLinkClf, ctMaxSpecialAtt, ctMaxSpecialClf, ctMaxSpecialData, ctMaxSpecialGeneral, ctMaxSpecialUnit, ctMaxUnusedAtt, ctMaxWindchillClf, ctMaxWindchillFatalClf, ctMaxWindchillNonFatalClf, ctMaxWindchillUnit, ctMinBasicAtt, ctMinBasicClf, ctMinBasicData, ctMinBasicGeneral, ctMinBasicUnit, ctMinCfnRelatedData, ctMinPartsLink621Clf, ctMinPartsLinkClf, ctMinSpecialAtt, ctMinSpecialClf, ctMinSpecialData, ctMinSpecialGeneral, ctMinSpecialUnit, ctMinUnusedAtt, ctMinWindchillClf, ctMinWindchillFatalClf, ctMinWindchillNonFatalClf, ctMinWindchillUnit, ctNone, kBasic, kBasicAndAllWindchill, kBasicAndFatalWindchill, kBasicAndPartsLink, kBasicAndPartsLinkIncluding621, kFull, kMaxIgnorableConflict, kUnused
 
Constructor Summary
cClassificationNode(ClassificationNodeDefaultView node, ClassificationNodeDefaultView nodeWithAttributes, String[] childRef, ArrayList constraintList, String parentID)
           
 
Method Summary
private  boolean areConstraintsChanged(nitidus.sil.be.clf.iPartClass cpPartClass, HashMap attrsSearchMap)
          Compare what is in the given iPartClass argument, which is what the upload is asking to be set, with what is in this node, which is what Windchill has before we change it.
private  boolean areSingleDefConstraintsIdentical(AbstractCSMAttributeConstraintView constr1, AbstractCSMAttributeConstraintView constr2)
           
 boolean canDelete()
           
private static boolean checkBytes(byte[] imageBytes, byte[] attachmentBytes)
           
private  boolean classHasObsoleteAttributesOrConstraints(HashMap attrsSearchMap)
           
 int compareByNameTo(nitidus.sil.be.clf.iPrivateClassificationEntry cpPrivateCfnEntry)
          compares iPrivateClassificationEntry object to THIS by Name
static ClassificationNodeDefaultView create(nitidus.sil.be.clf.iPartClass cpPartClass, cClassificationNode parent, cClassifiableModeledNode struct, HashMap attrsSearchMap, ArrayList errors)
           
protected  ClassificationNodeDefaultView createChild(ClassificationNodeDefaultView childView, cClassifiableModeledNode struct)
           
private static Vector createConstraints(nitidus.sil.be.clf.iPartClass cpPartClass, HashMap attrsSearchMap)
          propcesses CP class object and fills the vector with new constraints if applicable
 void delete()
           
private  boolean deleteObsoleteAttributesAndConstraintsFromClass(ClassificationNodeDefaultView defView, HashMap attrsSearchMap)
           
 void enrich(nitidus.sil.be.clf.iPartClassIO cpPartClassIO, nitidus.sil.be.clf.iMasterClassificationManager cfnManager, HashMap propertiesMap, byte[] attachmentBytes)
           
private static DefaultAttributeContainer fillAttributeContainer(DefaultAttributeContainer container, nitidus.sil.be.clf.iPartClass cpPartClass, HashMap attrsSearchMap, ArrayList errors)
           
 String[] getChildRef()
           
private  ClassificationNodeDefaultView getClassificationNode()
           
private  ClassificationNodeNodeView getClassificationNodeNodeView()
           
 byte[] getImageBytes()
           
 nitidus.sil.be.core.iLocalizedStringIO[] getLocalizedNames()
           
 nitidus.sil.be.clf.iOPMOverrideIO[] getOPMOverride()
           
 String getPictureURL()
           
 String[] getProperties()
           
private  String[] getPropertyIDsFromContainer(ClassificationNodeDefaultView nodeWithAttributes)
           
 String getStructurePrimaryClassName()
           
 nitidus.sil.be.core.iLocalizedStringIO[] getTreeName()
           
 String getWindchillType()
           
 boolean identicalTo(nitidus.sil.be.clf.iPartClass cpPartClass, cAbstractClassificationNode parent, HashMap attrsSearchMap)
           
private  boolean isAttributeContainerChanged(nitidus.sil.be.clf.iPartClass cpPartClass, HashMap attrsSearchMap)
          Compare what is in this node, which is what Windchill has before we change it, with what is in the given iPartClass argument, which is what the upload is asking to be set.
private  boolean isChildOf(cAbstractClassificationNode parent)
           
private  boolean isRoot()
           
private  HashMap mergeConstraintsAndDefaults(ClassificationNodeDefaultView nodeWithAttributes, ArrayList constraintList)
           
 void preUpdate(nitidus.sil.be.clf.iPartClass cpPartClass, cAbstractClassificationNode anParent, HashMap attrsSearchMap)
          Detects if critical field (name or parent) going to be changed and assigns that field uniq temporary value in order to avoid conflicting with other classes
private  ClassificationNodeDefaultView refreshClassificationNode(String debug)
           
private  ClassificationNodeNodeView refreshClassificationNodeNodeView(String debug)
           
private  boolean removeOldConstraintsAndRefineNewOnes(ClassificationNodeDefaultView defView, nitidus.sil.be.clf.iPartClass cpPartClass, HashMap attrsSearchMap, Vector newConstraints)
           
(package private)  void setChildRef(String[] childRef)
          see cAbstractClassificationNode
(package private)  void setOPMOverride(HashMap opmOverrideMap)
          see cAbstractClassificationNode
 void setPictureURL(String pictureURL)
           
 void update(nitidus.sil.be.clf.iPartClass cpPartClass, cAbstractClassificationNode anParent, HashMap attrsSearchMap, ArrayList errors)
           
private  boolean updateAttributeContainer(DefaultAttributeContainer container, nitidus.sil.be.clf.iPartClass cpPartClass, HashMap attrsSearchMap, ArrayList errors)
          updates the container in case of the change
 void updateID()
           
 
Methods inherited from class com.ptc.windchill.counterpart.metadata.classnode.cAbstractClassificationNode
adjustClassPropertiesAndOPMOverrides, createConstraintsAndDefaultsFromOPMOverrides, enrich, getCatalogPropertyOrderRef, getKeywords, getParentID, getPrimaryUnitSystemName, getPrimaryUnitSystemRef, getSchematicURL, isSearchable, reorderStringArray
 
Methods inherited from class com.ptc.windchill.counterpart.metadata.cPubMappedEntry
enrich, getCustomDUNS, getName, getPreferredName, getPublicID, getShortDefinition
 
Methods inherited from class com.ptc.windchill.counterpart.metadata.cPrivateClassificationEntry
enrich, getAppSpecific, getChangeDescription, getCurrentMajorRevision, getCurrentMinorRevision, getDescription, getLockedBy, getRevisions, isApproved, isCurrentRevision, isDescriptionEqualTo, setAppSpecific
 
Methods inherited from class com.ptc.windchill.counterpart.metadata.cEntry
acknowledgeChange, compareByIDTo, enrich, getConflict, getID, isDeleted, isInConflict, isInUse, isModified, isNew, isObsolete, isReadOnly, needsIDUpdate, setConflict, setID, setInUse, setObsolete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nitidus.sil.be.clf.iPubMappedEntryIO
getCustomDUNS, getPreferredName, getPublicID, getShortDefinition
 
Methods inherited from interface nitidus.sil.be.clf.iPrivateClassificationEntryIO
getAppSpecific, getDescription
 
Methods inherited from interface nitidus.sil.be.core.iVetoableEntryIO
isApproved, isCurrentRevision
 
Methods inherited from interface nitidus.sil.be.core.iRevisionControlledEntryIO
getChangeDescription, getCurrentMajorRevision, getCurrentMinorRevision, getLockedBy, getRevisions
 
Methods inherited from interface nitidus.sil.be.core.iEntryIO
getID
 
Methods inherited from interface nitidus.sil.be.core.iRecordIO
isDeleted, isModified, isNew, isReadOnly
 

Field Detail

fClassificationNode

private ClassificationNodeDefaultView fClassificationNode

fChildRef

private String[] fChildRef

fProperties

private String[] fProperties

fTreeName

private cLocalizedStringIO[] fTreeName

fOPMOverride

private HashMap fOPMOverride

fPictureURL

private String fPictureURL

fLocalizedNames

private cLocalizedStringIO[] fLocalizedNames

CLASSNAME

private static final String CLASSNAME

DEBUG

private static final boolean DEBUG

LOG

private static final DebugWriter LOG
Constructor Detail

cClassificationNode

public cClassificationNode(ClassificationNodeDefaultView node,
                           ClassificationNodeDefaultView nodeWithAttributes,
                           String[] childRef,
                           ArrayList constraintList,
                           String parentID)
Method Detail

getLocalizedNames

public nitidus.sil.be.core.iLocalizedStringIO[] getLocalizedNames()
Specified by:
getLocalizedNames in interface nitidus.sil.be.clf.iPrivateClassificationEntryIO
Overrides:
getLocalizedNames in class cPrivateClassificationEntry
See Also:
iPrivateClassificationEntryIO

getChildRef

public String[] getChildRef()
Specified by:
getChildRef in interface nitidus.sil.be.clf.iPartClassIO
Specified by:
getChildRef in class cAbstractClassificationNode
See Also:
iPartClassIO

setChildRef

void setChildRef(String[] childRef)
see cAbstractClassificationNode

Specified by:
setChildRef in class cAbstractClassificationNode

getTreeName

public nitidus.sil.be.core.iLocalizedStringIO[] getTreeName()
Specified by:
getTreeName in interface nitidus.sil.be.clf.iPartClassIO
Specified by:
getTreeName in class cAbstractClassificationNode
See Also:
iPartClassIO

getProperties

public String[] getProperties()
Specified by:
getProperties in interface nitidus.sil.be.clf.iPartClassIO
Specified by:
getProperties in class cAbstractClassificationNode
See Also:
iPartClassIO

getOPMOverride

public nitidus.sil.be.clf.iOPMOverrideIO[] getOPMOverride()
Specified by:
getOPMOverride in interface nitidus.sil.be.clf.iPartClassIO
Specified by:
getOPMOverride in class cAbstractClassificationNode
See Also:
iPartClassIO

setOPMOverride

void setOPMOverride(HashMap opmOverrideMap)
see cAbstractClassificationNode

Specified by:
setOPMOverride in class cAbstractClassificationNode

getWindchillType

public String getWindchillType()
Specified by:
getWindchillType in interface nitidus.sil.be.clf.iPartClassIO
Specified by:
getWindchillType in class cAbstractClassificationNode
See Also:
iPartClassIO

getPictureURL

public String getPictureURL()
Specified by:
getPictureURL in interface nitidus.sil.be.clf.iPartClassIO
Specified by:
getPictureURL in class cAbstractClassificationNode
See Also:
iPartClassIO

setPictureURL

public void setPictureURL(String pictureURL)

getImageBytes

public byte[] getImageBytes()

getPropertyIDsFromContainer

private final String[] getPropertyIDsFromContainer(ClassificationNodeDefaultView nodeWithAttributes)

mergeConstraintsAndDefaults

private final HashMap mergeConstraintsAndDefaults(ClassificationNodeDefaultView nodeWithAttributes,
                                                  ArrayList constraintList)

enrich

public void enrich(nitidus.sil.be.clf.iPartClassIO cpPartClassIO,
                   nitidus.sil.be.clf.iMasterClassificationManager cfnManager,
                   HashMap propertiesMap,
                   byte[] attachmentBytes)

checkBytes

private static final boolean checkBytes(byte[] imageBytes,
                                        byte[] attachmentBytes)

isRoot

private final boolean isRoot()
                      throws WTException
Throws:
WTException

getClassificationNode

private final ClassificationNodeDefaultView getClassificationNode()

refreshClassificationNode

private final ClassificationNodeDefaultView refreshClassificationNode(String debug)
                                                               throws WTException
Throws:
WTException

refreshClassificationNodeNodeView

private final ClassificationNodeNodeView refreshClassificationNodeNodeView(String debug)
                                                                    throws WTException
Throws:
WTException

getClassificationNodeNodeView

private final ClassificationNodeNodeView getClassificationNodeNodeView()
                                                                throws WTException
Throws:
WTException

getStructurePrimaryClassName

public final String getStructurePrimaryClassName()
                                          throws WTException
Throws:
WTException

updateID

public final void updateID()
                    throws WTException,
                           WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

delete

public void delete()
            throws WTException
Throws:
WTException

canDelete

public boolean canDelete()

create

public static ClassificationNodeDefaultView create(nitidus.sil.be.clf.iPartClass cpPartClass,
                                                   cClassificationNode parent,
                                                   cClassifiableModeledNode struct,
                                                   HashMap attrsSearchMap,
                                                   ArrayList errors)
                                            throws WTException,
                                                   WTPropertyVetoException
Parameters:
cpPartClass -
parent -
struct -
attrsSearchMap - list of cBasicIBADefinition objects
Returns:
Throws:
WTException
WTPropertyVetoException

createChild

protected final ClassificationNodeDefaultView createChild(ClassificationNodeDefaultView childView,
                                                          cClassifiableModeledNode struct)
                                                   throws WTException,
                                                          WTPropertyVetoException,
                                                          RemoteException
Throws:
WTException
WTPropertyVetoException
RemoteException

preUpdate

public void preUpdate(nitidus.sil.be.clf.iPartClass cpPartClass,
                      cAbstractClassificationNode anParent,
                      HashMap attrsSearchMap)
               throws WTException,
                      WTPropertyVetoException
Detects if critical field (name or parent) going to be changed and assigns that field uniq temporary value in order to avoid conflicting with other classes

Parameters:
cpPartClass -
anParent -
Throws:
WTException
WTPropertyVetoException

update

public void update(nitidus.sil.be.clf.iPartClass cpPartClass,
                   cAbstractClassificationNode anParent,
                   HashMap attrsSearchMap,
                   ArrayList errors)
            throws WTException,
                   WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

identicalTo

public boolean identicalTo(nitidus.sil.be.clf.iPartClass cpPartClass,
                           cAbstractClassificationNode parent,
                           HashMap attrsSearchMap)
                    throws WTException,
                           WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

isChildOf

private boolean isChildOf(cAbstractClassificationNode parent)
                   throws WTException
Throws:
WTException

compareByNameTo

public int compareByNameTo(nitidus.sil.be.clf.iPrivateClassificationEntry cpPrivateCfnEntry)
compares iPrivateClassificationEntry object to THIS by Name

Overrides:
compareByNameTo in class cPrivateClassificationEntry
Returns:
-1 if less, 0 if equivalent, 1 if greater

fillAttributeContainer

private static DefaultAttributeContainer fillAttributeContainer(DefaultAttributeContainer container,
                                                                nitidus.sil.be.clf.iPartClass cpPartClass,
                                                                HashMap attrsSearchMap,
                                                                ArrayList errors)
                                                         throws WTException,
                                                                WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

isAttributeContainerChanged

private final boolean isAttributeContainerChanged(nitidus.sil.be.clf.iPartClass cpPartClass,
                                                  HashMap attrsSearchMap)
Compare what is in this node, which is what Windchill has before we change it, with what is in the given iPartClass argument, which is what the upload is asking to be set. Return "true" at the first difference encountered. Only return "false" at the end if we found no differences.


updateAttributeContainer

private final boolean updateAttributeContainer(DefaultAttributeContainer container,
                                               nitidus.sil.be.clf.iPartClass cpPartClass,
                                               HashMap attrsSearchMap,
                                               ArrayList errors)
                                        throws WTException,
                                               WTPropertyVetoException
updates the container in case of the change

Parameters:
container - (input/output)
cpPartClass -
attrsSearchMap -
Returns:
true if the container is updated
Throws:
WTException
WTPropertyVetoException

classHasObsoleteAttributesOrConstraints

private final boolean classHasObsoleteAttributesOrConstraints(HashMap attrsSearchMap)

deleteObsoleteAttributesAndConstraintsFromClass

private final boolean deleteObsoleteAttributesAndConstraintsFromClass(ClassificationNodeDefaultView defView,
                                                                      HashMap attrsSearchMap)
                                                               throws WTException
Parameters:
defView -
attrsSearchMap -
Returns:
TRUE if container has changed
Throws:
WTException

createConstraints

private static Vector createConstraints(nitidus.sil.be.clf.iPartClass cpPartClass,
                                        HashMap attrsSearchMap)
                                 throws WTException
propcesses CP class object and fills the vector with new constraints if applicable

Parameters:
cpPartClass -
attrsSearchMap -
Returns:
vector of objects of type CSMSingleDefConstraintDefaultView
Throws:
WTException

areConstraintsChanged

private boolean areConstraintsChanged(nitidus.sil.be.clf.iPartClass cpPartClass,
                                      HashMap attrsSearchMap)
Compare what is in the given iPartClass argument, which is what the upload is asking to be set, with what is in this node, which is what Windchill has before we change it. Return "true" at the first difference encountered. Only return "false" at the end if we found no differences.


removeOldConstraintsAndRefineNewOnes

private boolean removeOldConstraintsAndRefineNewOnes(ClassificationNodeDefaultView defView,
                                                     nitidus.sil.be.clf.iPartClass cpPartClass,
                                                     HashMap attrsSearchMap,
                                                     Vector newConstraints)
                                              throws WTException
Parameters:
defView -
cpPartClass -
attrsSearchMap -
Returns:
TRUE if changes are present
Throws:
WTException

areSingleDefConstraintsIdentical

private boolean areSingleDefConstraintsIdentical(AbstractCSMAttributeConstraintView constr1,
                                                 AbstractCSMAttributeConstraintView constr2)