Class OpenObject


  • public class OpenObject
    extends XMLRequest
    Opens an existing UC4 Object.
    • Constructor Detail

      • OpenObject

        public OpenObject​(UC4ObjectName name)
        Constructs a OpenObject using the specified UC4 Object name. The complete object is returned. The object can be modified.
        Parameters:
        name - name of the UC4 Object
      • OpenObject

        public OpenObject​(UserListItem user)
        Opens a user object based on an entry in the user list of the system overview.
        Parameters:
        user - Item of the user list
      • OpenObject

        public OpenObject​(UC4ObjectName name,
                          boolean readOnly,
                          boolean fullObject)
        Constructs a OpenObject using the specified UC4 Object name. The parameter readOnly is used to open the object read only.
        Parameters:
        name - name of the UC4 Object
        readOnly - true if the object should be opened read only
        fullObject - true if the complete object should be returned.
    • Method Detail

      • getSrc

        protected java.lang.String getSrc()
        Description copied from class: XMLRequest
        Returns the request source. This method is used internally.
        Specified by:
        getSrc in class XMLRequest
        Returns:
        Source
      • getUC4Object

        public UC4Object getUC4Object()
        Returns a subclass of UC4Object or null if the object could not be opened or is not supported.

        Note: Each object may only be opened once. Subsequent calls to OpenObject will return null here. The object has to be closed with an CloseObject request before another OpenObject request will succeed.

        Returns:
        subclass of UC4Object
      • getType

        public java.lang.String getType()
        Returns the type of the object.
        Returns:
        String containing the type of the uc4 object
      • createRequest

        protected void createRequest​(com.uc4.util.XMLDocument doc,
                                     org.w3c.dom.Element request,
                                     ConnectionAttributes sessionInfo)
        Description copied from class: XMLRequest
        Creates the XML Document for the request. This method is used internally.
        Specified by:
        createRequest in class XMLRequest
        Parameters:
        doc - Document, used to create new Elements
        request - Request Element - classes append information to this request element
        sessionInfo - Information about the session
      • handleContent

        protected void handleContent​(com.uc4.util.XMLDocument doc,
                                     ConnectionAttributes session)
        Description copied from class: XMLRequest
        Sub classes extract the values from the XML document and provide public getter methods.
        Overrides:
        handleContent in class XMLRequest
        Parameters:
        doc - XML Document
        session - Info about the user session
      • getObjectForType

        protected UC4Object getObjectForType​(java.lang.String oType,
                                             com.uc4.util.XMLDocument doc)
        Returns a sub class of UC4Object for the specified type. Sub classes may override this method.
        Parameters:
        oType - Object type
        Returns:
        Instane of UC4Object or null if the type is not implemented
      • isAllowedInClientZero

        protected boolean isAllowedInClientZero()
        Description copied from class: XMLRequest
        This method is used internally. Tests if this XMLRequest is allowed in client 0. The default implementation returns false, subclasses may override.
        Overrides:
        isAllowedInClientZero in class XMLRequest
        Returns:
        true if this request is allowed in client 0, false otherwise