psdi.app.doclink

Class DoclinkService

    • Field Detail

      • URLTYPE_FILE

        public static final java.lang.String URLTYPE_FILE
        constant for urltype FILE
        See Also:
        Constant Field Values
      • URLTYPE_WWW

        public static final java.lang.String URLTYPE_WWW
        constant for urltype WWW
        See Also:
        Constant Field Values
      • URLTYPE_DMS

        public static final java.lang.String URLTYPE_DMS
        constant for urltype DMS
        See Also:
        Constant Field Values
    • Constructor Detail

      • DoclinkService

        public DoclinkService()
                       throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
      • DoclinkService

        public DoclinkService(MXServer mxServer)
                       throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • doclinkExists

        public boolean doclinkExists(java.lang.String keytable,
                                     java.lang.String keycolumn,
                                     java.lang.String keyvalue,
                                     UserInfo userInfo)
                              throws MXException,
                                     java.rmi.RemoteException
        Identifies whether a row exists in the doclinks table for the specified params.
        Specified by:
        doclinkExists in interface DoclinkServiceRemote
        Parameters:
        keytable - doclinks.keytable (e.g. ITEM)
        keycolumn - doclinks.keycolumn (e.g. ITEMNUM)
        keyvalue - doclinks.keyvalue (e.g. 4-0030). This must not contain any locale-specific formatting. For example, if the datatype on the owner table is Integer, this parameter must not contain a comma.
        userInfo - The UserInfo making the request.
        Returns:
        True if one or more rows exists in Doclinks for the specified params, else False
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        DoclinkService.doclinkExists(java.lang.String, java.lang.String, java.lang.String, psdi.security.UserInfo)
      • getAppDoctypeLinks

        public java.util.TreeMap getAppDoctypeLinks(java.lang.String appName,
                                                    java.lang.String keyTable,
                                                    java.lang.String keyColumn,
                                                    int keyValue,
                                                    UserInfo userInfo)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Get all the valid doctypes for the given app, and within each doctype, find any doclinks that may exist for the given keytable, keycolumn, and keyvalue. This can be used by the UI to build the linked documents tree.
        Specified by:
        getAppDoctypeLinks in interface DoclinkServiceRemote
        Parameters:
        appName - The application name (appdoctype.app).
        keyTable - The table name of doclinks keytable.
        keyColumn - The column name of doclinks keycolumn.
        keyValue - The value of the specified column on the specified table. For example, to get doclinks for a specified workorder, specify appName = WOTRACK, keyTable = WORKORDER, keyColumn = WONUM, and keyValue = the workorder number (e.g. 1002).

        It is important to note that the value provided for keyValue must not include locale-specific formatting. See javadoc comments on Doclinks for more information on this attribute.

        userInfo - The user making the request.
        Returns:
        TreeMap where each key = the String value of Doctype and element = MboSetRemote of Doclinks for that doctype, keyTable, keyColumn, and keyValue. The MboSet is ordered by document. If there are no doclinks for that doctype, the MboSet will be empty.

        If you iterate the map from the beginning, the MboSets will be in sequence by doctype. This can be done as in the following example:

        Iterator it = docMap.keySet().iterator();

        while (it.hasNext())
        {
        String doctype = (String) it.next();
        MboSetRemote doclinksSet = (MboSetRemote) docMap.get(doctype);
        if (!doclinksSet.isEmpty())
        {
        (etc.)
        }
        }
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        AppDoctype, Doclinks
      • addDocinfoAndLinks

        public MboSetRemote addDocinfoAndLinks(java.lang.String urlname,
                                               java.lang.String description,
                                               java.lang.String[] urlparam,
                                               java.lang.String doctype,
                                               java.lang.String urltype,
                                               java.lang.String keytable,
                                               java.lang.String keycolumn,
                                               java.lang.String[] keyvalue,
                                               boolean forceAutokey,
                                               java.lang.String application,
                                               UserInfo userInfo)
                                        throws MXException,
                                               java.rmi.RemoteException
        Create a Docinfo and one or more Doclinks per the supplied parameters.

        If the docinfo already exists, the links are added to the existing docinfo. However, if the docinfo already exists but has the wrong urltype or doctype, an error will be thrown.

        If any of the requested links already exists, that link is bypassed without error.

        If this method adds a docinfo and the docinfo is not autokeyed, and the "forceAutokey" parameter is true, this method will force autokeying to assign a value to the "document" attribute.

        This method will throw any of the standard validation errors if any value to be set on Docinfo or Doclinks is not valid. (This includes the doclink error "invalidkeyvalue".) In addition, if the Docinfo already exists but has the wrong urltype or doctype, this method will throw "doctypeBadMatch" or "urltypeBadMatch".

        Specified by:
        addDocinfoAndLinks in interface DoclinkServiceRemote
        Parameters:
        urlname - Value for docinfo urlname. Required.
        description - Value for docinfo description.
        urlparam - Value for docinfo urlparam(1-5). Can be null.
        doctype - Value for docinfo doctype. Required.
        urltype - Value for docinfo urltype. Required.
        keytable - Value for doclinks keytable. If null, then no links are added.
        keycolumn - Value for doclinks keytable. If null, then no links are added.
        keyvalue - Array of values for doclinks keyvalue. If null, then no links are added. It is important to note that the values stored in this array must not include locale-specific formatting (i.e. if the keyvalue is numeric then the value supplied must not contain commas).
        forceAutokey - If the docinfo document is not automatically, and this parameter is True, then this method will force autokeying for the "document" attribute. Otherwise, autokeying depends on the framework, as usual.
        application - Application attribute for the docinfo. Generally this should be null.
        userInfo - The user making the request.
        Returns:
        Docinfo set containing one Docinfo mbo and its related Doclinks.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        DocinfoSet.findDocinfo(java.lang.String, java.lang.String[]), Docinfo.addDocinfoAndLinks(java.lang.String, java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String[], boolean, java.lang.String), Docinfo.addDoclinks(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
      • addDocinfoAndLinks

        public MboSetRemote addDocinfoAndLinks(java.lang.String urlname,
                                               java.lang.String description,
                                               java.lang.String assetType,
                                               java.lang.String[] keyvalue,
                                               UserInfo userInfo)
                                        throws MXException,
                                               java.rmi.RemoteException
        Wrapper method, calls addDocinfoAndLinks assuming the following values, and forcing autokey.
        Attribute NameAttribute Value
        ApplicationIPC
        DocTypeRetrieved from Maxvars depending on value of keytable.
        • If assetType = "ITEM", maxvar = "IPCITEMDOCTYPE".
        • If assetType = "ASSET", maxvar = "IPCASSETDOCTYPE".
        • If assetType = "LOCATIONS", maxvar = "IPCLOCDOCTYPE".
        • Other values of assetType are currently not supported for this method.
        KeyTableEquals value of assetType.
        KeyColumnDepends on value of keytable.
        • If assetType = "ITEM", keycolumn = "ITEMNUM".
        • If assetType = "ASSET", keycolumn = "ASSETNUM".
        • If assetType = "LOCATIONS", keycolumn = "LOCATION".
        • Other values of assetType are currently not supported for this method.
        UrlParamnull
        UrlTypeWWW
        Specified by:
        addDocinfoAndLinks in interface DoclinkServiceRemote
        Parameters:
        urlname - Value for docinfo urlname. Required.
        description - Value for docinfo description.
        assetType - Identifier of what kind of asset the document pertains to. Required. Valid values are "ITEM", "ASSET", and "LOCATIONS".
        keyvalue - Array of values for doclinks keyvalue. If null, then no links are added. It is important to note that the values stored in this array must not include locale-specific formatting (i.e. if the keyvalue is numeric then the value supplied must not contain commas).
        userInfo - The user making the request.
        Returns:
        Docinfo set containing one Docinfo mbo and its related Doclinks.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        DoclinkService.addDocinfoAndLinks(String, String, String[], String, String, String, String, String[], boolean, String, UserInfo)
      • getTenantFolderPathRootAsEntered

        public static java.lang.String getTenantFolderPathRootAsEntered(java.lang.String path)
        Return the root folder name as in the relative path the tenant has entered. Null will be returned if the format is invalid. Or the string of \doclink, or /doclink will be returned.
        Parameters:
        path -
        Returns: