Item workflow
From VYRE
Contents |
Item Workflow
Workflow actions can be found here: http://wiki.vyre.com/index.php/Content_template#vyre-item:action
Overview
What is a checked out item
A checked out item is a locked item that only the user that checked it out can modify. When the user checks in the item it then can be modified by other users.
What is an active version of an item
If an item has an active version it is searchable in the active index (see below).
What is a working version of an item
If an item has a version that is greater then the current active version then its current version is a working version, it can either be checked in or checked out. This version will be in the working index (see below) and can be used to modify an item while still having the old version on a live site.
Searching
Since 4.3.1.8 there are two indexes, the active index and the working index. An item can have versions in both of these indexes which allows items to go through a workflow (changes made to the version in the working index) while a 'live' version can still be shown to the end user.
Please see the 'Things to look out for' section for exceptions to the above.
Search results XML
The search results xml contains the following elements which can be used to build links to the version of the item to be worked on:
<version>16</version> <active-version>16</active-version> <max-version>17</max-version> <link>item29239/</link> <!-- this will show on all items --> <workingLink>item29239/versionWorking/</workingLink> <!-- this link will only show on working items (both checked out and checked in items) --> <checkedOutLink>item29239/versionCheckedOut/</checkedOutLink> <!-- this will only show on checked out items --> <checkout-info> <checked-out>true</checked-out> <checkout-userprofile-id>admin</checkout-userprofile-id> <!-- empty if not checked out --> <checked-out-by-current-user>true</checked-out-by-current-user> <!-- false if not checked out or if the current user did not check out the item --> </checkout-info>
The XML can contain three links to versions of the items:
-
<link></link>: The link to the active version (if it exists). -
<workingLink></workingLink>: The link to the working version (if there is a newer version then the active version). -
<checkOutLink></checkedOutLink>: The link to the checked out version, this will only work for the user that checked out the item.
Workflow actions
These workflow actions can be used in a content template and item edit portlets.
- create: Creates a new item but does not check-in or activate the item.
- createAndCheckin: Creates a new item and checks in the item however it is not activated.
- createAndActivate: Creates a new item/version, checks in and then activates the item.
- update: Saves changes made to a checked out item.
- checkout: Checkouts out an item, meaning that only the current user can edit this item.
- checkin: Checks in the item so it is no longer locked to the current user, however the active version is not created/updated
- discard: Discards any changes made to a checked out item, it will roll back to the previous working version (NOT the last active version) NB Can only be called on checked out items
- delete: Sends the item to the trash (whole item; both working and active versions)
- activate: Activates the current version, either creating or updating the item in the active index.
- deactivate: Removes this item from the active index (doesn't update any meta/content in same call)
- requestTranslation: Flags the item as needing a translation.
- checkoutUpdateAndCheckin: This checks out an item, updates it and then checks it in (similar to createAndActivate however it does not activate the item again).
Actions available for different item states
- Create new item
- create
- createAndCheckin
- createAndActivate
- Checked out item version
- update
- checkin
- createAndActivate
- discard
- Checked in item version with active version
- checkout
- checkoutUpdateAndCheckin
- activate
- delete
- Checked in item version without active version
- checkout
- checkoutUpdateAndCheckin
- activate
- Active item version (without working version)
- checkout
- createAndActivate
- checkoutUpdateAndCheckin
- delete
- deactivate
- Active item version (with working version)
- checkout
- delete
- deactivate
Ajax calls
Ajax calls can also be used to perform certain workflow actions on items.
the itemManger needs to be created, it can either be for a single item allowing for methods to be called on it without passing the id, or a generic manager where the id needs to be passed.
//for a specific id, as the "itemid" value is set. var itemManager = new ItemLifecycleManager({ itemId:19857, // optional resultHandler : function(xml) { // optional //do something with response; } }); itemManager.checkout(); OR //generic manager as not itemId is set [N.B. The below constructor can still take in a 'resultHandler' as above] var itemManager = new ItemLifecycleManager(); itemManager.checkout(19857); // with item etc..
The methods that can be called are:
- checkin
- checkout
- discardChanges
- remove
- activate
- deactivate
- requestTranslation
Things to look out for
Currently in VYRE Unify some changes that are made to the checked out version will also affect the active version, below is a list of these:
- Taxonomy
- Item Links
- User Links
- Item Lists
