CopyDocumentPack

Use the command CopyDocumentPack to create a copy of the active Document Pack. Optionally, you can filter slots and channels while copying.

The command CopyDocumentPack fails if no active Document Pack exists in the session or if there is already an object with the indicated name in the session directory.

Syntax

CopyDocumentPack
	   NewName (<text>)
	   Switch (True or False);
    ExcludeSlots (<text>)
    IncludeSlots (<text>)
    Channel (<text>)
    Prune (True or False);

Parameters

  • NewName: Required. Specifies the name for the directory in the session directory that will contain the contents of the Document Pack. The name must be limited to the characters A-Z, a-z, 0-9, underscores, and dots.
  • Switch: Optional. Indicates whether the copy of the Document Pack should be made active instead of the current active Document Pack. Default is False.
  • ExcludeSlots: Optional. Comma-separated list of slots in the Document Pack that are not copied if they are present in the active Document Pack. If this parameter is omitted or empty, all slots are copied.

  • IncludeSlots: Optional. Comma-separated list of slots in the Document Pack that are copied if they are present in the active Document Pack. If this parameter is omitted or empty, all slots are copied.
  • Channel: Optional. Name of the channel that is copied from the active Document Pack. If this parameter is omitted or empty, all channels are copied. You can use the special value *default to copy the default channel. if the specified channel is not included in the Document Pack, the default channel will be copied instead.
  • Prune: Optional. Indicates whether files from the active Document Pack that are not associated with a slot or channel are copied. If this parameter is set to False, all objects are copied and only the manifest for the copy is updated. Default is True.

The following applies when using the filters:

  • If the ExcludeSlots, IncludeSlots, and Channel filters are omitted, the command CopyDocumentPack creates a full copy of the content in the Document Pack, and the Prune option is ignored. If any of the options is used, the appropriate filter is applied. Optionally, all files that are not referenced in the manifest.xml file are removed from the copy.
  • The ExcludeSlots option overrides the IncludeSlots option. Slots listed in the ExcludeSlots option are always excluded from the copy.
  • If the Channel parameter is used, the named channel becomes the default channel in the copied Document Pack. If a slot in the active Document Pack does not have a document for the named channel, the slot is excluded from the Document Pack.

    For the Document Packs Version 1, if a slot in the active Document Pack does not have a document for the named channel, the document for the default channel is copied.

If the copy is not activated immediately, you can activate it later with the command CreateDocumentPack (see CreateDocumentPack).

When required slots are removed from the Document Pack after filtering the content with the described options, the Document Pack no longer complies with the definition of the Document Pack Template. Therefore, any operations that update the manifest.xml file, such as CopyDocumentPack and SaveDocumentPack, fail and an error is shown.

Also, you cannot submit filtered Document Packs to KCM ComposerUI for interactive modification.