The values 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 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 representing the publish options XML as a parameter to the methods listed below. 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 will be used instead of the values 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>