psdi.app.swcatalog

Class SoftwareCatalog

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


    public class SoftwareCatalog
    extends Mbo
    implements SoftwareCatalogRemote
    The implementation of the Software Catalog business object. Provides services to generate a quasi-unique ID, manage write access to the attributes, and allow the business object to service both the software catalog entries and their variants. fields
    Since:
    7.2
    • Field Detail

      • TLOAMSOFTWARE_EXTERNAL_CATALOG_MANAGED_ATTRIBUTES

        protected static final java.lang.String[] TLOAMSOFTWARE_EXTERNAL_CATALOG_MANAGED_ATTRIBUTES
        These attributes are managed in SwKBT and TADz, so if source is one of these we set them as read-only
      • TLOAMSOFTWARE_THIRDPARTY_EDITABLE_ATTRIBUTES

        protected static final java.lang.String[] TLOAMSOFTWARE_THIRDPARTY_EDITABLE_ATTRIBUTES
        These attributes are enabled for editing for third-party software, so if source is third-party set them as editable
      • emptyNameList

        protected static final java.lang.String[] emptyNameList
      • FILTER_NOTSELF_CLAUSE

        protected static final java.lang.String FILTER_NOTSELF_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_NOTDELETED_CLAUSE

        protected static final java.lang.String FILTER_NOTDELETED_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_NOTSYNONYM_CLAUSE

        protected static final java.lang.String FILTER_NOTSYNONYM_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_NOTEXTERNALCATALOG_CLAUSE

        protected static final java.lang.String FILTER_NOTEXTERNALCATALOG_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_NOHIERARCHYPARENT_CLAUSE

        protected static final java.lang.String FILTER_NOHIERARCHYPARENT_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_NOHIERARCHYCHILD_CLAUSE

        protected static final java.lang.String FILTER_NOHIERARCHYCHILD_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_NORELATIONSHIPCHILD_CLAUSE

        protected static final java.lang.String FILTER_NORELATIONSHIPCHILD_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_NORELATIONSHIPPARENT_CLAUSE

        protected static final java.lang.String FILTER_NORELATIONSHIPPARENT_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_CANBEVERSION_CLAUSE

        protected static final java.lang.String FILTER_CANBEVERSION_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_CANBERELEASE_CLAUSE

        protected static final java.lang.String FILTER_CANBERELEASE_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_HASSAMESWNAME_CLAUSE

        protected static final java.lang.String FILTER_HASSAMESWNAME_CLAUSE
        See Also:
        Constant Field Values
      • FILTER_TYPE_CHILDVERSION

        public static final java.lang.String FILTER_TYPE_CHILDVERSION
        make the selected records hierarchical version children of the current main record (which must be a release)
        See Also:
        Constant Field Values
      • FILTER_TYPE_CHILDRELEASE

        public static final java.lang.String FILTER_TYPE_CHILDRELEASE
        make the selected records hierarchical release children of the current main record (which must be a version)
        See Also:
        Constant Field Values
      • FILTER_TYPE_PARENTRELATION

        public static final java.lang.String FILTER_TYPE_PARENTRELATION
        make the selected records product children of the current main record
        See Also:
        Constant Field Values
      • FILTER_TYPE_CHILDRELATION

        public static final java.lang.String FILTER_TYPE_CHILDRELATION
        make the selected records product parents of the current main record
        See Also:
        Constant Field Values
      • FILTER_TYPE_CONVERSIONVARIANT

        public static final java.lang.String FILTER_TYPE_CONVERSIONVARIANT
        make the selected records conversion variants of the current main record
        See Also:
        Constant Field Values
      • isDisassociating

        protected boolean isDisassociating
        true if this is a variant record marked for disassociation (never delete variants)
      • isBreakingHierarchy

        protected boolean isBreakingHierarchy
        true if this is a hierarchy child record marked for disassociation (never delete these children)
    • Constructor Detail

      • SoftwareCatalog

        public SoftwareCatalog(MboSet ms)
                        throws MXException,
                               java.rmi.RemoteException
        The boilerplate constructor
        Parameters:
        ms -
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
                  throws MXException
        Manage read-only attributes based on if this is a new object, or an imported one. If it is a new object, all attributes editable. If it is an imported entry, check if the catalog source is marked as editable (SwKBT and TAD/z does not allow editing, all 3rd party catalogs do).

        Restrict the editability of TYPE if conditions are met

        Make ISREVIEWED field Read-Only if its value is TRUE

        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Set isreviewed and make it Read-Only. Set invisible fields if necessary
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setReadOnly

        protected void setReadOnly(boolean readOnly)
                            throws java.rmi.RemoteException
        Set all attributes of the object to read only flag to match the parameter readOnly, with the exception of a set of attributes that always remain read/write
        Parameters:
        boolean -
        Throws:
        java.rmi.RemoteException
      • isVariantObject

        protected boolean isVariantObject()
                                   throws java.rmi.RemoteException,
                                          MXException
        Return true if this is a variant object
        Returns:
        boolean
        Throws:
        java.rmi.RemoteException
        MXException
      • isHierarchyChild

        protected boolean isHierarchyChild()
                                    throws java.rmi.RemoteException,
                                           MXException
        Return true if this record is hierarchically linked to a parent
        Returns:
        boolean
        Throws:
        java.rmi.RemoteException
        MXException
      • setReviewed

        protected void setReviewed()
                            throws MXException,
                                   java.rmi.RemoteException
        Force the record to reviewed status
        Throws:
        MXException
        java.rmi.RemoteException
      • toBeSaved

        public boolean toBeSaved()
                          throws java.rmi.RemoteException
        If disassociating a variant or breaking the hierarchy, always save; otherwise return base implementation
        Specified by:
        toBeSaved in interface MboRemote
        Overrides:
        toBeSaved in class Mbo
        Throws:
        java.rmi.RemoteException
      • generateUniqueId

        public java.lang.String generateUniqueId()
                                          throws java.rmi.RemoteException,
                                                 MXException
        Generate a "unique" ID for this MBO. Read SWNAME, VERSION, RELEASE, MANUFACTURER from the record and pass them to a static method to obtain that produces a quasi-unique ID
        Specified by:
        generateUniqueId in interface SoftwareCatalogRemote
        Returns:
        String
        Throws:
        java.rmi.RemoteException
        MXException
      • generateUniqueId

        public static java.lang.String generateUniqueId(java.lang.String swname,
                                                        java.lang.String version,
                                                        java.lang.String release,
                                                        java.lang.String manufacturer,
                                                        java.lang.String unknownString)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        Generate a "unique" ID based on four parameters: For SWNAME, VERSION, RELEASE, MANUFACTURER, Replace nulls parameters with with empty strings Set SWNAME := TRIM(SWNAME); Set VERSION := TRIM(VERSION); Set RELEASE := TRIM(RELEASE); Set MANUFACTURER := TRIM(MANUFACTURER); If (RELEASE is empty) then {Set VERREL := VERSION} else {Set VERREL := VERSION + '.' + RELEASE}; // note that if version is empty there will be two adjacent | characters If (SWNAME is empty) then SWNAME := [dpa_unknown property value]; If (VERREL is empty) then VERREL := [dpa_unknown property value]; // Note that if version is empty but release is not, there will not be UNKKNOWN in the place of version If (MANUFACTURER is empty) then MANUFACTURER := [dpa_unknown property value]; Set uniqueid := UPPERCASE(SWNAME + '|' + VERREL + '|' + MANUFACTURER);
        Returns:
        String
        Throws:
        java.rmi.RemoteException
        MXException
      • getUnknownString

        protected java.lang.String getUnknownString()
                                             throws java.rmi.RemoteException,
                                                    MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Set the hidden unique key as many times as needed
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.modify()
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Always force the reviewed flag on manual save. If disassociating a variant, do not delete the record.
        Overrides:
        save in class Mbo
        Throws:
        java.rmi.RemoteException
        MXException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        If this is a variant then disassociate it. Always mark as deleted - this will ensure the proper visual display of the "pending delete" status
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        long -
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        If this is a variant then reassociate it. Always do the base undelete - this will ensure the proper visual display of the "pending delete" status
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Parameters:
        long -
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Do not allow the entry to be deleted if there is any reference to it
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getVuiExhibitID

        public java.lang.String getVuiExhibitID()
                                         throws MXException,
                                                java.rmi.RemoteException
        Get the Value Unit Exhibit List ID. If value of the current node is null or empty retrieve the value from the parent. recursive call.
        Specified by:
        getVuiExhibitID in interface SoftwareCatalogRemote
        Returns:
        String vulExhibitID or null if none is set
        Throws:
        MXException
        java.rmi.RemoteException
      • getFilterClause

        public static java.lang.String getFilterClause(java.lang.String requestedType)
      • combineSubClauses

        public static java.lang.String combineSubClauses(java.lang.String[] subClauses)
        Utility method to combine sub-clauses into one clause, joining them with the operator "and"
        Parameters:
        subClauses - an array of sub-clauses to be combined
        Returns:
        the clauses and-ed
      • getCatalogRecord

        public static MboRemote getCatalogRecord(long tloamsoftwareid,
                                                 UserInfo userInfo)
                                          throws java.rmi.RemoteException,
                                                 MXException
        Retrieve from the database the catalog record based on its unique TLOAMSOFTWAREID
        Parameters:
        tloamsoftwareid - - the key value for TLOAMSOFTWARE.TLOAMSOFTWAREID
        userInfo - - the user credentials to retrieve the MBO
        Returns:
        the record, or null if the ID is not found
        Throws:
        MXException
        java.rmi.RemoteException