Understanding the steps in PublicationOutput SetMetadata method
This concept describes the different steps in PublicationOutput SetMetadata method
The following flow describes the main steps and checks when updating a publication object (logical, version and language).
Validate incoming parameters
During this step the following checks are executed:- All required parameters are present
- No system fields are supplied
- All parameters contain a valid value
- In order to check this, the incoming output format and language combination are converted into lists with LovValue items.
Retrieve the object
- If no object could be found, an
InvalidObjectexception is thrown. - If an object is found, the current user must have write acces. Otherwise an
ObjectIsReadOnlyexception is thrown.
- If no object could be found, an
Initialize the plugin engine
- Find the Plugin Configuration Xml
- Conditionally filter the Plugin Configuration Xml using the following conditions:
ConditionName Condition on... Example ISHType ISHPublication FMAPID The unique identifier of the logical level (= LogicalId) VERSION The version number 1.1.1 FISHPUBLNGCOMBINATION The language combination en+fr DOC-LANGUAGE The individual languages used in the language combination fr FISHOUTPUTFORMATREF The label of the output format PDF (A4 Manual) EDT The EDT specified on the output format EDTPDF ISHUserGroup The element name of the usergroup VUSERGROUPSYSTEMMANAGEMENT CurrentAction The current action SetMetadata ISHLevel The level
logical, version, lng - Initialize the plugins.
- Start the transaction and lock all involved objects
- Retrieve all metadata
- Check the current metadata
- Check that the current values match the values specified in the required current metadata
- Set all metadata fields (in memory)
- Execute the following checks on the publication output object:
- If publication output object is released, updating language-level metadata is not allowed, an
ObjectIsReleasedexception is thrown - If publication output object is publishing or pending publishing, updating language-level metadata is not allowed, an
InvalidStatusForActionexception is thrown - If the status is updated, check that the status transition is valid
- If publication output object is released, updating language-level metadata is not allowed, an
Run the plugins
All plugins are executed in order specified in the Plugin Configuration Xml
- Execute the following checks (again) on the publication output object:
- If publication output object is released, updating language-level metadata is not allowed, an
ObjectIsReleasedexception is thrown - If publication output object is publishing or pending publishing, updating language-level metadata is not allowed, an
InvalidStatusForActionexception is thrown - If status is not "To Be Published" and status is not updated, and another field than status is updated on the language level, change the status to "Out-of-date"
- If any of the fields that affect content of the publication have been updated on the version level
- If the publication version is released, an
ObjectIsReleasedexception is thrown - Otherwise, every publication output object is moved to "Out-of-date" status
- If the publication version is released, an
- If the status is updated, check that the status transition is valid
- If publication output object is released, updating language-level metadata is not allowed, an
- If the publication version is updated...
- Check if any of the key publication fields is updated:
- FISHBASELINE
- FISHMASTERREF
- FISHRESOURCES
- FISHPUBCONTEXT
- FISHREQUIREDRESOLUTIONS
- FISHPUBSOURCELANGUAGES
- ...
- If any of the key publication fields is updated and the publication is already released, an
ObjectIsReleasedexception is thrown - If any of the key publication fields is updated and the publication is not released, mark all publication output objects as "Out of date"
- Check if any of the key publication fields is updated:
- If publication output object is moved from "Publishing" status to any other status:
- Set the publication end date to the current date
- If publication output object is moved to...
- "Pending"
- Set Publisher to the current user
- "Publishing"
- Set the publication start date to the current date
- Reset the publication end date
- Set Publisher to the current user
- "Cancelled"
- Check that user that is requesting the cancel is a publisher.
- Reset the publication start date
- Reset the publication end date
- Reset the "Event Id" field
- Check that user that is requesting the cancel is a publisher.
- "Released"
- If the baseline is not frozen,
BaselineNotReleasedexception is thrown - Set "Is Released" field to Yes
- Set the publication end date to the current date
- Set the status type to "Released"
- If the baseline is not frozen,
- "Pending"
- Update the information in the database:
- Set the new metadata
- If publication output object is moved to "Pending":
- Trigger the publishing process in the background
- Set "Event Id" field to the publishing event id
- Start the background tasks from the plugins
- Commit the transaction