Interface CopyCommand


public interface CopyCommand
Command for copy fields action
Since:
3.10.0
  • Method Details

    • includeFields

      @NotNull CopyCommand includeFields(@Nullable Iterable<String> includedFields)
      Set list of included fields for copy.
      Only those fields will be copied.
    • excludeFields

      @NotNull CopyCommand excludeFields(@Nullable Iterable<String> excludedFields)
      Set list of excluded fields for copy.
      All other fields will be copied.
    • skipDeniedFields

      @NotNull CopyCommand skipDeniedFields(boolean value)
      If value is set to true the fields are checked if the user has permission READ and MODIFY.
      Those fields will not be merged and will be returned in CopyResult.notCopiedFields()

      Default value is false
      Parameters:
      value -
      Returns:
      this
    • skipReadOnlyFields

      @NotNull CopyCommand skipReadOnlyFields(boolean value)
      If value is set to true the fields will be checked if are not read-only (not per-field permissions).
      It depends on the selected view in UI.
      Those fields will not be merged and will be returned in CopyResult.notCopiedFields()

      Default value is false
      Parameters:
      value -
      Returns:
      this
    • includeAllCustomFields

      @NotNull CopyCommand includeAllCustomFields(boolean value)
      If value is set to true all custom fields will be copy even though they are in excluded fields

      Default value is false
      Parameters:
      value -
      Returns:
      this
    • saveTargetObject

      @NotNull CopyCommand saveTargetObject(boolean value)
      Whether UpdatableModelObject.save() is called on the target object after the fields are copied. Default value is true.
      Since:
      3.20.2
    • execute

      @NotNull CopyResult execute()
      Execute copy action.
      If skipDeniedFields(boolean) was not called with true exception com.polarion.platform.security.PermissionDeniedException may be thrown

      If includeFields(Iterable) or excludeFields(Iterable) was not called before, all fields will be copied.
      Returns:
      CopyResult where informations about executed copy action are stored