Class DuplicateObject

java.lang.Object
com.uc4.communication.requests.XMLRequest
com.uc4.communication.requests.DuplicateObject

public class DuplicateObject extends XMLRequest
Duplicates an UC4 Object.
  • Constructor Details

    • DuplicateObject

      public DuplicateObject(UC4ObjectName name, UC4ObjectName newName, IFolder folder)
      Creates a new DuplicateObject request.
      Parameters:
      name - Name of the UC4 Object which should be duplicated
      newName - Name of the created copy
      folder - Destination folder
    • DuplicateObject

      public DuplicateObject(UC4Object object, UC4ObjectName newName, IFolder folder)
      Creates a new DuplicateObject request. This request closes the given UC4Object, duplicates its representation in the database and opens the duplicated object. The given UC4Object will be replaced by the duplicated. Be aware that changes made on the given UC4Object but not saved will not be duplicated. Therefore you have to save the duplicated object as well.
      Parameters:
      object - UC4 Object which should be duplicated
      newName - Name of the created copy
      folder - Destination folder
      Throws:
      IllegalArgumentException - if object is null
    • DuplicateObject

      public DuplicateObject(UC4ObjectName name, UC4ObjectName newName, IFolder folder, String title)
      Creates a new DuplicateObject request.
      Parameters:
      name - UC4 Object which should be duplicated
      newName - Name of the created copy
      folder - Destination folder
      title - Title for new object
  • Method Details

    • createRequest

      protected void createRequest(com.uc4.util.XMLDocument doc, 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
    • getSrc

      protected String getSrc()
      Description copied from class: XMLRequest
      Returns the request source. This method is used internally.
      Specified by:
      getSrc in class XMLRequest
      Returns:
      Source
    • 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
    • getID

      public String getID()
      Returns the ID (OH_IDNR) of the created object.
      Returns:
      ID of the Object or null if this request has not been sent or if the duplication failed
    • 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