When I trace code in alfresce, I found following code in node-header.get.html.ftl
<#if item.workingCopy??>
<#if item.workingCopy.isWorkingCopy??>
<#assign lockUser = node.properties["cm:workingCopyOwner"]>
<#else>
<#assign lockUser = node.properties["cm:lockOwner"]>
</#if>
......
<#elseif>
My understanding is
When a user click "Edit Offline", working copy of document is created and workingCopyOwner is same as lockOwner.
If so, why do we need to write like this? Is my understanding wrong???
The property cm:workingCopyOwner belongs to the aspect cm:workingCopy and cm:lockOwner belongs to cm:lockable.
When you click "Edit offline" a copy of the node is created and assigned the aspect cm:workingCopy, cm:workingCopyOwner is set to your user. The original node is assigned the aspect cm:lockable and this one gets the property cm:lockOwner. So yes, the two properties get the same user, but those are assigned on different nodes.
/Erik
Next to what already explained by @billerby, the main difference is that a node can be locked without having been checked out (e.g. by explicit locking calls), while it can't happen that a document is checked out BUT not locked.
Thus, cm:workingCopy
and cm:lockable
capture two different, albeit somehow related, lifecycle phases of a document, and the use of the respective properties to declare the lock ownership is simply made consistent when checking out documents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With