psdi.app.assetcatalog

Class SpecificationMbo

  • java.lang.Object
    • Field Detail

      • copyValueChanged

        public boolean copyValueChanged
        Variable for rotating assetspec or locationspec. If value has been changed from the initial copied value from itemspec we want to mark copyValueChanged to true; for itemspec, or non-rotating assetspec, or locationspec, this does not apply.
      • oldSpecMarkedUnDeleted

        public MboRemote oldSpecMarkedUnDeleted
        The old(existing) that has same attribute/section that is being marked undeleted, to replace this current(new) spec that will be deleted at save()
      • numValueBeforeFormat

        public java.lang.String numValueBeforeFormat
        08-11675: remember the numvalue as string before MAXTYPE
    • Constructor Detail

      • SpecificationMbo

        public SpecificationMbo(MboSet ms)
                         throws MXException,
                                java.rmi.RemoteException
        Constructs the SpecificationMbo object.

        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • canGenerateDesc

        public MboRemote canGenerateDesc()
                                  throws MXException,
                                         java.rmi.RemoteException
        Determines if the numvalue/alnvaule plus the measureunit are allowed to be included in the description generation process. .

        Returns:
        MboRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        PERFORMANCE TEST: add this:
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setCopyValueChanged

        public void setCopyValueChanged(boolean changed)
                                 throws MXException,
                                        java.rmi.RemoteException
        Parameters:
        changed - true if changed, false if not
        Throws:
        MXException
        java.rmi.RemoteException
      • getDomainId

        public java.lang.String getDomainId()
                                     throws MXException,
                                            java.rmi.RemoteException
        Gets the domainId for this Specification. The domainid lives in the correspondin ClassSpec record.

        Returns:
        String - the domainId
        Throws:
        MXException
        java.rmi.RemoteException
      • getClassSpecRecord

        public MboRemote getClassSpecRecord()
                                     throws MXException,
                                            java.rmi.RemoteException
        get ClassSpec Record for this SpecificationMbo
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getMaxTableDomainObject

        public MboRemote getMaxTableDomainObject()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Get the MaxTableDomain object for this specification
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setMaxTableDomainObject

        public void setMaxTableDomainObject(MboRemote passedDomain)
                                     throws MXException,
                                            java.rmi.RemoteException
        Sets the maxTable value
        Parameters:
        passedDomain -
        Throws:
        MXException
        java.rmi.RemoteException
      • getMeasureUnitId

        public java.lang.String getMeasureUnitId()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Gets the measureunitid for this Specification. The measureunitid lives in the correspondin ClassSpec record.

        Returns:
        String - the measureunitid
        Throws:
        MXException
        java.rmi.RemoteException
      • getDataType

        public java.lang.String getDataType()
                                     throws MXException,
                                            java.rmi.RemoteException
        Gets the internal datatype of either "ALN" or "NUMERIC". An assetAttrId determines if this Specification is of ALN or NUMERIC datatype. One can only set the ALNVALUE if it is an ALN type, likewise, one can set only NUMVALUE if the type if NUMERIC.

        Returns:
        String - the internal datatype ASSETATTRID
        Throws:
        MXException
        java.rmi.RemoteException
      • init

        public void init()
                  throws MXException
        Initializes the Specification object. ItemSpec, AssetSpec, and LocationSpec set editability. Only alnvalue, numvalue and measureunitid can be edited for an existing ItemSpec, AssetSpec, or LocationSpec. If this object is already in the database the following fields are set to ReadOnly:

        • itemnum
        • assetattrid
        • classstructureid

        Overrides:
        init in class Mbo
        Throws:
        MXException
      • initFieldFlagsOnMbo

        public void initFieldFlagsOnMbo(java.lang.String attrName)
                                 throws MXException
        Description copied from class: Mbo
        The logic of setting the readonly and required field flags to the mbo. Any setting of the field flags that require expensive operation, such as database query should be moved from init() to this method. However, those which don't require steps such as fetching Mbos can be left in init(). You can group the logic for a few attributes together if logic of deciding their flag is the same, or in other words, can be handled at once.
        Overrides:
        initFieldFlagsOnMbo in class Mbo
        Throws:
        MXException
      • toUpdateReadOnly

        public boolean toUpdateReadOnly(java.lang.String attrName)
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Called whenever a change is made to the attributes of SpecificationMbo. Updates changeby and changedate attributes.
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • generateDesc

        public java.lang.String generateDesc()
                                      throws MXException,
                                             java.rmi.RemoteException
        Generates the description.
        Returns:
        String the description
        Throws:
        MXException
        java.rmi.RemoteException
      • notifyDescChange

        public void notifyDescChange()
                              throws MXException,
                                     java.rmi.RemoteException
        set the description of Item/asset/location to its current value. At the save() time, Item/Asset/Location will re-generated description based on the the complete specification set and only generate the description once.
        Throws:
        MXException
        java.rmi.RemoteException
      • setALNOrNUMReadOnly

        public void setALNOrNUMReadOnly()
                                 throws MXException,
                                        java.rmi.RemoteException
        set readonly ALNvalue or Numvalue depending on the datatype
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        checks if aln or numvalue is entered if the value is required
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getClassSpecUseWith

        public MboRemote getClassSpecUseWith()
                                      throws MXException,
                                             java.rmi.RemoteException
        Return ClassSpecUseWith
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getClassSpecUseWith

        public MboRemote getClassSpecUseWith(MboRemote thisMbo)
                                      throws MXException,
                                             java.rmi.RemoteException
        Return ClassSpecUseWith
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setOldSpecMarkedUndeleted

        public void setOldSpecMarkedUndeleted(MboRemote oldSpecUndeleted)
                                       throws MXException,
                                              java.rmi.RemoteException
        Mark the boolean true or false
        Parameters:
        oldSpecUndeleted -
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Writes or update the history record for this specification mbo. Currently not all the specification objects extending this class have a history table so we have to use the ones which have impelemented SpecHistoryInterface. If this is a new specification attribute we write a new history record. If we delete an existing specification attribute we close the existing history record by setting the enddate/removeddate. If we modifiy the attribute then in addition to closing the existing history record we also write a new one.
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • updateDesc

        public void updateDesc()
                        throws MXException,
                               java.rmi.RemoteException
        07-16935set the description field to be the generated value obtained from the setup of the classstructureid (in asset catalog setup) and the values/measureunits in the itemspec set.
        Throws:
        MXException
        java.rmi.RemoteException
      • setValue

        public void setValue(java.lang.String attributeName,
                             java.lang.String val,
                             long accessModifier)
                      throws MXException,
                             java.rmi.RemoteException
        08-11675: if the attributename is NUMVALUE, then get the val
        Specified by:
        setValue in interface MboRemote
        Overrides:
        setValue in class Mbo
        Parameters:
        attributeName - The attribute name within the current object.
        val - The string value to set to the attribute.
        accessModifier - The bitwise flags such as NOACCESSCHECK, NOVALIDATION_AND_NOACTION, and DELAYVALIDATION.
        Throws:
        MXException - "Attribute {0} does not exist" exception will be thrown if the attribute does not exist in the object. "Field is read only" exception will be thrown if the attribute is READONLY and the accessModifier does not specify NOACCESSCHECK. "Invalid Data Type" exception will be thrown for datatype mismatch. For example, setting a string value of characters to an attribute which has datatype of YORN.
        java.rmi.RemoteException
        See Also:
        Mbo.setValue(String,String,long)
      • getNumValueBeforeFormat

        public java.lang.String getNumValueBeforeFormat()
                                                 throws MXException,
                                                        java.rmi.RemoteException
        08-11675
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • validateKeyUniqueness

        public void validateKeyUniqueness()
                                   throws MXException,
                                          java.rmi.RemoteException
        08-19506: override this method when the new spec mbo is to be deleted
        Overrides:
        validateKeyUniqueness in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setAssetAttributeMbo

        public void setAssetAttributeMbo(MboRemote attrMbo)
                                  throws MXException,
                                         java.rmi.RemoteException
        09-17914:AssetAttributeMbo is passed in.
        Parameters:
        attrMbo -
        Throws:
        MXException
        java.rmi.RemoteException
      • getAssetAttributeMbo

        public MboRemote getAssetAttributeMbo()
                                       throws MXException,
                                              java.rmi.RemoteException
        09-22396:
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getTableDomainObject

        public MboRemote getTableDomainObject(java.lang.String domainId)
                                       throws MXException,
                                              java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        This method undeletes a specification mbo that has been marked for deletion. It does a check to make sure there are no duplicates before undeleting it.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • copy

        public MboRemote copy(MboSetRemote mboset,
                              long mboAddFlags)
                       throws MXException,
                              java.rmi.RemoteException
        Description copied from class: Mbo
        Adds a new mbo to the set passed in and copies the information for each of the fields into the new mbo from this. The new mbo will be added to the next of the current index.
        Specified by:
        copy in interface MboRemote
        Overrides:
        copy in class Mbo
        Parameters:
        mboset - The set into which the new mbo will be added.
        mboAddFlags - Flags to use when adding the new Mbo. Values on the attribute are always set with NOACCESSCHECK|NOVALIDATION_AND_NOACTION.
        Returns:
        The new mbo, with values copied from this mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.copy( MboSetRemote mboset, long mboAddFlags)
      • setValue

        public void setValue(java.lang.String attributeName,
                             double val,
                             long accessModifier)
                      throws MXException,
                             java.rmi.RemoteException
        IV90053: MIF calls setValue() from the inbound tags. If it is numeric, it calls the setvalue. In UI, it calls the setValue(String attributeName, String val, long accessModifier). Override this method to store the numvalue sent in before it was re-scaled. If it is MIF with a new numvalue, the code in FldSpecificationNumValue should not override scale.
        Specified by:
        setValue in interface MboRemote
        Overrides:
        setValue in class Mbo
        Parameters:
        attributeName - The attribute name within the current object.
        val - The double value to set to the attribute.
        accessModifier - The bitwise flags such as NOACCESSCHECK, NOVALIDATION_AND_NOACTION, and DELAYVALIDATION.
        Throws:
        MXException - "Attribute {0} does not exist" exception will be thrown if the attribute does not exist in the object. "Field is read only" exception will be thrown if the attribute is READONLY and the accessModifier does not specify NOACCESSCHECK. "Invalid Data Type" exception will be thrown for datatype mismatch. For example, setting a double value to an attribute which has data type of YORN or DATETIME.
        java.rmi.RemoteException
        See Also:
        Mbo.setValue(String,double,long)
      • toOverrideScaleForMIF

        public boolean toOverrideScaleForMIF()
                                      throws MXException,
                                             java.rmi.RemoteException
        IV90053: indicates if FldSpecificationNumValue class shoudl override scale
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getNumValueFromMIF

        public double getNumValueFromMIF()
                                  throws MXException,
                                         java.rmi.RemoteException
        IV90053: for FldSpecificationNumValue to compare values
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException