The values that you specify in the publish options XML for a publishing request override the publish options that are set in the associated publish template. The publish options that you can specify are the publication name for a new or republished document, the output folder name or ID into which the published document is filed, and the event action name or ID to trigger when the publish operation completes.
You pass in a string that represents the publish options XML as a parameter to the methods listed in the following table. If the parameter is null, the values for name, output folder, and event action default to those specified in the associated publish template.
Java™ | .NET |
---|---|
PublishRequest.setPublishOptions | IPublishRequest.SetPublishOptions |
Document.publish | IDocument.Publish |
Document.republish | IDocument.Republish |
In this example, the publication name and output folder are specified and are used instead of the values that are specified in the associated publish template. Because no event action is specified in the event action element, no event action is used even when there is one defined in the associated publish template. If the XML does not contain an event action element, then the event action in the publish template is used if present.
<?xml version="1.0"?>
<publishoptions>
<publicationname> My New Title</publicationname>
<!--output folder can be specified as an ID (GUID) by using the outputfolderid element-->
<outputfoldername>My Pubs Folder<outputfoldername>
<!--event action can be specified as an ID (GUID) by using the eventactionid element-->
<eventactionname></eventactionname>
</publishoptions>