Details
-
New Feature
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
1
-
Quasar
-
Puma Sprint 238
Description
Requirements
We need to be able to have logical references which CAN'T be based on jcr:uuid and neither on jcr path, since for example the logical reference most be the same for two different nodes. Think about 'content blocks' or hippo document compounds, which are nodes below a document variant : the same representations are typically present between draft, unpublished and published, however, certainly in case of SNS, it is not possible to know for which which nodes are the equivalent between document variants
Same goes for XPages: For XPages, we need to be able to have a property on the containers of an XPage layout which is stable across different copies (preview|live and branches) of the XPage Layout : this is because an XPage document refers to those containers
The idea is to support this via a cnd mixin:
[hippo:identifiable] mixin - hippo:identifier (string) autocreated
when having the above mixin on a nodetype, an identifier (uuid) should be auto created. The behavior need to be as follows:
- For newly created nodes with mixin hippo:identifiable, the hippo:identifier should be added automatically as with a generated uuid value
- When a node is copied with mixin hippo:identifiable and having hippo:identifier, its value should be copied AS-IS
- When a node which is not of type hippo:identifier but the backing nodetype in the CND has the mixin hippo:identifier added, then when copying that node, the property hippo:identifier should also be auto created
Implementation
The above functionality is very similar to builtin / JCR standard mixins like mix:lastModified which also defines auto created properties, like jcr:lastModified:
[mix:lastModified] mixin - jcr:lastModified (date) autocreated - jcr:lastModifiedBy (string) autocreated
The problem however is that:
- this is 'builtin' functionality (by spec), and its implementation is internal to the Jackrabbit engine (class org.apache.jackrabbit.core.NodeTypeInstanceHandler)
- jackrabbit requires that autocreated properties must have a (static) default value (note: the spec actually is more lenient, but Jackrabbit is not)
To solve this specific use-case therefore requires 2 specific changes (patches) within Jackrabbit:
- Extend/patch its NodeTypeInstanceHandler class to handle the auto generation of the (uuid) value for a hippo:identifier property (when declared by hippo:identifiable)
- Patch the NodeTypeRegistry to not require a default value for this property in the nodetype definition
Note: internally Jackrabbit *is* more lenient on this, but only for the builtin (by spec) autocreated properties like for jcr:lastModified.
So we must make it also more lenient for our hippo:identifier property of the hippo:identifiable mixin (specifically)
The above 2 changes and patches are quite trivial to implement, but as said, only can be done within Jackrabbit, so this requires a new hippo-jackrabbit release to be able to use it.
Attachments
Issue Links
- is awaited by
-
CMS-13523 Only store the XPage container items below a document variant
- Closed