Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.workplace.wcm.api
Class TreatAsNewCopyOption

    java.lang.Object
      com.ibm.workplace.wcm.api.TreatAsNewCopyOption

All Implemented Interfaces:
  CopyOption

    public class TreatAsNewCopyOption

extends java.lang.Object
implements CopyOption

This `CopyOption` is used to indicate that the copy should be treated as if a new item was being created. For instance, the creator, author and owner of the copied item will all be set to the given user, the creation date will set as the creation date of the 'new' item, rather than that of the copied item, and the published date will be updated if necessary. This is useful for complex site area and content creation scenarios, where creating a content from an authoring template is not sufficient. Instead, we want to create a whole branch of site areas and content, and treat these as new items. This option is effectively the same as applying the `ReplaceCreatorCopyOption`, `UpdatePublishedDateCopyOption` and optionally the `CopyIntoProjectOption`, as well as `ReplaceOwnersCopyOption`, `ReplaceAuthorsCopyOption` with one user specified. are also implicit for the user specified. So, there is no need to use these, unless you want to add further users during the copy.

Since:
  8.0.0.1 CF9

Constructor Summary
`TreatAsNewCopyOption(java.security.Principal user)` Constructor - create TreatAsNewCopyOption with a Java Security Principal
`TreatAsNewCopyOption(User user)` Constructor - create TreatAsNewCopyOption with a PUMA User

Method Summary
`java.lang.String` | `getProjectUuid()` Get the project id to which the item(s) will be copied.
`java.security.Principal` | `getUser()` Get the creating user to set as creator, author and owner of the copied item, if it has been set as a Java Security Principal, otherwise null
`java.lang.String` | `getUserAsString()` Get the creating user to set as creator, author and owner of the copied item, if it has been set as a String, otherwise null.
`void` | `setProjectUuid(java.lang.String projectUuid)` Set the project UUID to copy the item(s) into a project.
`User` | `user()` Get the creating user to set as creator, author and owner of the copied item, if it has been set as a PUMA user, otherwise null

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TreatAsNewCopyOption

    public TreatAsNewCopyOption(java.security.Principal user)

  Constructor - create TreatAsNewCopyOption with a Java Security Principal

  Parameters:
    `user` - the user to set as creator, author and owner of the copied item

### TreatAsNewCopyOption

    public TreatAsNewCopyOption(User user)

  Constructor - create TreatAsNewCopyOption with a PUMA User

  Parameters:
    `user` - the user to use

Method Detail

### setProjectUuid

    public void setProjectUuid(java.lang.String projectUuid)

  Set the project UUID to copy the item(s) into a project. If not set, the item(s) will not be copied into a project.

  Parameters:
    `projectUuid` - the project UUID to which the item(s) has to be copied into

### getProjectUuid

    public java.lang.String getProjectUuid()

  Get the project id to which the item(s) will be copied. If not set, the item(s) will not be copied into a project.

  Returns:
    the project UUID to which the item(s) has to be copied into

### getUser

    public java.security.Principal getUser()

  Get the creating user to set as creator, author and owner of the copied item, if it has been set as a Java Security Principal, otherwise null

  Returns:
    the user

### getUserAsString

    public java.lang.String getUserAsString()

  Get the creating user to set as creator, author and owner of the copied item, if it has been set as a String, otherwise null. Can be a user DN or CN, depending on setting in Workspace.useDistinguishedNames().

  Returns:
    the user

### user

    public User user()

  Get the creating user to set as creator, author and owner of the copied item, if it has been set as a PUMA user, otherwise null

  Returns:
    the user, if it has been set as a PUMA User, otherwise null

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD