Documentation Center

Creating new publish plugins: best Practices

Best practices when creating a new publish plugin lets you get the best out of your customization.

Verify the parameter values in Initialize

If the plugin cannot be executed because some parameters were not provided or have wrong values, the main operation should fail as soon as possible.

Use IshValueType.element for getting and setting field values

So that the element name does not change and is guaranteed to be unique.

Use the items property on the IPublishPostProcessContext

The Items property on the IPublishPostProcessContext can be used to pass data in memory between plugins. However make sure not to let too much data loaded in memory: This can cause the server to run out of memory.

Don't log the processing of every file

Logging every file that is being processed in the event monitor generates too many entries in the Event Log. We recommend you only periodically log the number of files already processed in such a way that it would lead to 10 lines in the event monitor. On the other hand, if the plugin encounters and error, make sure to log the exact file that caused the error.

Think multithread

If your process takes a long time, you might want to use multiple threads: it will improve throughput.

Check cancellation

Check that the publish was not cancelled on a regular basis.