Documentation Center

IPublishPostProcessPlugin - IshCopyToShare

Copies and renames the file on the filesystem that are present in the Items collection.

Plugin Input

Plugin configuration parameters
ParameterRequiredDefault valueAllowed valuesDescription
FullPathToCopyFileContextItemsKeyYes Valid key name, present in items collectionItem containing the path to the file that should be copied.
DestinationDirectoryYes Valid path to folderSpecifies the full path to the folder where the file should be copied.
DestinationFileContextItemKeyYesThe name of key of output parameter to be added to Items collectionThe output value with the full path to copied file will be added to the context.Items collection and assigned to this key.
MinimumFileTitleLengthNo10Valid integer number which must not exceed 20Specifies the minimum length of title that must remain in the name of file after renaming.
MaximumFileNameLengthNo160Valid integer number which must not exceed 160Specifies the maximum length of name of file after renaming.

Plugin Outcome

Changes made to the file system:

  • New file created.
Values set in the context.Items collection as a result
Item KeyTypical ValueItem Value TypeDescription
The name of key is specified in the input parameter DestinationFileContextItemKey StringThe full path to copied file.

plugin name="ISHCOPYTOSHARE" example


<plugin name="ISHCOPYTOSHARE" handler="IshCopyToShare">
  <description>This plugin copies and renames the file on the filesystem that are present in the Items collection.</description>
  <initialize>
    <parameters>
      <parameter name="FullPathToCopyFileContextItemsKey">FullPathToCopyFile</parameter>
      <parameter name="DestinationFileContextItemKey">DestinationFilePath</parameter>
      <parameter name="DestinationDirectory">c:\temp</parameter>
      <parameter name="MinimumFileTitleLength">15</parameter>
      <parameter name="MaximumFileNameLength">160</parameter>
    </parameters>
  </initialize>
</plugin>    

			

Plugin flow

  • The IshCopyToSharePlugin copies and renames the file given in the FullPathToCopyFileContextItemsKey to folder specified in DestinationDirectory .
  • The value of the MinimumFileTitleLength parameter is the minimum length of title that must remain in the file name after file renaming.
  • The value of the MaximumFileNameLength parameter is the maximum length of name of file after renaming.
  • The FullPathToCopyFileContextItemsKey parameter can be a string containing only one path to file that should be copied.
  • The path to the copied file will be written to the Items collection with the corresponding key, which is specified in the parameter DestinationFileContextItemKey