Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Explained State

...

All we needed now was a way to make sure that the validator was run after all changes, and only changes that did not produce errors were allowed.
This was complicated by the fact that "a change" to an object might not be the same as "one call to API-M", but rather a series of calls.
Fedora already has a STATE property for each object, restricted to the values "Active", "Inactive" and "Deleted". There seem to be no predefined
meaning attached to this state, so we added our own.

We used the decorator system for the Management module to add the following meaning. If an object is
in the ACTIVE "Active" state, the only allowed change
is changing state to INACTIVE"Inactive". All other changing API-M methods throws exceptions. So, you cannot change an active "Active" object, without making it inactive "Inactive" first.
Then, in inactive "Inactive" all changes are allowed, but when you try to change the state back to ACTIVE"Ative", the validator webservice is invoked. If the object
passes validation, the state is changed, otherwise the operation returns an error reportthrows an exception with an error report message.

So, the meaning attached to the state is now:

  • Active: The object is published and available. The object has been validated against the content models that describes it.
  • Inactive: The object is not publicly available. It is not guaranteed to be valid in regards to the content models that describes it.
  • Deleted: The object is deleted, and should not be available to anyone. It is in no way guaranteed to be valid. It is still in the repository, and special administration tools should be able to resurrect it.