Currently, the only way to edit an item metadata is through the "Admin Item" section, where a list of all metadata is displayed using textarea elements. Here there are no constraint checking or help (by hints) or logical metadata organization. It is just a list o textarea elements labeled whith the respective metadata name.
This patch allows a user to edit an item by re-inserting it in the workflow process, as if it was a new submission.
It is important to note that this patch modifies the XmlWorkflow aspect, which means that this function will be available only for those who have this aspect enabled.
How does it work?
Navigation class was modified and now, when an Item is shown, there is another context menu item which points to "handle/xxxx/yyy/edit_item_metadata", only when the user can edit that item.
That URL is handled by the XmlWorkflow's sitemap.xmap (that was modified to add the corresponding match component), which invokes the flowscript function added to the xmlworkflow.js (also modified to add this function).
This flow function invokes some validation functions (added to XmlWorkflowManager class) and then starts the workflow. This means the XmlWorkflowItem wrapper is created and the workflow's first step is activated.
Also, the XmlWorkflowManager's archive() method was modified to decide if the "item to archive" is a new submission or an edited item.
So far, we haven't decided how to manage the un-publish and re-publish tasks when the item enters and leaves the workflow. An option could be use the "in_archive" flag. This means that when the item enters the workflow for edition it remains published.
Also, this modifications might need some addiontional testing.
Attached you will find the patch file, and a zip file containing the modified files (classes, sitemaps, flowscripts, etc), organized by module.
We would be glad to hear your comments about this patch.