psdi.app.assetcatalog

Class ClassStructure

  • java.lang.Object
  • All Implemented Interfaces:
    java.rmi.Remote, ClassStructureRemote, HierarchicalMboRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class ClassStructure
    extends Mbo
    implements ClassStructureRemote, HierarchicalMboRemote
    MBO to represent ClassStructure.

    See Assetcatalog Package description.

    This is a system level object.

    There are two sets of key attributes. The keys for the primary unique identifier are: ClassStructureId.

    The attributes in this object are as follows:

    Attribute NameDescription
    ClassStructureIdIdentifier for this object's class structure. One of two keys for this object's primary unique identifier.
    DescriptionDescription of this class structure. Long description enabled.
    ClassificationID Level one asset classification identifier.
    GenAssetDesc Y/N attribute indicating whether to generate the asset description when this class structure is applied to an item, asset or location. If Y, the classifications, values and measure units of this structure and its specification will be used to automatically generate the description for the item, asset or location. If N, the asset description is not automatically generated. The default is Y.
    LDKeyLong description key. This is a link to text stored in the LongDescription table.
    TypeDefines the type of the node. Common uses would be Solution Content, Asset Classification, FAQ, ect.
    UseClassInDescY/N attribute indicating whether to include the information specified in classification in the automatically generated asset descriptions. The default is Y. The GenAssetDesc attribute controls whether a description is generated at all when applying a class structure. If this value and GenAssetDesc are both Y, the description will include classification.
    See Also:
    psdi.app.assetcatalog.AssetClass, ClassSpec
    • Constructor Detail

      • ClassStructure

        public ClassStructure(MboSet ms)
                       throws MXException,
                              java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Creates a ClassStructure object. Also sets default values to:

        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        06-20672: redid the canDelete method, get the tables from the domain CLASSUSEWITH to check all the tables that contain classstructureid.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long access)
                    throws MXException,
                           java.rmi.RemoteException
        Deletes the related objects when the ClassStructure object is deleted or classstructureid is cleared 06-20672: clear the classstructureid to the tables stored in the domain objects CLASSUSEWITH
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        access - the access
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        Description copied from class: Mbo
        Unmark the Mbo for deletion. Can only be called after a delete() and before the save() has been performed. This method will also unmark associated Long Description and Translation Mbos.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • duplicate

        public MboRemote duplicate()
                            throws MXException,
                                   java.rmi.RemoteException
        Duplicate a new item with DocLinks and Item Specifications.
        Specified by:
        duplicate in interface MboRemote
        Overrides:
        duplicate in class Mbo
        Returns:
        the newly duplicated Item object.
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        Overrides the skipCopyField() in the Mbo. Since this method takes the MboValueInfo as its parameter just check to see if this field needs to be copied or skipped by using the data from the static HashSet. If this field does not need to be copied return true.
        1. classstructureid
        2. classificationid
        3. classstructureid
        4. hasChildren
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        The - MboValueInfo object of the MboValue that needs to be copied.
        Returns:
        True,if the field does not need to be copied.In all other cases return false.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        Mbo.skipCopyField(psdi.mbo.MboValueInfo), ClassStructure.skipCopyField(psdi.mbo.MboValueInfo), psdi.app.assetcatalog.ClassStructur#duplicate, Item.loadSkipFieldCopyHashSet()
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        Saves the ClassStructure object. ClassAncestors records are created, updated,deleted accordingly. Classification records will be created for the classificationid if it does not exist in Classification table yet.
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • isGenAssetDesc

        public boolean isGenAssetDesc()
                               throws MXException,
                                      java.rmi.RemoteException
        Indicates if an item/asset/locaions is to generate it's description based upon this ClassStructure. This is determined by the boolean value of "GENASSETDESC

        Returns:
        boolean value of "GENASSETDESC"
        Throws:
        MXException
        java.rmi.RemoteException
      • genClassstructureDesc

        public java.lang.String genClassstructureDesc()
                                               throws MXException,
                                                      java.rmi.RemoteException
        Returns a String which contains concatinateded descriptions based upon the flags set up for this ClassStructure. A concatenated string will look like "pump, centrifigal". This method is needed for description generation for item, asset and locations.

        Specified by:
        genClassstructureDesc in interface ClassStructureRemote
        Returns:
        A concated string containing the description of L1classificationid thru L5classificationid. A null string means the ClassStructure does not allow the description generation. An empty string indicates none of the L1classificationid thru L5Classificationid allows description generation.
        Throws:
        MXException
        java.rmi.RemoteException
      • isTop

        public boolean isTop()
                      throws MXException,
                             java.rmi.RemoteException
        Determines if this is a top level. If this is a top level, TRUE is returned. If not, FALSE is returned.

        Specified by:
        isTop in interface HierarchicalMboRemote
        Returns:
        true - this is a top level; false - not a top level
        Throws:
        MXException
        java.rmi.RemoteException
      • hasChildren

        public boolean hasChildren()
                            throws MXException,
                                   java.rmi.RemoteException
        Determines if this level has children by looking at the children column. The 'children' column is a non-persistent YORN column. If this level does have children, TRUE is returned. If not, FALSE is returned.

        Specified by:
        hasChildren in interface HierarchicalMboRemote
        Returns:
        true - this level has children; false - no children
        Throws:
        MXException
        java.rmi.RemoteException
      • hasParents

        public boolean hasParents()
                           throws MXException,
                                  java.rmi.RemoteException
        Determines if this is top level classification. If this is a level 1 class, TRUE is returned. If not, FALSE is returned.

        Specified by:
        hasParents in interface HierarchicalMboRemote
        Returns:
        true - this is a level one; false - not level one
        Throws:
        MXException
        java.rmi.RemoteException
      • getChildren

        public MboSetRemote getChildren()
                                 throws MXException,
                                        java.rmi.RemoteException
        Returns the children set for the classification hierachy.

        Returns:
        MboSetRemote - the set of children
        Throws:
        MXException
        java.rmi.RemoteException
      • getParents

        public MboSetRemote getParents()
                                throws MXException,
                                       java.rmi.RemoteException
        Returns the parents of this current classification in a hierarchy.

        Returns:
        MboSetRemote - the set of parents
        Throws:
        MXException
        java.rmi.RemoteException
      • getTop

        public MboSetRemote getTop()
                            throws MXException,
                                   java.rmi.RemoteException
        Returns the top level parent of the classification in a hierachy.

        Returns:
        MboSetRemote - the set of top level parent
        Throws:
        MXException
        java.rmi.RemoteException
      • storeParentClassStructures

        public void storeParentClassStructures()
                                        throws MXException,
                                               java.rmi.RemoteException
        stores the parent classstructures in the vector parentClassStructuresVector.

        Throws:
        MXException
        java.rmi.RemoteException
      • getParentClassStructures

        public java.util.Vector getParentClassStructures()
                                                  throws MXException,
                                                         java.rmi.RemoteException
        gets the parent classstructures in the vector parentClassStructuresVector.

        Throws:
        MXException
        java.rmi.RemoteException
      • storeChildClassStructures

        public void storeChildClassStructures()
                                       throws MXException,
                                              java.rmi.RemoteException
        stores the child classstructures in the vector childClassStructuresVector.

        Throws:
        MXException
        java.rmi.RemoteException
      • getChildClassStructures

        public java.util.Vector getChildClassStructures()
                                                 throws MXException,
                                                        java.rmi.RemoteException
        gets the child classstructures in the vector childClassStructuresVector.

        Throws:
        MXException
        java.rmi.RemoteException
      • getHierarchyPath

        public java.lang.String getHierarchyPath()
                                          throws MXException,
                                                 java.rmi.RemoteException
        returns a string that contains all ancestors for this current node
        Specified by:
        getHierarchyPath in interface ClassStructureRemote
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getHierarchies

        public java.lang.String[] getHierarchies()
                                          throws MXException,
                                                 java.rmi.RemoteException
        returns null.

        Throws:
        MXException
        java.rmi.RemoteException
      • uncheckUseWith

        public void uncheckUseWith(java.lang.String attributename)
                            throws MXException,
                                   java.rmi.RemoteException
        Uncheck a useWith Column. Uncheck all children after validation if column can be unchecked.
        Parameters:
        attributename - attribute name of one usewith columns(ex. usewithitems,usewithassets...)
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        checks if we should add classificationid to Classification table. If user has said no, then throw exception for user to enter a good classificationid
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setInvalidValue

        protected void setInvalidValue(MboValue mbv)
                                throws MXException,
                                       java.rmi.RemoteException
        User says not to add measureunit or assetattird
        Parameters:
        mbv -
        Throws:
        MXException
        java.rmi.RemoteException
      • clearInvalidValue

        protected void clearInvalidValue(MboValue mbv)
                                  throws MXException,
                                         java.rmi.RemoteException
        User says he wants this object to automatically create assetattrid or measureunitid
        Parameters:
        mbv -
        Throws:
        MXException
        java.rmi.RemoteException
      • smartFindByObjectName

        public MboSetRemote smartFindByObjectName(java.lang.String sourceObj,
                                                  java.lang.String targetAttrName,
                                                  java.lang.String value,
                                                  boolean exact)
                                           throws MXException,
                                                  java.rmi.RemoteException
        94937:override smartFindByObjectName for the move to hierarchy to work
        Specified by:
        smartFindByObjectName in interface MboRemote
        Overrides:
        smartFindByObjectName in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • hasSiteOrgSecurity

        public boolean hasSiteOrgSecurity()
                                   throws MXException,
                                          java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • populateUseWith

        public void populateUseWith(MboRemote parent)
                             throws MXException,
                                    java.rmi.RemoteException
        When a child classification is being entered, also copy the parent's classusewith settings.
        Parameters:
        parent -
        Throws:
        MXException
        java.rmi.RemoteException
      • populateUseWith

        public void populateUseWith(MboRemote parent,
                                    MboSetRemote thisUseWithSet)
                             throws MXException,
                                    java.rmi.RemoteException
        When select parent classification is performed, need to copy parent's usewith to the classstructure's usewith.
        Parameters:
        parent -
        thisUseWithSet - the UseWithSet for this classstructure
        Throws:
        MXException
        java.rmi.RemoteException
      • getUseWith

        public MboRemote getUseWith(java.lang.String objectName)
                             throws MXException,
                                    java.rmi.RemoteException
        06-20672: get Usewith information from CLASSUSEWITH
        Specified by:
        getUseWith in interface ClassStructureRemote
        Parameters:
        objectName -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteUseWith

        public MboSetRemote deleteUseWith(MboRemote parent)
                                   throws MXException,
                                          java.rmi.RemoteException
        06-20672: delete the classusewith records that no longer apply when this classstructure record is selecting a parent.
        Parameters:
        parent - - the parent classstructure being selected
        Throws:
        MXException
        java.rmi.RemoteException
      • applyUpHierarchy

        public void applyUpHierarchy(MboRemote parent)
                              throws MXException,
                                     java.rmi.RemoteException
        06-19174: when a parent is selected for this classstructure, it copies the parent's applydown attributes
        Throws:
        MXException
        java.rmi.RemoteException
      • applyDownHierarchy

        public void applyDownHierarchy(MboRemote classSpec)
                                throws MXException,
                                       java.rmi.RemoteException
        06-19174: when the applyDownHier flag is checked for the passed classSpec record it also copies to the child
        Parameters:
        classSpec -
        Throws:
        MXException
        java.rmi.RemoteException
      • isTopLevel

        public boolean isTopLevel(java.lang.String objectName)
                           throws MXException,
                                  java.rmi.RemoteException
        This method checks the CLASSUSEWITH relationship to this classstructure for the give object name to see if has been mark as top level for the object name. If the relationships exist and it has been marked as top level true will be returned.
        Specified by:
        isTopLevel in interface ClassStructureRemote
        Parameters:
        objectName -
        Throws:
        MXException
        java.rmi.RemoteException
      • inClassificationApp

        public boolean inClassificationApp()
                                    throws MXException,
                                           java.rmi.RemoteException
        07-27114:returns true if the ClassStructureSet is in Classification app else returns false;
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getMboSet

        public MboSetRemote getMboSet(java.lang.String name)
                               throws MXException,
                                      java.rmi.RemoteException
        06-15448: override getMboSet if the relationship name is CLASSSPEC and the classstructure is in Classification Search
        Specified by:
        getMboSet in interface MboRemote
        Overrides:
        getMboSet in class Mbo
        Parameters:
        name - The relationship provided to retrieve a related mboSet, usually using foreign keys. For example, "psdi.app.workorder.WOSetRemote.ASSET" is a relationship for the work order object to access the asset Set where "workorder.assetnum=asset.assetnum". The relationship can also be chained. Such as ASSET.ASSETSTATUS.
        Returns:
        The returned related set specified through the relationship.
        Throws:
        MXException - "A relationship called {0} does not exist for the {1} business object" exception will be thrown if the relationship was not found. "Unknown Object" exception will be thrown if the database object can not be found through the relationship.
        java.rmi.RemoteException
        See Also:
        Mbo.getMboSet(String)
      • getUseWithInClassificationApp

        public MboRemote getUseWithInClassificationApp(java.lang.String objectName)
                                                throws MXException,
                                                       java.rmi.RemoteException
        08-12066: Find the classusewith object for the objectName passed in the Classusewith table window in Classification app return null if cannot find the matching.
        Throws:
        MXException
        java.rmi.RemoteException
      • getMboValueData

        public MboValueData getMboValueData(java.lang.String attribute)
                                     throws MXException,
                                            java.rmi.RemoteException
        06-19702: if the owning object(such as sr/incident etc is readonly), then the non-persistent description_class and hierarchypath should be readonly. Override the getzombie for the readonlyness in the field classes to be considerred, not ignored.
        Specified by:
        getMboValueData in interface MboRemote
        Overrides:
        getMboValueData in class Mbo
        Returns:
        the MboValueData associated with the attribute.
        Throws:
        MXException - "Attribute {0} does not exist" exception will be thrown if the attribute does not exist in the object.
        java.rmi.RemoteException
        See Also:
        Mbo.getMboValueData(String)
      • getRealChildrenForUseWith

        public MboSetRemote getRealChildrenForUseWith(java.lang.String objectForUseWith,
                                                      java.lang.String objectOrgId,
                                                      java.lang.String orjectSiteId)
                                               throws MXException,
                                                      java.rmi.RemoteException
        08-11691: return the real children set for this classstructure object including the use with logic.
        Parameters:
        objectForUseWith -
        objectOrgId -
        orjectSiteId -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getObjectsNotInUseWithDomain

        public MboSetRemote getObjectsNotInUseWithDomain(java.lang.String objectName,
                                                         boolean persistentObjectsOnly)
                                                  throws MXException,
                                                         java.rmi.RemoteException
        07-29326: objects that can be classified may not be in the classusewith domain, for example RELATIONRULES.SORUCECLASS and TARGETCLASS. They go by domain usewith objectname CI
        Parameters:
        objectName -
        persistentObjectsOnly -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • userSaidToCheckOrgSite

        public boolean userSaidToCheckOrgSite()
                                       throws MXException,
                                              java.rmi.RemoteException
        08-15493: this method is only called by AssetCatAppSaveBean(which extends AssetCatAppBean and overrides SAVE() when users want to have a Yes/No message upon save() time if the ClassStructure record is being added and organization or site is blank. If the user is not interested in the Yes/No message, then this method is not called.
        Specified by:
        userSaidToCheckOrgSite in interface ClassStructureRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • initFieldFlagsOnMbo

        public void initFieldFlagsOnMbo(java.lang.String attrName)
                                 throws MXException
        08-15493: make readonly of org and site when 1. The classification has been used. 2. The classification has child classifications 3. The classification has attributes(Classspecs & CLASSSPECUSEWITH)
        Overrides:
        initFieldFlagsOnMbo in class Mbo
        Throws:
        MXException
      • canChangeOrgSite

        public void canChangeOrgSite(java.lang.String relationship,
                                     MboValue orgSiteMbv)
                              throws MXException,
                                     java.rmi.RemoteException
        08-25617: returns true if the orgid or siteid can be changed
        Parameters:
        relationship: - can be "CLASSSPEC" or "CHILDREN"
        orgOrSiteAttr -
        orgOrSiteValue -
        Throws:
        MXException
        java.rmi.RemoteException
      • canChangeOrgSite

        public void canChangeOrgSite(MboValue orgSiteMbv)
                              throws MXException,
                                     java.rmi.RemoteException
        08-25617: returns true if the orgid or siteid can be changed
        Parameters:
        relationship: - can be "CLASSSPEC" or "CHILDREN"
        orgOrSiteAttr -
        orgOrSiteValue -
        Throws:
        MXException
        java.rmi.RemoteException
      • setApplicationRequired

        public void setApplicationRequired(java.lang.String attribute,
                                           boolean required)
                                    throws MXException,
                                           java.rmi.RemoteException
        This method will set the application required boolen flag on the MboValue associated this the passed in attribute. This method allows the Application Framework (UI) to specifically know whether or no it set requiredness on the attribute
        Specified by:
        setApplicationRequired in interface MboRemote
        Overrides:
        setApplicationRequired in class Mbo
        Parameters:
        attribute - The attribute whos MboValue will receive the ApplicationError
        required - whether the field is required or not
        Throws:
        java.rmi.RemoteException
        MXException
      • setByPassSortOrderValidation

        public void setByPassSortOrderValidation(java.lang.Boolean byPassSortOrderValidation)