com.ibm.tivoli.maximo.skd.app

Class SKDQuery

  • java.lang.Object
  • All Implemented Interfaces:
    SKDQueryRemote, java.rmi.Remote, MboConstants, MboRemote, MaxRemoteProxy
    Direct Known Subclasses:
    SKDAssetLocQuery


    public class SKDQuery
    extends Mbo
    implements SKDQueryRemote
    MBO object to represent SKDQuery. See Scheduler package description for details.

    This is a system level object.

    The key attributes for this object is: NAME, OBJECTNAME, QUERYNAME.

    The attributes in this object are as follows:

    Attribute NameDescription
    OBJECTNAMEIdentifies the type of work/resource records that will be retrieved using the query.
    QUERYNAMEIdentifies the query that will be used to retrieve work/resource records. This value must be unique.
    WHERECLAUSESQL expression that will be used to retrieve work/resource records.
    SKDOBJECTNAMESKD Object Name.
    SKDQUERYIDUnique Id.
    DESCRIPTIONDescribes the query.
    EXPOBJECTExpression builder Object.
    NAMEIdentifies the schedule in the SKDProject(for a schedule). This value must be unique. The schedule consists of a group of work records and their required resources. The schedule can be viewed and edited in the Gantt View tab.
    • Constructor Detail

      • SKDQuery

        public SKDQuery(MboSet ms)
                 throws java.rmi.RemoteException
        Constructs the SKDQuery object.

        Parameters:
        ms - MboSet
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • getDefaultObjectName

        public java.lang.String getDefaultObjectName(java.lang.String relationShipName)
                                              throws MXException,
                                                     java.rmi.RemoteException
        Return the default object name to be used for filling in for a new query.
        Parameters:
        relationShipName -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Adds a new SKDQuery(SKDACTQUERY,SKDRESQUERY,SKDLABORQUERY) object for the 'Work Queries', 'Additional Resources' and 'Resource Availability'.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Parameters:
        none -
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        Saves a SKDQuery Object. If this object to be saved, each time it updates the SaveTime and SavedBy for the schedule(SKDProject).
        Overrides:
        save in class Mbo
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • init

        public void init()
                  throws MXException
        Initialization routine. If the loggedin user is not the creator of the current schedule, then Schedule and associated 'Work Queries', 'Additional Resources' are not editable.
        Overrides:
        init in class Mbo
        Parameters:
        none -
        Throws:
        MXException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        This method overrides the skipCopyField() in the Mbo. This method takes the MboValueInfo as its parameter to see if this field needs to be copied or skipped.If this field does not need to be copied, it returns true. The following fields donot get copied from the source SKDQuery to the target SKDQuery.
        1. NAME
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        mvi - 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:
        MXException
        java.rmi.RemoteException
      • propagateKeyValue

        public void propagateKeyValue(java.lang.String keyName,
                                      java.lang.String keyValue)
                               throws MXException,
                                      java.rmi.RemoteException
        Set value for NAME.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - Should equal "NAME" or else nothing will be propagated.
        keyValue - The new value of NAME.
        Throws:
        MXException
        java.rmi.RemoteException
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        This is called whenever a change is made to the attributes of SKDQuery. When any field related to SKDQuery is changed, the owner SKDProject's change date/change by is updated.
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • copyQuerys

        public void copyQuerys(MboSetRemote querySet)
                        throws MXException,
                               java.rmi.RemoteException
        Used to copy the selected queries from Query to SKDQuery depends on, 'Work Queries - SKDACTQUERY' or ' 'Additional Resources - SKDRESQUERY'. If the Selected Query exists in SKDQuery for the 'Work Queries - SKDACTQUERY' or ' 'Additional Resources - SKDRESQUERY', then we make the duplicate of that 'selected existing query' with extension 'Copy plus some number', then you can edit the QueryName in the UI before save is clicked. And also if the selected Query doesn't exist in the SKDQuery then we copy that query, to the SKDQuery (Work or Resources) object as a new record.
        Specified by:
        copyQuerys in interface SKDQueryRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SKDQuery.copyQuerys(MboSetRemote querySet)
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Before delete, here we check, If the Schedule(SKDProject) is been createdby the loggedin user. If logged in user is not the same as schedule creator, then throw the message. The logged in user cannot delete the 'Query'.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        MXApplicationException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Delete related SKDQuery entry
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Description copied from class: Mbo
        Pre-save validation method. Programmer can override with specific rules.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • saveQuickQueryQbe

        public void saveQuickQueryQbe(java.util.Hashtable savedQbeAttributes)
                               throws MXException,
                                      java.rmi.RemoteException
        This method will be called from the data bean to save the quick query qbe in the hashtable.
        Specified by:
        saveQuickQueryQbe in interface SKDQueryRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        com.ibm.tivoli.maximo.skd.app.SKDQuery#saveQuickQueryQbe( HashtablesavedQbeAttributes)
      • getQuickQueryQbe

        public java.util.Hashtable getQuickQueryQbe()
                                             throws MXException,
                                                    java.rmi.RemoteException
        This method returns the hash table for the given queryid. If the queryid is not found, it will return null.
        Specified by:
        getQuickQueryQbe in interface SKDQueryRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        com.ibm.tivoli.maximo.skd.app.SKDQuerySet#Hashtable getQBE(long queryid)