com.ibm.openpages.api.trigger.events

## Class CopyResourceEvent

- java.lang.Object
- - com.ibm.openpages.api.trigger.events.AbstractEvent
  - - com.ibm.openpages.api.trigger.events.AbstractResourceOperationEvent
    - - com.ibm.openpages.api.trigger.events.CopyResourceEvent

-     public class CopyResourceEvent
      extends AbstractResourceOperationEvent

  Represents the event type to copy resource objects. Copy events have a source Id for the original resource object to be copied, a target Id for the targeted new parent location for the copy and a destination name which is the name to be provided to the copy.

  The target Id may represent either a folder resource or a GRC object. Use the isFolderCopy() method to test if the target will be a folder or GRC object parent. If the target is a GRC object the copy of the source is made as a child of the target parent. Otherwise if copying the resource to a target folder the copy of the source is created as a new resource in the target folder.

  See Also:
    `and TriggerEventType#COPY_OBJECTS`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CopyResourceEvent(Id sourceId, Id targetId, java.lang.String destinationName, TriggerPositionType position, Context context)`
    `CopyResourceEvent(Id sourceId, Id targetId, TriggerPositionType position, Context context)`
    `CopyResourceEvent(TriggerPositionType position, Context context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<ITypeDefinition>` | `getChildrenTypesToCopy()` Gets the children Object Types to be copied.
    `CopyConflictBehavior` | `getConflictBehavior()` Gets the conflict resolution behavior for this copy operation.
    `Id` | `getCopiedObjectId()` Returns the Id of the copied object in this event.
    `java.lang.String` | `getDestinationName()` Returns the destination name for the copied resource for this event.
    `Id` | `getSourceResouceId()` Returns the source Id for the object to be copied in this event.
    `Id` | `getTargetResourceId()` The target Id for the destination of where the source is to be copied to in this event.
    `boolean` | `isFolderCopy()` Returns whether this event represents a copy to a folder or to a parent GRC object.
    `boolean` | `isIncludeChildren()` Specifies if the copy operation includes children associated with the object being copied.

    - ### Methods inherited from class com.ibm.openpages.api.trigger.events.AbstractEvent

      `getContext, getPosition, getTriggerEventType, hasOuterCreateWithRelationsEvent`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CopyResourceEvent

          public CopyResourceEvent(TriggerPositionType position,
                                   Context context)

    - #### CopyResourceEvent

          public CopyResourceEvent(Id sourceId,
                                   Id targetId,
                                   TriggerPositionType position,
                                   Context context)

    - #### CopyResourceEvent

          public CopyResourceEvent(Id sourceId,
                                   Id targetId,
                                   java.lang.String destinationName,
                                   TriggerPositionType position,
                                   Context context)

  - ### Method Detail

    - #### getCopiedObjectId

          public Id getCopiedObjectId()

      Returns the Id of the copied object in this event. Only available in the POST position. Only support 'copy.objects' event. For 'copy.object' event, will return null.
      Returns:
        the copied resource's Id

    - #### getSourceResouceId

          public Id getSourceResouceId()

      Returns the source Id for the object to be copied in this event.
      Returns:
        the source resource's Id

    - #### getTargetResourceId

          public Id getTargetResourceId()

      The target Id for the destination of where the source is to be copied to in this event. This Id may be for a IFolder resource or an IGRCObject resource.
      Returns:
        the target resource's Id

    - #### getDestinationName

          public java.lang.String getDestinationName()

      Returns the destination name for the copied resource for this event.
      Returns:
        name of the copied resource if being changed, may be null if not changed by this copy operation event.

    - #### getConflictBehavior

          public CopyConflictBehavior getConflictBehavior()

      Gets the conflict resolution behavior for this copy operation.
      Returns:
        the conflict behavior

    - #### getChildrenTypesToCopy

          public java.util.List<ITypeDefinition> getChildrenTypesToCopy()

      Gets the children Object Types to be copied.
      Returns:
        the inclusive list of Object Types to include in the copy.objects event.

    - #### isIncludeChildren

          public boolean isIncludeChildren()

      Specifies if the copy operation includes children associated with the object being copied.
      Returns:
        true if the copy operation includes children associated with the object being copied, otherwise return false.

    - #### isFolderCopy

          public boolean isFolderCopy()

      Returns whether this event represents a copy to a folder or to a parent GRC object.
      Returns:
        true if the target resource id is for a folder

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2021. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.