psdi.app.report

Class ReportAdHoc

    • Constructor Detail

      • ReportAdHoc

        public ReportAdHoc(MboSet ms)
                    throws MXException,
                           java.rmi.RemoteException
        Construct the ReportAdHoc object.

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

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Description copied from class: Mbo
        This is called when a new Mbo is added to the Mboset collection. It is called AFTER user defaults have been set from the data dictionary. Programmer should usually override this to set some defaults. Default behavior is to do nothing.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Delete the ReportAdHoc and related ReportAdHocFields.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        None -
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • addAllAttributes

        public void addAllAttributes()
                              throws MXException,
                                     java.rmi.RemoteException
        Add all attributes to the selected list and remove them from the available list.
        Specified by:
        addAllAttributes in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • toggleAttribute

        public void toggleAttribute(java.lang.String attributeName,
                                    boolean toBeAdded)
                             throws MXException,
                                    java.rmi.RemoteException
        If the attribute is already in the Selected Fields list, remove it from the list; otherwise add it. This method is used to set default fields for the report. We only get the attribute name from the framework and must retrieve the mbo.
        Specified by:
        toggleAttribute in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • addToSummaryList

        public void addToSummaryList()
                              throws MXException,
                                     java.rmi.RemoteException
        Add the expression, description, category, and order to the Summary List table.

        Specified by:
        addToSummaryList in interface ReportAdHocRemote
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • addAttrToExpr

        public void addAttrToExpr(MboRemote attribute,
                                  boolean toBeAdded)
                           throws MXException,
                                  java.rmi.RemoteException
        Add an attribute to the expression table. Called from ReportAttributesAvailableCalcBean.
        Specified by:
        addAttrToExpr in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • setSelectedCalcCategory

        public void setSelectedCalcCategory(java.lang.String category)
                                     throws MXException,
                                            java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getSelectedCalcCategory

        public java.lang.String getSelectedCalcCategory()
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • isParentSelected

        public boolean isParentSelected(int objectID)
                                 throws MXException,
                                        java.rmi.RemoteException
        For an attribute to be added from a child object, there must be at least one field from the parent object selected. This method checks for that. This check is not performed for the top-level object.
        Specified by:
        isParentSelected in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • isParentSelectedCalc

        public boolean isParentSelectedCalc(int objectID)
                                     throws MXException,
                                            java.rmi.RemoteException
        For an attribute to be added from a child object, there must be at least one field from the parent object selected. This method checks for that. This check is not performed for the top-level object.
        Specified by:
        isParentSelectedCalc in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • objectDependencyCheck

        public void objectDependencyCheck(int id)
                                   throws MXException,
                                          java.rmi.RemoteException
        Determines if there is only one remaining reference to the passed object ID. If so, check if it has dependencies that prevent its removal.
        Specified by:
        objectDependencyCheck in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • getObjectName

        public java.lang.String getObjectName(int objectID)
                                       throws MXException,
                                              java.rmi.RemoteException
        Gets the object name for the passed object ID from the cache.
        Specified by:
        getObjectName in interface ReportAdHocRemote
        Returns:
        the object name, or null if it is not found
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidAttributes

        public java.util.Set getValidAttributes(int objectID)
                                         throws MXException,
                                                java.rmi.RemoteException
        Gets the set of attributes that may be used in expressions and calculations. This will be filtered for fields excluded from the object structure and unsupported data types.
        Specified by:
        getValidAttributes in interface ReportAdHocRemote
        Returns:
        the set of valid attribute names
        Throws:
        MXException
        java.rmi.RemoteException
      • updateAvailableAttributes

        public void updateAvailableAttributes()
                                       throws MXException,
                                              java.rmi.RemoteException
        Requeries MaxAttribute for the Select tab, based on the selected object. Exclude already-selected attributes.
        Specified by:
        updateAvailableAttributes in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • reorderColumns

        public void reorderColumns()
                            throws MXException,
                                   java.rmi.RemoteException
        Reorders the Selected Fields table based on the values entered in the Field Order field and removes any records marked for deletion.
        Specified by:
        reorderColumns in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • reorderCalculations

        public void reorderCalculations()
                                 throws MXException,
                                        java.rmi.RemoteException
        Reorders the Calculations table based on the values entered in the Expression Order field and removes any records marked for deletion.
        Specified by:
        reorderCalculations in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • reorderSummaries

        public void reorderSummaries()
                              throws MXException,
                                     java.rmi.RemoteException
        Reorders the Summary table based on the values entered in the Expression Order field and remove any records marked for deletion.
        Specified by:
        reorderSummaries in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • suggestUniqueName

        public java.lang.String suggestUniqueName()
                                           throws MXException,
                                                  java.rmi.RemoteException
        The user-entered reportname value already exists for this app. Append numbers to the reportname until we find a unique value.
        Throws:
        MXException
        java.rmi.RemoteException
      • suggestUniqueName

        public java.lang.String suggestUniqueName(java.lang.String reportName)
                                           throws MXException,
                                                  java.rmi.RemoteException
        The user-entered reportname value already exists for this app. Append numbers to the reportname until we find a unique value.
        Throws:
        MXException
        java.rmi.RemoteException
      • disableScheduleFields

        @Deprecated
        public void disableScheduleFields(boolean disable)
                                               throws MXException,
                                                      java.rmi.RemoteException
        Deprecated. no longer allow scheduling when report is created
        Specified by:
        disableScheduleFields in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • getReportNum

        public int getReportNum()
                         throws MXException,
                                java.rmi.RemoteException
        Get the reportnum value for the saved QBR. This is used to locate the request page to run immediate reports, and to create a ReportAuth entry for public reports.
        Specified by:
        getReportNum in interface ReportAdHocRemote
        Returns:
        the reportnum for the saved report
        Throws:
        MXException
        java.rmi.RemoteException
      • getReportXML

        public java.lang.String getReportXML()
                                      throws MXException,
                                             java.rmi.RemoteException
        Builds the replibrary presentation XML that includes the request page for the new QBR. For multi-lang environments, rebuilds the entire presentation to ensure that the same language is used throughout. In single language environments, only builds the request page for the current QBR.
        Specified by:
        getReportXML in interface ReportAdHocRemote
        Returns:
        String the replibrary presentation XML.
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • setDefaultObjectID

        public void setDefaultObjectID()
                                throws MXException,
                                       java.rmi.RemoteException
        If an object structure exists, set the parent object ID as the default selected object ID.
        Specified by:
        setDefaultObjectID in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • clearFields

        public void clearFields(java.lang.String fieldType)
                         throws MXException,
                                java.rmi.RemoteException
        Clear sort, group, or filter fields, depending on type passed. We only offer three levels for each but to support customizations for additional levels, check how many exist by testing for the existence of the attributename field at an incrementing level number.
        Specified by:
        clearFields in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • getLevelCount

        public int getLevelCount(java.lang.String fieldType)
                          throws MXException,
                                 java.rmi.RemoteException
        Returns the number of fields that exist for the passed field type (group or sort).
        Specified by:
        getLevelCount in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • isGroupOrSortField

        public boolean isGroupOrSortField(MboRemote attribute,
                                          java.lang.String fieldType)
                                   throws MXException,
                                          java.rmi.RemoteException
        Check all levels of the passed field type (group, sort, or filter) to see if this value is selected.
        Specified by:
        isGroupOrSortField in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • getDuplicateReportName

        public java.lang.String getDuplicateReportName()
                                                throws MXException,
                                                       java.rmi.RemoteException
        If the user has a QBR in this app with the same title, return its reportname value. If the user chooses to overwrite rather than provide a new title for the new QBR, this report will be deleted.
        Specified by:
        getDuplicateReportName in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • init

        public void init()
                  throws MXException
        Populating ORGID and SITEID from the user's profile so that the conditional sigoption on the Public field can be evaluated correctly for all applications whether they are SYSTEM level, ORG level or SITE level. This method is copied from ReportList.
        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
      • setFieldCategories

        protected void setFieldCategories()
                                   throws MXException,
                                          java.rmi.RemoteException
        Set the nonpersistent category values for the selected fields. This is only requried for saved fields. For reports that use a reporting object structure, initializeObjectStructureInfo() must be called first. Otherwise, setObjectOnlyDefaults() must be called first.
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • getCategory

        public java.lang.String getCategory(int objectID)
                                     throws MXException,
                                            java.rmi.RemoteException
        Returns the category name used in the categories tree for the specified object ID. The object ID uniquely identifies an object in the context of an object structure, however this method can also be used to get the default category name when the report does not use an object structure.
        Specified by:
        getCategory in interface ReportAdHocRemote
        Parameters:
        int - objectID the object ID
        Returns:
        the category name for the passed object ID
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • setObjectOnlyDefaults

        public void setObjectOnlyDefaults()
                                   throws MXException,
                                          java.rmi.RemoteException
        Store required values for quick lookup. Only necessary when editing an ad hoc report that does not use a reporting object structure. The fields objectname and parentcategory must be set before this is called.
        Specified by:
        setObjectOnlyDefaults in interface ReportAdHocRemote
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • setFormatFields

        protected void setFormatFields()
                                throws MXException,
                                       java.rmi.RemoteException
        Set the values associated with the nonpersistent fields for all Format types (group, sort, and filter) for the current report. The fields are Category (the descriptive name of the object) and Report Label (the user-entered label used on the report for the field).
        Parameters:
        String - formatType the type of format field (group/filter/sort)
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • setSelectedAttributes

        public void setSelectedAttributes()
                                   throws MXException,
                                          java.rmi.RemoteException
        Populate the temporary ReportAdHocFieldSet that is used in the Create Report UI. Also populate the map of selected attributes, used to enforce business rules as attributes are added and removed during the design process. This method is only required when accessing saved ad hoc reports; for new reports these will be popluated as fields are added.
        Specified by:
        setSelectedAttributes in interface ReportAdHocRemote
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • copyChildrenForInit

        public void copyChildrenForInit()
                                 throws MXException,
                                        java.rmi.RemoteException
        Populate the temporary child sets that are used in the Create Report UI. This is called from CreateReportBean after the ReportAdHoc is initialized.
        Specified by:
        copyChildrenForInit in interface ReportAdHocRemote
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • copyChildrenForSave

        public void copyChildrenForSave()
                                 throws MXException,
                                        java.rmi.RemoteException
        Copy from the temporary child sets that are used in the Create Report UI into the set that is saved in the transaction.
        Specified by:
        copyChildrenForSave in interface ReportAdHocRemote
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • createReportName

        public java.lang.String createReportName()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Construct a unique file name in the format __.rptdesign. Userid is truncated to 15 characters and the timestamp converted to seconds to ensure the 50 char length of report.reportname is not exceeded. If there are characters in the userid that are invalid for file naming, maxuserid is used instead.
        Specified by:
        createReportName in interface ReportAdHocRemote
        Returns:
        String the report name
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • clearCalcTempFields

        public void clearCalcTempFields()
                                 throws MXException,
                                        java.rmi.RemoteException
        Clear the temp fields used for building an expression. Reset the objectid and category fields based on the user's current selection in the category tree.
        Specified by:
        clearCalcTempFields in interface ReportAdHocRemote
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • setLabelSyncFlag

        public void setLabelSyncFlag()
                              throws MXException,
                                     java.rmi.RemoteException
        Updates the SYNCREPORTLABELS maxvar to indicate that the labels for the current report are missing for any additional languages. When public QBRs are created in a multilanguage environment, the replibrary presentation is only imported in the current user's language. The request page labels will only be available in this language until they are updated. The flag is only set if the report is public and multiple languages are enabled.
        Specified by:
        setLabelSyncFlag in interface ReportAdHocRemote
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • setTransientBROSInfo

        public void setTransientBROSInfo(java.lang.String brosID,
                                         java.util.Hashtable reportParams,
                                         java.lang.String csrfToken)
                                  throws MXException,
                                         java.rmi.RemoteException
        Specified by:
        setTransientBROSInfo in interface ReportAdHocRemote
        Throws:
        MXException
        java.rmi.RemoteException