Creating a custom write plugin
You can create custom write plugins to meet specific needs and requirements. Follow the best practices and use the write plugin creation example as guidelines for this task.
- Choose the category of the plugin. For example, if you want the plugin to be triggered on Update, you need to create a Write Plugin.
- Choose the interface to implement. When writing a new custom plugin, you should implement one of the available interfaces:
- Choose IWriteMetadataPlugin when your plugin only need to access the metadata fields. This plugins will be executed regardless whether the BLOB is submitted or not.
- Choose IWriteMetadataAndBlobPlugin when your plugin needs to access the BLOB. If the BLOB is not submitted, plugin will be ignored.
- Implement Initialize. Here plugin should read its parameters and parse their values. In case the value is invalid, the plugin sequence can fail early in the process, before any plugin is executed.
- Implement ObjectContentType property. When implementing IWriteMetadataAndBlobPlugin interface, you need to specify how plugin will consume the blob: as a XmlDocument or as a stream.
- Implement Run. Here you put the main logic of the plugin. Anything that plugin can do is available to it through the context, which includes:
- Accessing the IshType, LogicalId etc.
- Getting the current metadata field values
- Getting the original metadata field values
- Setting the current metadata field values
- Accessing the BLOB and the BLOB properties (Edt definition)
Logging (Use LogService property of the context to add the logging statement to the standard application log file.)
- Adding events to the event queue. (Use EventQueue property of the context to access the mechanism to add events to the queue.)
-