Publish

Build 1501 on 14/Nov/2017  This topic last edited on: 22/Mar/2016, at 17:02

Description

Publish/unpublish objects, and more generally, modify the contents of a publishing destination.

Parameters (* denotes an optional parameter)

Id* (Optional - use when there is no publishing destination path or Ids parameters specified)

This parameter, specified as an integer, defines the database id of the publishing destination to modify. Use when modifying a single publishing destination.

Ids* (Optional - use when there is no Id or publishing destination path parameters specified)

This parameter, specified as a comma separated string is used as an alternative to the 'Id' parameter. It contains the database ids of the publishing destinations to modify. Use this parameter when modifying  multiple destinations. It can also be used with a single destination.

PubDest* (Optional - use with there is no publishing destination Id or Ids specified)

Path of the publishing destination to modify, as a string, (used when there is no explicit publishing destination id)

PubCmd

A complete description of the modifications to apply to the publishing destination content, encoded as a single string.

See: http://tech.teradp.com/tech/html/gn4/docs/VSdoc/frlrfTeraDPGN4GNClientPublishCmdClassTopic_members--.html

Progress*

This optional parameter specifies the workflow progress display mode. It defines how to display the progress of the execution of the workflow(s) triggered by the publishing/unpublishing operations. The options are: Ctrl, No, Txt, Xml. The default is 'No' = no progress display

Example of progress displayed as xml:

http://gnhost.teradp.com/MyPortal/do.ashx?cmd=publish&pubcmd=aids:1725&pubdest=/Image&progress=xml

 

<?xml version="1.0" encoding="utf-8" ?>

<result

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns="http://www.teradp.com/schemas/GN4/1/Results.xsd">

 <wfResult>

   <log code="0" message="Activity 'createVariants': created variant of type 'ImageJpeg' for object with id 82649" />

   <log code="0" message="Activity 'createVariants': created variant of type 'jpg-100' for object with id 82649" />

   <log code="0" message="Activity 'createVariants': created variant of type 'jpg-400' for object with id 82649" />

   <log code="0" message="Saved variant to: 'C:\Export\Feeds\Image\image_10010118231743_ImageJpeg.jpg'" />

   <log code="0" message="Saved variant to: 'C:\Export\Feeds\Image\image_10010118231743_jpg-100.jpg'" />

   <log code="0" message="Saved variant to: 'C:\Export\Feeds\Image\image_10010118231743_jpg-400.jpg'" />

 </wfResult>

</result>

 

Example of progress displayed as txt:

http://gnhost.teradp.com/MyPortal/do.ashx?cmd=publish&pubcmd=aids:1725&pubdest=/Image&progress=txt

Executing LoadObjects 'loadObjectXml'
.done
Executing LoadData 'loadObjectData'
.done
Executing Variant 'createVariants'
.done
Executing Log 'logVariantCreate'
.done
Executing Variant 'loadVariant'
.done
Executing LoadObjects 'loadObjWithVariants'
.done
Executing TransformXml 'computeVariantFileName'
.done
Executing Save 'saveVariants'
.done
Published object(s) with id(s) 82639.
<INFO> Activity 'createVariants': created variant of type 'ImageJpeg' for object with id 82639
<INFO> Activity 'createVariants': created variant of type 'jpg-100' for object with id 82639
<INFO> Activity 'createVariants': created variant of type 'jpg-400' for object with id 82639
<INFO> Saved variant to: 'C:\Export\Feeds\Image\image_09123114150638_ImageJpeg.jpg'
<INFO> Saved variant to: 'C:\Export\Feeds\Image\image_09123114150638_jpg-100.jpg'
<INFO> Saved variant to: 'C:\Export\Feeds\Image\image_09123114150638_jpg-400.jpg'
 

Examples

Here are example for adding and removing objects to publishing destinations.

Publish (Add):

Example 1: http://server/gnportal/do.ashx?cmd=publish&pubcmd=aids:2412&pubdest=/Image

This publishes the object with id=2412 to the publishing destination with the path of '/Image'.

Example 2: http://tera-ifra/gnportal/do.ashx?cmd=publish&pubcmd=aids:2412&ids=1552,1571

This publishes the object with id=2412 to the two publishing destinations with ids=1552 and 1571.

NOTE: 'aids' and 'rids' are shortcuts to compose the strings needed by PubCmd.

Unpublish (Remove):

Example 3: http://server/gnportal/do.ashx?cmd=publish&pubcmd=rids:2412&pubdest=/Image

This un-publishes the object with id=2412 from the publishing destination with the path of '/Image'.

Example 4: http://server/gnportal/do.ashx?cmd=publish&pubcmd=rids:2412&id=1552

This un-publishes the object with id=2412 from the publishing destination with id=1552.Add and Remove:

Example 5: http://server/gnportal/do.ashx?cmd=publish&pubcmd=aids:2361;rids:2412&ids=1552

This command modifies the publishing destination with id=1552; by removing the object with id=2412 and adding the object with id=2361.

NOTE:        If any of the publishing destinations where the object is published have an associated Publish Template, with an Publish workflow defined, that workflow will automatically be executed if the call is successful.

See also

Unpublish

SchedPublish