Class RenameObject

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

public class RenameObject extends XMLRequest
Renames an existing UC4 Object.
  • Constructor Details

    • RenameObject

      @Deprecated public RenameObject(UC4ObjectName oldName, UC4ObjectName newName, IFolder folder)
      Deprecated.
      Use RenameObject(UC4ObjectName oldName, UC4ObjectName newName, IFolder folder, String title) instead
      Constructs a RenameObject. This constructor is used to rename UC4 Objects except folders. To rename a folder use the constructor RenameObject(IFolder oldName, UC4ObjectName newName).
      Parameters:
      oldName - Name of the UC4 Object which should be renamed.
      newName - New name
      folder - Folder containing the object
    • RenameObject

      public RenameObject(UC4ObjectName oldName, UC4ObjectName newName, IFolder folder, String title)
      Constructs a RenameObject. This constructor is used to rename UC4 Objects except folders. To rename a folder use the contructor RenameObject(IFolder oldName, UC4ObjectName newName).
      Parameters:
      oldName - Name of the UC4 Object which should be renamed.
      newName - New name
      folder - Folder containing the object
      title - New title of the object
    • RenameObject

      public RenameObject(IFolder oldName, UC4ObjectName newName)
      This constructor is used to rename folders.
      Parameters:
      oldName - Folder which should be renamed
      newName - New name of the folder
    • RenameObject

      public RenameObject(IFolder oldName, UC4ObjectName newName, String title)
      This constructor is used to rename folders.
      Parameters:
      oldName - Folder which should be renamed
      newName - New name of the folder
      title - New title of the folder
  • Method Details

    • setRenameIfUsed

      public void setRenameIfUsed(boolean renameIfUsed)
      The parameter renameIfUsed can be set to false to prevent objects from beeing renamend if they are used in other objects. The default behavior is to rename without searching for the use.
      Parameters:
      renameIfUsed - If set to false a message box is returned if the object is used.
    • setForceRename

      public void setForceRename()
      Method to rename the object forcefully.
    • 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
    • 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
    • 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
    • getReplaceRequest

      protected Element getReplaceRequest()
    • ignoreMessageBox

      protected boolean ignoreMessageBox()
      Overrides:
      ignoreMessageBox in class XMLRequest
    • 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