Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
This page gives details of the problems with the current checkout/checkin code and discusses the necessary refactoring.
In the diagrams, ^ indicates a checked out node and <wc> is the 'Working Copy' aspect and <cf> is the 'Copied From' aspect.
Assume the following node structure:
Parent P
Primary child N
<cf>
Association to A
Association to B
Primary child X
Primary child Y
Currently after checkout:
Parent P
Primary child N
<cf>
Association to A
Association to B
Primary child X
Primary child Y
Primary child N^
<cf>
Association to A
Association to B
Secondary child X
Secondary child Y
If X or Y are the target of a 1:* association, then the checkout will fail. The problem is primarily an overloading of the CopyService to support checkout and checkin. The CopyService should support a shallow and a deep copy. Merging or any other model-specific behaviour should be left up to the calling code; in this case the CheckinCheckoutService implementation can use the CopyService's deep copy functionality where required but won't rely on the CopyService to do any merging of the node structures.
Initially:
Parent P
Primary child N
<cf>
Association to A
Association to B
Primary child X
Primary child Y
After Checkout:
Parent P
Primary child N
<cf>
Association to A
Association to B
Primary child X
Primary child Y
Primary child N^
<cf>
<wc>
Association to A
Association to B
Primary child X^
<wc>
Primary child Y^
<wc>
After Edit:
Parent P
Primary child N
<cf>
Association to A
Association to B
Primary child X
Primary child Y
Primary child N^
<cf>
<wc>
Association to A
(deleted) Association to B
Primary child X^
<wc>
(deleted) Primary child Y^
(added) Primary child Z
After Checkin:
Parent P
(deleted) Primary child N
Primary child N^
<cf>
Association to A
Primary child X^
(added) Primary child Z
Moving the NodeService policy firing code into an interceptor may be required in order to allow the use of low-level node operations without having the associated policies fired.