Class Acl

java.lang.Object
com.arbortext.epic.Acl

public class Acl extends Object
The Acl interface represents the ACL (Arbortext Command Language) interpreter. It allows the Java programmer to request that a string be executed as an ACL command or evaluated as an ACL function.
Since:
Epic 3.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Acl()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Document
    DOMDocument(long docId)
    Returns the DOM Document object corresponding to an Arbortext document ID.
    static Document
    Returns the DOM Document object corresponding to an Arbortext document ID.
    static Node
    DOMOID(String OIDString)
    Returns the DOM Node associated with the supplied ACL object identifier oid.
    static String
    This generates a doubly-quoted string (") and escapes \, ", and $.
    static String
    eval(String function)
    Evaluates a string as an ACL expression and returns the result of the evaluation as a string.
    static boolean
    execute(String command)
    Executes a string as an ACL command.
    static String
    func(String name)
    A convenience method for the eval method that accepts an ACL function name for the function and assembles the function name and the "()" into a single string.
    static String
    func(String name, String arg)
    A convenience method for the eval method that accepts an ACL function name and an argument for the function and assembles the function name and the argument into a single string.
    static String
    func(String name, String... args)
    A convenience method for the eval method that accepts an ACL function name and any number of arguments for the function and assembles the function name and the arguments into a single string.
    static String
    func(String name, String arg1, String arg2)
    A convenience method for the eval method that accepts an ACL function name and two arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3)
    A convenience method for the eval method that accepts an ACL function name and three arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4)
    A convenience method for the eval method that accepts an ACL function name and four arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5)
    A convenience method for the eval method that accepts an ACL function name and five arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6)
    A convenience method for the eval method that accepts an ACL function name and six arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7)
    A convenience method for the eval method that accepts an ACL function name and seven arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8)
    A convenience method for the eval method that accepts an ACL function name and eight arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9)
    A convenience method for the eval method that accepts an ACL function name and nine arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9, String arg10)
    A convenience method for the eval method that accepts an ACL function name and ten arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9, String arg10, String arg11)
    A convenience method for the eval method that accepts an ACL function name and eleven arguments for the function and assembles the function name and arguments into a single string.
    static String
    func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9, String arg10, String arg11, String arg12)
    A convenience method for the eval method that accepts an ACL function name and twelve arguments for the function and assembles the function name and arguments into a single string.
    static CMSObject
    getCMSObject(long objectId)
    Returns a CMSObject object equivalent to the given ACL dobj id.
    static CMSObject
    getCMSObject(String objectId)
    Returns a CMSObject object equivalent to the given ACL dobj id.
    static CMSSession
    getCMSSession(long sessionId)
    Returns the CMSSession object associated with the given ACL session id.
    static CMSSession
    getCMSSession(String sessionId)
    Returns the CMSSession object associated with the given ACL session id.
    static Document
    getDOMDocument(long docId)
    Returns the DOM Document object corresponding to an Arbortext document ID.
    static Document
    Returns the DOM Document object corresponding to an Arbortext document ID.
    static Node
    getDOMOID(String OIDString)
    Returns the DOM Node associated with the supplied ACL object identifier oid.
    static String
    Deprecated.
    As of Epic 4.0, replaced by getFirstOID in ANode.
    static String
    Deprecated.
    As of Epic 4.0, replaced by getLastOID in ANode.
    static String
    getVar(String name)
    Returns the value of an ACL scalar variable as a string.
    static Window
    getWindow(long winId)
    Returns the AOM Window object corresponding to an Arbortext window ID.
    static Window
    Returns the AOM Window object corresponding to an Arbortext window ID.
    static void
    setVar(String name, String value)
    Sets the value of an ACL scalar variable to the specified string.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Acl

      public Acl()
  • Method Details

    • getDOMDocument

      public static Document getDOMDocument(String docId) throws NumberFormatException
      Returns the DOM Document object corresponding to an Arbortext document ID. The desired document must be open in Editor or PE before calling this method, but the document does not need to be visible in a window. Developers can obtain the document identifier they need by using the eval method to call an ACL function such as current_doc.
      Parameters:
      docId - The ACL document identifier of a document. If zero (0), the method uses the returned value of the ACL function current_doc.
      Returns:
      The DOM Document object.
      Throws:
      NumberFormatException - Raised if the docId does not contain a parsable long.
      Since:
      Epic 3.0
    • getDOMDocument

      public static Document getDOMDocument(long docId)
      Returns the DOM Document object corresponding to an Arbortext document ID. The desired document must be open in Editor or PE before calling this method, but the document does not need to be visible in a window. Developers can obtain the document identifier they need by using the eval method to call an ACL function such as current_doc.
      Parameters:
      docId - The ACL document identifier of a document. If zero (0), the method uses the returned value of the ACL function current_doc.
      Returns:
      The DOM Document object.
      Since:
      Epic 5.2
    • DOMDocument

      public static Document DOMDocument(String docId) throws NumberFormatException
      Returns the DOM Document object corresponding to an Arbortext document ID. The desired document must be open in Editor or PE before calling this method, but the document does not need to be visible in a window. Developers can obtain the document identifier they need by using the eval method to call an ACL function such as current_doc.
      Parameters:
      docId - The ACL document identifier of a document. If zero (0), the method uses the returned value of the ACL function current_doc.
      Returns:
      The DOM Document object.
      Throws:
      NumberFormatException - Raised if the docId does not contain a parsable long.
      Since:
      Epic 4.4
    • DOMDocument

      public static Document DOMDocument(long docId)
      Returns the DOM Document object corresponding to an Arbortext document ID. The desired document must be open in Editor or PE before calling this method, but the document does not need to be visible in a window. Developers can obtain the document identifier they need by using the eval method to call an ACL function such as current_doc.
      Parameters:
      docId - The ACL document identifier of a document. If zero (0), the method uses the returned value of the ACL function current_doc.
      Returns:
      The DOM Document object.
      Since:
      Epic 5.2
    • getWindow

      public static Window getWindow(String winId) throws NumberFormatException
      Returns the AOM Window object corresponding to an Arbortext window ID. Developers can obtain the window identifier they need by using the eval method to call an ACL function such as current_window.
      Parameters:
      winId - The ACL window identifier of a window. If zero (0), the method uses the returned value of the ACL function current_window.
      Returns:
      The AOM Window object.
      Throws:
      NumberFormatException - Raised if the winId does not contain a parsable long.
      Since:
      Epic 4.3
    • getWindow

      public static Window getWindow(long winId)
      Returns the AOM Window object corresponding to an Arbortext window ID. Developers can obtain the window identifier they need by using the eval method to call an ACL function such as current_window.
      Parameters:
      winId - The ACL window identifier of a window. If zero (0), the method uses the returned value of the ACL function current_window.
      Returns:
      The AOM Window object.
      Since:
      Epic 5.2
    • getDOMOID

      public static Node getDOMOID(String OIDString)
      Returns the DOM Node associated with the supplied ACL object identifier oid.
      This method is useful for creating a DOM node object from a portion of a document instead of the entire document. The desired document must be open in Editor or PE before calling this method. The object identifier oid can be obtained by using the eval method to call an ACL function such as oid_caret.
      Parameters:
      OIDString - The ACL object identifier.
      Returns:
      The DOM Node object. If OIDString is invalid, returns null.
      Since:
      Epic 3.0
    • DOMOID

      public static Node DOMOID(String OIDString)
      Returns the DOM Node associated with the supplied ACL object identifier oid.
      This method is useful for creating a DOM node object from a portion of a document instead of the entire document. The desired document must be open in Editor or PE before calling this method. The object identifier oid can be obtained by using the eval method to call an ACL function such as oid_caret.
      Alias of getDOMOID.
      Parameters:
      OIDString - The ACL object identifier.
      Returns:
      The DOM Node object. If OIDString is invalid, returns null.
      Since:
      Epic 3.0
    • execute

      public static boolean execute(String command) throws AclException
      Executes a string as an ACL command. The return value varies depending on the interface.
      Variable substitution in the expression string occurs on the ACL side of the AOM interface, not on the client side. You can include ACL variables in the expression string. However, do not include variables native to the client program.
      Parameters:
      command - The ACL command to execute.
      Returns:
      This method always returns true.
      Throws:
      AclException - SYNTAX_ERR: Raised if the command has syntax errors. RUNTIME_ERR: Raised if a problem occurred during executing the command.
      Since:
      Epic 3.0
    • eval

      public static String eval(String function) throws AclException
      Evaluates a string as an ACL expression and returns the result of the evaluation as a string. The string to evaluate must contain an expression. For example:2+2 or tbl_oid_cell(oid_caret(),oid_caret_pos())
      Variable substitution in the expression string occurs on the ACL side of the AOM interface, not on the client side. You can include ACL variables in the expression string. However, do not include variables native to the client program.
      Parameters:
      function - The ACL expression to evaluate.
      Returns:
      The result of the evaluated expression as a string.
      Throws:
      AclException - RUNTIME_ERR: Raised if a problem occurred during executing the function.
      Since:
      Epic 3.0
    • escapeString

      public static String escapeString(String value)
      This generates a doubly-quoted string (") and escapes \, ", and $. This also escapes character whose value is less than 32. Escaping $ prevents a sequence like $p from being treated like a variable reference. Escaping low-valued characters avoids breaking a string onto multiple lines (in the case of a newline) which would cause it to fail in ACL. We purposefully avoid using a single-quote because, for example it is impossible to represent the single-character string \ as a single-quoted string.
      Parameters:
      value - String to quote.
      Returns:
      Doubly-quoted string containing the given string.
    • func

      public static String func(String name, String... args)
      A convenience method for the eval method that accepts an ACL function name and any number of arguments for the function and assembles the function name and the arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name)
      A convenience method for the eval method that accepts an ACL function name for the function and assembles the function name and the "()" into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg)
      A convenience method for the eval method that accepts an ACL function name and an argument for the function and assembles the function name and the argument into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2)
      A convenience method for the eval method that accepts an ACL function name and two arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3)
      A convenience method for the eval method that accepts an ACL function name and three arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4)
      A convenience method for the eval method that accepts an ACL function name and four arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5)
      A convenience method for the eval method that accepts an ACL function name and five arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6)
      A convenience method for the eval method that accepts an ACL function name and six arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7)
      A convenience method for the eval method that accepts an ACL function name and seven arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8)
      A convenience method for the eval method that accepts an ACL function name and eight arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9)
      A convenience method for the eval method that accepts an ACL function name and nine arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9, String arg10)
      A convenience method for the eval method that accepts an ACL function name and ten arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9, String arg10, String arg11)
      A convenience method for the eval method that accepts an ACL function name and eleven arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • func

      public static String func(String name, String arg1, String arg2, String arg3, String arg4, String arg5, String arg6, String arg7, String arg8, String arg9, String arg10, String arg11, String arg12)
      A convenience method for the eval method that accepts an ACL function name and twelve arguments for the function and assembles the function name and arguments into a single string. The eval method is then called with the string. This method returns the return value of the eval call.
    • getFirstOIDFromNode

      @Deprecated public static String getFirstOIDFromNode(Node node)
      Deprecated.
      As of Epic 4.0, replaced by getFirstOID in ANode.
      See Also:
    • getLastOIDFromNode

      @Deprecated public static String getLastOIDFromNode(Node node)
      Deprecated.
      As of Epic 4.0, replaced by getLastOID in ANode.
      See Also:
    • getCMSObject

      public static CMSObject getCMSObject(String objectId) throws NumberFormatException
      Returns a CMSObject object equivalent to the given ACL dobj id.
      Parameters:
      objectId - Represents a valid ACL object id.
      Returns:
      CMSObject object equivalent to the given ACL dobj id.
      null will be returned if the given ACL dobj id is invalid.
      Throws:
      NumberFormatException - Raised if the objectId does not contain a parsable long.
      Since:
      Epic 5.2
    • getCMSObject

      public static CMSObject getCMSObject(long objectId)
      Returns a CMSObject object equivalent to the given ACL dobj id.
      Parameters:
      objectId - Represents a valid ACL object id.
      Returns:
      CMSObject object equivalent to the given ACL dobj id.
      null will be returned if the given ACL dobj id is invalid.
      Since:
      Epic 5.2
    • getCMSSession

      public static CMSSession getCMSSession(String sessionId) throws NumberFormatException
      Returns the CMSSession object associated with the given ACL session id.
      This does not support the default (file-system) session id value of 0.
      Parameters:
      sessionId - Represents an active ACL session id.
      Returns:
      CMSSession object associated with the given ACL session id.
      null will be returned if the given ACL session id is invalid.
      Throws:
      NumberFormatException - Raised if the sessionId does not contain a parsable long.
      Since:
      Epic 5.2
    • getCMSSession

      public static CMSSession getCMSSession(long sessionId)
      Returns the CMSSession object associated with the given ACL session id.
      This does not support the default (file-system) session id value of 0.
      Parameters:
      sessionId - Represents an active ACL session id.
      Returns:
      CMSSession object associated with the given ACL session id.
      null will be returned if the given ACL session id is invalid.
      Since:
      Epic 5.2
    • getVar

      public static String getVar(String name)
      Returns the value of an ACL scalar variable as a string.
      Parameters:
      name - The name of the ACL variable to retrieve. If the variable is not qualified with a package name, the main package is used.
      Returns:
      The value of the specified ACL variable as a string.
      Since:
      Epic 5.2
    • setVar

      public static void setVar(String name, String value) throws AOMException
      Sets the value of an ACL scalar variable to the specified string.
      Parameters:
      name - The name of the ACL variable to set. If the variable is not qualified with a package name, themain package is used.
      value - The new value for the ACL variable. There are no size limits (beyond available memory) on the length of the string.
      Throws:
      AOMException
      Since:
      Epic 5.2