psdi.app.item

Class ItemStruct

  • All Implemented Interfaces:
    java.rmi.Remote, ItemStructRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class ItemStruct
    extends Mbo
    implements ItemStructRemote
    Mbo object to represent ItemStruct. See Item Package description for details.

    This is a organization level object.

    The key attributes in this object are as follows: OrgId, ItemId, Itemnum, ItemSetID, Instance

    The attributes in this object are as follows:

    AssetnumNon-persistent attribute. Is the new asset created when IAS is being applied on the parent asset.
    GlAccouuntNon-persistent attribute. Used to store general ledger account.
    InstanceIndicates the number of instances of this itemnum within the entire Itemstruct table. In other words, number of item assembly structures this itemnum belongs to. This value increments by one for each new Itemstruct object created for a given itemnum from the previous maximum Instance value for the itemnum.
    ItemidTop-level item for the item assembly structure.
    ItemnumItem Number.
    ItemSetIDIdentifier of the itemset identifier for this object.
    LdkeyLong description key used when a long description is added under the Remark attribute.
    IasDescriptionNon-persistent attribute. Is used to hold the description entered for the new location/asset generated through apply IAS process.
    LocationNon-persistent attribute. Is the new location created when IAS is applied on the parent location.
    OrgIdIdentifier of the organization for this item assembly structure.
    ParentParent item number.
    ParinstNumber of parent instance in an IAS. Itemnum can be a parent to other itemnums in more than one hierarchy, this value refers to the correct parent instance for the current Itemstruct object.
    QuantitySpare part quantity. This is the quantity set to the Sparepart which is created when IAS is applied to the piece of asset.
    RotsuspacctNon-persistent column. Used to store rotating suspense account.
    RemarkRemark is associated with itemnum within an item assembly structure (IAS). Remark applies only to the itemnum within the context of the IAS and so is different from the Description attribute of the itemnum's Item object. Remark is read-only except when this Itemstruct object represents the top-level itemnum within the IAS, that is the parent attribute is null.
    IAS1 - IAS5 extra fields
    • Constructor Detail

      • ItemStruct

        public ItemStruct(MboSet ms)
                   throws MXException,
                          java.rmi.RemoteException
        Construct the ITEMSTRUCT object
        Parameters:
        ms -
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • isTop

        public boolean isTop()
                      throws MXException,
                             java.rmi.RemoteException
        Is the item top level, that is, is it without a parent?
        Specified by:
        isTop in interface ItemStructRemote
        Returns:
        true if this object is the topmost object in this ItemStruct hierarchy mbo set
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ItemStruct.isTop()
      • getTop

        public MboSetRemote getTop()
                            throws MXException,
                                   java.rmi.RemoteException
        gets the topmost mbo for the current Itemstruct hierarchy mboset. getTop traverses up the hierarchy through the parent MBOs (that is, itemnum = :parent AND instance = :parinst AND itemid = :itemid). When the topmost MBO is found, this MBO's mbo set is returned.
        Specified by:
        getTop in interface ItemStructRemote
        Returns:
        the mbo set to which the topmost mbo in this ItemStruct hierarchy belongs
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        isTop
      • hasParents

        public boolean hasParents()
                           throws MXException,
                                  java.rmi.RemoteException
        Is the item NOT top level, that is, does it have a parent?
        Specified by:
        hasParents in interface ItemStructRemote
        Returns:
        true if this object is not the topmost object in this ItemStruct hierarchy mbo set
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ItemStruct.hasParents()
      • getParents

        public MboSetRemote getParents()
                                throws MXException,
                                       java.rmi.RemoteException
        returns the Itemstruct set that contains the parent to this Itemstruct object
        Specified by:
        getParents in interface ItemStructRemote
        Returns:
        mbo set that contains all the parent objects for this object. The set should contain only one object as ItemStruct hierarchies cannot be networked.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        parentCheck
      • getHierarchy

        public java.lang.String[] getHierarchy()
                                        throws MXException,
                                               java.rmi.RemoteException
        begins the process of finding all this ItemStruct object's ancestors.
        Specified by:
        getHierarchy in interface ItemStructRemote
        Returns:
        String[] that contains all the ancestor objects' itemnum attribute
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        String[] getHierarchy(Vector hierarchy)
      • applyIAS

        public void applyIAS(MboRemote thisOwner,
                             ItemRemote myItemMbo)
                      throws MXException,
                             java.rmi.RemoteException
        Public method for starting the Apply IAS procedure. For Apply IAS, generates the related data for this node of the ItemStruct tree. Will also cascade down and call applyIAS for rotating children.
        Specified by:
        applyIAS in interface ItemStructRemote
        Parameters:
        myItemMbo - The Item mbo related to this node on the ItemStruct tree. May be null
        thisOwner - For Apply IAS, the mbo that is having the IAS applied to it. May not be null! For Apply IAS to Asset, this is the Asset Mbo related to this node on the ItemStruct tree.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ItemStruct.applyIAS(MboRemote thisOwner, ItemRemote myItemMbo)
      • setMyAssetMbo

        protected void setMyAssetMbo(MboRemote asset)
                              throws MXException,
                                     java.rmi.RemoteException
        For Apply IAS to asset, the asset being applied IAS.
        Throws:
        MXException
        java.rmi.RemoteException
      • getMyAssetInputMbo

        public MboRemote getMyAssetInputMbo()
                                     throws MXException,
                                            java.rmi.RemoteException
        For Apply IAS to asset via virtual mbo AssetInput, return the assetInput mbo related to this node on the ItemStruct tree.
        Returns:
        Asset mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setMyAssetInputMbo

        protected void setMyAssetInputMbo(MboRemote assetInput)
                                   throws MXException,
                                          java.rmi.RemoteException
        Keeps the AssetInput instance for this ItemStruct as IAS is being called on this object.
        Parameters:
        assetInput - an instance of AssetInputRemote, a non-persistent object created in the Receive Rotating Items page.
        Throws:
        MXException
        java.rmi.RemoteException
      • getMyLocationMbo

        public MboRemote getMyLocationMbo()
                                   throws MXException,
                                          java.rmi.RemoteException
        For Apply IAS to location, return the location mbo related to this node on the ItemStruct tree.
        Returns:
        Asset mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setMyLocationMbo

        protected void setMyLocationMbo(MboRemote loc)
                                 throws MXException,
                                        java.rmi.RemoteException
        For Apply IAS:set the location mbo related to this IAS.
        Throws:
        MXException
        java.rmi.RemoteException
      • notifyIASDescChange

        protected void notifyIASDescChange()
                                    throws MXException,
                                           java.rmi.RemoteException
        if IASDescription was changed
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new ItemStruct record Field defaults are set
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException
        before allowing this ItemStruct to be deleted, checks to make sure that structure to which this ItemStruct belongs, if it is a kit, has not yet been added to a storeroom.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        See Also:
        Item.canModifyKitStructure()
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        appValidate() Application validation routine called before the itemstruct object is saved Method validates if the top level item has no parent. Checks to make sure that ItemStruct object has not been erroneously networked, that is, that two parents have not been provided for one ItemStruct object.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long access)
                    throws MXException,
                           java.rmi.RemoteException
        delete(long) routine A itemstruct record is deleted when it itself and its children are being disconnected from the system.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        access - modifier such as NOACCESCHECK.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Save() routine - upon insert of a child item, copy its children to the current hierarchy if the child item has its own sub hierarchy.
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • copyDescendants

        protected void copyDescendants()
                                throws MXException,
                                       java.rmi.RemoteException
        copies this item's children to the current hierarchy if this item has its own sub-hierarchy When adding a top level ItemStruct, there is no need of copy descendants.
        Throws:
        MXException
        java.rmi.RemoteException
      • doCopy

        protected void doCopy(MboSetRemote newChildren,
                              int parentsinstance)
                       throws MXException,
                              java.rmi.RemoteException
        This ItemStruct's job for doCopy is 1 copy a new ItemStruct in the passed newChildren mboset for the new ItemID; Note this is just itemonly copy.
        2 Ask its own children to do the same.
        Parameters:
        newChildren - the MboSet where the new ItemStruct is copied.
        parentsinstance - used for recursive calls of this method. It is the instance of the last ItemStruct added in the previous call to this method that will be the parent instance of the ItemStruct that is about to be added in the ensuing recursive call. Should be -1 when this method is called from anywhere but within itself.
        Throws:
        MXException
        java.rmi.RemoteException
      • copyIAS

        public void copyIAS(MboSetRemote adoptedItemStructSet,
                            boolean justTopItem)
                     throws MXException,
                            java.rmi.RemoteException
        begins the copy IAS process. This method adds the top-level ItemStruct MBOs passed in the first parameter to the ItemStruct MBO set to which the current ItemStruct MBO belongs. The parent and itemid attributes for these newly-added top-level MBOs are set to the current ItemStruct MBO's itemnum and itemdid attributes respectively. These new MBOs are the first-level descendants in this ItemStruct hierarchy.
        Specified by:
        copyIAS in interface ItemStructRemote
        Parameters:
        adoptedItemStructSet - top-level ItemStruct MBOs that are to be copied to the current ItemStruct hierarchy (identified by the itemid attribute of the current ItemStruct MBO). This set should be obtained using the ItemStructSetRemote.COPYIASDLG relationship. The set will include a number of MBOs selected in the UI for copying to the current ItemStruct MBO.
        justTopItem - boolean flag to indicate whether the descendants of the top-level ItemStruct MBOs being copied to the current ItemStruct hierarchy should also be copied. If true, only the top-level MBOs are copied.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        copyItemOnly, save, copyDescendants
      • copyItemOnly

        public void copyItemOnly(boolean justTheItem)
                          throws MXException,
                                 java.rmi.RemoteException
        sets the private data member itemOnly when copying an Item Assembly Structure(s) to the current Item Assembly Structure
        Specified by:
        copyItemOnly in interface ItemStructRemote
        Parameters:
        justTopItem - boolean flag to indicate whether the descendants of the top-level ItemStruct MBOs being copied to the current ItemStruct hierarchy should also be copied. If true, only the top-level MBOs are copied.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        copyIAS, copyDescendants
      • getOrgForGL

        public java.lang.String getOrgForGL(java.lang.String lookupAttr)
                                     throws MXException,
                                            java.rmi.RemoteException
        Override Mbo.getOrgForGL as ITEMSTRUCT is an ITEMSET object and GLAccount needs ORGID to work. Orgid is a non-persistent column for ItemStruct. Override the method just to bypass framework's elaborate check of objecttype before returning orgid.
        Specified by:
        getOrgForGL in interface MboRemote
        Overrides:
        getOrgForGL in class Mbo
        Returns:
        orgId
        Throws:
        MXException
        java.rmi.RemoteException
      • setValue

        public void setValue(java.lang.String attributeName,
                             java.lang.String val,
                             long accessModifier)
                      throws MXException,
                             java.rmi.RemoteException
        06-14915: override setValue to copy non-persistent value glaccount to the new location created as a result of Apply IAS.
        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)
      • setIsApplyIAS

        public void setIsApplyIAS(boolean isInApplyIAS)
                           throws MXException,
                                  java.rmi.RemoteException
        08-18077: indicates this itemstruct is in apply ias
        Throws:
        MXException
        java.rmi.RemoteException