IWriteMetadataPlugin - RaisePublishEvent
Sends a publish event with the configured event type when the publication status is changed to 'Pending'.
Plugin Configuration
| Field Name | Field Level | Description |
|---|---|---|
| FISHPUBSTATUS | lng | The publication status is used to check if the new status is "Pending" (= VPUBSTATUSPUBLISHPENDING) |
| FISHEVENTID | lng | FISHEVENTID is used to store the EventId of the logging for the new publish event |
| Parameter | Description |
|---|---|
| EventTypeConfiguration | The parameter contains a XML structure with "eventtype" elements which can be used to start the publish event with a specific event type. The configuration can contain different event types with
Out-of-the-box, the parameter will contain the following XML:
|
Plugin flow
Conditional publishing of write plugin configuration.
When updating a publication output, the write plugin configuration is conditionally published, which will validate the ishcondition not only on the plugin but also within the "EventTypeConfiguration" parameter.
Therefore, when the plugin is executed there is only a limited set of event types remaining.
- The plugin takes the first remaining event type
- After checking if the status is "Pending", the following event data is assembled:
<data> <export-document-type>ISHPublication</export-document-type> <export-document-level>lng</export-document-level> <export-ishlngref>488896</export-ishlngref> <creationdate>20150126031904978</creationdate> </data> The plugin adds the event to a queue.
- When adding the event to the queue, an EventId is generated, which is set on FISHEVENTID.
Configuring multiple event types for publishing
<plugin name="ISHRAISEPUBLISHEVENT" handler="RaisePublishEvent"
ishcondition="ISHLevel='lng' and CurrentAction='SetMetadata'">
<description>Starts a background task when the 'FISHPUBSTATUS' field is changed to 'Pending'</description>
<workingset>
<ishfields>
<ishfield name="FISHPUBSTATUS" level="lng" />
<ishfield name="FISHEVENTID" level="lng" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="EventTypeConfiguration">
<configuration>
<eventtype ishcondition="FISHOUTPUTFORMATREF='GUID-32058B0B-FD30-4D3D-BC77-685F67167878'">PUBLISHCHM</eventtype>
<eventtype ishcondition="ISHOutputFormat.FDITAOTTRANSTYPE='ishditadelivery'">PUBLISHDITADELIVERY</eventtype>
<eventtype ishcondition="ISHOutputFormat.FSTYLEPROCESSOR='SDLLiveContent'">PUBLISHCONTENTDELIVERY</eventtype>
<eventtype ishcondition="EDT='EDTPDF'">PUBLISHPDF</eventtype>
<eventtype ishcondition="EDT='EDTZIP'">PUBLISHZIP</eventtype>
<eventtype>PUBLISH</eventtype>
</configuration>
</parameter>
</parameters>
</initialize>
</plugin>
Let's look at the event type that is used with the above configuration for the following publications:
- Publication in version "1" with language combination "en" and output format "Collaborative Review"
- The output format "Collaborative Review" is linked with "EDTZIP" and the style processor is "SDLLiveContent". So, after conditional filtering the following 3 possible event types are remaining:
<configuration> <eventtype ishcondition="ISHOutputFormat.FSTYLEPROCESSOR='SDLLiveContent'">PUBLISHCONTENTDELIVERY</eventtype> <eventtype ishcondition="EDT='EDTZIP'">PUBLISHZIP</eventtype> <eventtype>PUBLISH</eventtype> </configuration> - The plugin uses the first configured event type which will result in a publish event with event type "PUBLISHCONTENTDELIVERY"
- The output format "Collaborative Review" is linked with "EDTZIP" and the style processor is "SDLLiveContent". So, after conditional filtering the following 3 possible event types are remaining:
- Publication in version "1" with language combination "en" and output format "CHM (Compiled Help)"
- Since the element name of output format "CHM (Compiled Help)" is "GUID-32058B0B-FD30-4D3D-BC77-685F67167878", publishing this publication output will result in an event with event type "PUBLISHCHM".
- Publication in version "1" with language combination "en" and output format "Eclipse Help"
- Since there is no condition matching the output format "Eclipse Help", publishing this publication output will fall back to the default event type "PUBLISH".