com.ibm.openpages.api.application

Class CopyObjectOptions

  • java.lang.Object
    • com.ibm.openpages.api.application.CopyObjectOptions


  • public class CopyObjectOptions
    extends java.lang.Object

    Allows you to configure options in IApplicationService.copyToParent(com.ibm.openpages.api.metadata.Id, List, CopyObjectOptions) operations. You can specify whether to include children in the copy and specify an explicit list of child Object Types to be copied. You can also define the actions to take when a naming conflict occurs as a result of the copy.

    When the includeChildren flag is set to true (default), then the ChildrenTypeToCopy list will determine which Object Types are copied. The default is that all types will be copied.

    When the autoNameChildren flag is set to true, based on their Auto-Named/Copied Object OpenPages registry value the children associated with the object being copied are auto named. The default is false.

    When the inclAssociationForReturnObjs flag is set to NONE (default), no associations (Child and Parent) will be included on the returned GRCObjects.

    • Constructor Detail

      • CopyObjectOptions

        public CopyObjectOptions()
        Creates the CopyObjectOptions with default settings: includeChildren = true
        - The children types are not explicitly defined and all primary children are copied.
        - If conflicts exist, it will use Copy Of prefix behavior to rename the copies.
    • Method Detail

      • 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 copyToParent operation
      • setChildrenTypesToCopy

        public void setChildrenTypesToCopy(java.util.List<ITypeDefinition> childrenTypesToCopy)

        Explicit list of Object Types to include in the copyToParent operation, if isIncludeChildren is true. If specified, only the primary children whose type matches those in the specified list will be copied to the target parent location. An empty list means all types are copied.

        If this is not specified, then it is assumed that all primary children will be copied.

        It is not required to add the object type for the object being copied.

        Parameters:
        childrenTypesToCopy - (required) the complete list to set. If the list is empty, then all types will be copied. Copy will default to all.
      • isIncludeChildren

        public boolean isIncludeChildren()
        Specifies if the copy operation includes children associated with the object being copied. If true (default), then the list of types specified will be used to determine which children are included. If false, then children are not copied.
        Returns:
        the includeChildren objects
      • setIncludeChildren

        public void setIncludeChildren(boolean includeChildren)
        Sets whether the copy operation will include children associated with the object being copied. If true (default), then the list of types specified will be used to determine which children are included. If false, then children are not copied.
        Parameters:
        includeChildren - (required) the includeChildren to set
      • addChildrenType

        public void addChildrenType(ITypeDefinition objectType)

        Adds a single Object Type to the explicit list of Object Types to include in the copyToParent operation.

        It is not required to add the object type for the object being copied.
        Parameters:
        objectType - (required) object type to include in the copyToParent operation
      • getInclAssociationForReturnObjs

        public IncludeAssociations getInclAssociationForReturnObjs()
        Gets the association filter value for returned GRCObjects.
        Returns:
        the inclAssociationForReturnObjs value
      • setInclAssociationForReturnObjs

        public void setInclAssociationForReturnObjs(IncludeAssociations inclAssociationForReturnObjs)

        Specifies the associations to be included on returned GRCObjects by the copy operation.

        Possible options include:

        1. NONE (default) - no associations (Child and Parent) will be included on the returned GRCObjects.
        2. PARENT - only Parent associations will be included on the returned GRCObjects.
        3. CHILD - only Child associations will be included on the returned GRCObjects.
        4. BOTH - all associations (Child and Parent) will be included on the returned GRCObjects.
        Parameters:
        inclAssociationForReturnObjs - (required) the association filter for returned GRCOBjects to set
        See Also:
        IncludeAssociations.
      • getConflictBehavior

        public CopyConflictBehavior getConflictBehavior()
        Gets the conflict resolution behavior for this copy operation.
        Returns:
        the conflictBehavior
      • setConflictBehavior

        public void setConflictBehavior(CopyConflictBehavior conflictBehavior)

        Specifies the behavior of the copy operation when a GRCObject with the same name already exists at the location.

        Possible options include:

        1. CREATECOPYOF (default) - creates the copy at the destination with a name prefix of 'Copy of' or 'Copy (n) of'.
        2. ERROR - throws Exception.
        3. OVERWRITE - overwrites GRCObject at destination with one being copied.
        4. USEEXISTING - keeps the GRCObject at the destination.
        Parameters:
        conflictBehavior - (required) the conflictBehavior to set
        See Also:
        CopyConflictBehavior.
      • getDefaultOptions

        public static CopyObjectOptions getDefaultOptions()
        Constructs a new instance of CopyObjectOptions with default parameters:
        - includeChildren = true
        - ChildrenTypesToCopy = ALL
        - conflictBehavior = CopyConflictBehavior.CREATECOPYOF
        Returns:
        a default instance of CopyObjectOptions
      • addTypeAssociationToHonor

        public void addTypeAssociationToHonor(TypeAssociationToHonor typeAssociationToHonor)
        Add a single TypeAssociationToHonor object that need to be honored during the copy operation
        Parameters:
        typeAssociationToHonor -
        Since:
        8.0.0.1
      • isAutoNameChildren

        public boolean isAutoNameChildren()
        Specifies if the copy operation auto name children associated with the object being copied. Default: false. Children associated with the object being copied is auto named only if:
        1. isAutoNameChildren() returns true.
        2. Auto-Named/Copied Object OpenPages registry value is true for the child object type
        Returns:
        the autoNameChildren flag
        Since:
        8.0.0.1
      • setAutoNameChildren

        public void setAutoNameChildren(boolean autoNameChildren)
        Sets whether the copy operation auto name children associated with the object being copied. Default: false. Children associated with the object being copied is auto named only if:
        1. isAutoNameChildren() returns true.
        2. Auto-Named/Copied Object OpenPages registry value is true for the child object type
        Parameters:
        autoNameChildren - flag
        Since:
        8.0.0.1
      • getNameOverrides

        public java.util.Map<Id,java.lang.String> getNameOverrides()
        Specifies a name to set on the copy of each Id. If no name override is provided for an Id the default system behavior is used to choose a name based on autonaming and copy settings.
        Returns:
        the mapping of Ids to names that will be set on their copies
        Since:
        8.2.0.0
      • setNameOverrides

        public void setNameOverrides(java.util.Map<Id,java.lang.String> nameOverrides)
        Optionally specifies an explicit name to set on the copy of each Id. If no name override String value is provided for an Id in the map then the default system behavior is used to choose a name based on autonaming and copy settings.
        Parameters:
        nameOverrides - the mapping of Ids to names that will be set on their copies. Note that the names provided must have the platform designed file type extension e.g. .txt
        Since:
        8.2.0.0

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.