Steps in the PublicationOutput SetMetadata method
Invoking the PublicationOutput SetMetadata method updates a publication object (logical, version and language). To do this, a number of steps are performed.
Here are the steps that the
PublicationOutput SetMetadata method executes when invoked:
- Validate all incoming parameters by verifying the following:
- All required parameters are present.
- No system fields have been supplied.
- All parameters contain a valid value.
- Retrieve the object.
- Initialize the plugin engine:
- Find the Plugin Configuration Xml.
- Conditionally filter the Plugin Configuration Xml using the following conditions:
ConditionName Condition on... Example ISHTypeThe InfoSharetype of the objectISHPublicationFMAPIDThe unique identifier of the logical level (= LogicalId)VERSIONThe version number 1.1.1 FISHPUBLNGCOMBINATIONThe language combination en+frDOC-LANGUAGEThe individual languages used in the language combination frFISHOUTPUTFORMATREFThe label of the output format PDF (A4 Manual) EDTThe EDT specified on the output format EDTPDFISHUserGroupThe element name of the usergroup VUSERGROUPSYSTEMMANAGEMENTCurrentActionThe current action SetMetadataISHLevelThe level logical,version,lng - Initialize the plugins.
- Start the transaction and lock all involved objects.
- Retrieve all 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 the publication output object is released, updating language-level metadata is not allowed, and an
ObjectIsReleasedexception is thrown - If the publication output object is publishing or pending publishing, updating language-level metadata is not allowed, and an
InvalidStatusForActionexception is thrown - If the status is updated, check that the status transition is valid.
- If the publication output object is released, updating language-level metadata is not allowed, and an
- Run the plugins in the order specified in the Plugin Configuration Xml.
- Execute the following checks (again) on the publication output object:
- If the publication output object is released, updating language-level metadata is not allowed, and an
ObjectIsReleasedexception is thrown - If the publication output object is publishing or pending publishing, updating language-level metadata is not allowed, and an
InvalidStatusForActionexception is thrown - If the 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 the content of the publication have been updated on the version level, then:
- If the publication version is released, an
ObjectIsReleasedexception is thrown - Otherwise, the status of every publication output object is moved to "Out-of-date".
- If the publication version is released, an
- If the status is updated, check that the status transition is valid.
- If the publication output object is released, updating language-level metadata is not allowed, and an
- If the publication version is updated:
- Check if any of the key publication fields has been updated, such as:
FISHBASELINEFISHMASTERREFFISHRESOURCESFISHPUBCONTEXTFISHREQUIREDRESOLUTIONSFISHPUBSOURCELANGUAGES
- 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, set the status of all publication output objects to "Out of date".
- Check if any of the key publication fields has been updated, such as:
- If the publication output object is moved from the "Publishing" status to any other status, set the publication end date to the current date.
- Depending on the status of the publication output object, do the following:
If the status is... ...do the following: "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 the user who is requesting the cancellation is a publisher.
- Reset the publication start date.
- Reset the publication end date.
- Reset the "Event Id" field.
"Released" - If the baseline is not frozen, a
BaselineNotReleasedexception is thrown. - Set "Is Released" field to "Yes".
- Set the publication end date to the current date.
- Set the status type to "Released".
"Draft" If the current status is "Released" and if the user has a right to "Unreleasing a publication", then: - Set the "Is Released" field to "No" if there is no other publication output in the "Released" status.
- Unfreeze the baseline if there is no other publication using the baseline that is still released.
- Update the information in the database by setting the new metadata.
- If the publication output object is moved to "Pending":
- Trigger the publishing process in the background.
- Set the "Event Id" field to the publishing event ID.
- Start the background tasks from the plugins.
- Commit the transaction.