Search code examples
jackrabbitjcrcontent-repository

Use of MixinTypes in JCR


I was trying to understand the concept of MixinTypes in JCR, What i red "Mixin node types usually specify additional properties or child nodes related to a capability being added to the node" but it seems some unclear, I am looking for simple defination through which i can understand. Like we have node type cq:page and it has supertype mix:created which is of mixin type. What if the case i remove mixin type property from mix:created.

Or any other example. Thanks


Solution

  • If you read the documentation it should be clear.

    "Every node has one declared primary node type and zero or more mixin node types. Primary node types are typically used to defined the core characteristics of a node, while mixin node types are used to add additional characteristics often related to specific repository functions or to metadata."

    One way of looking at is not all JCR implementations have all the features so not all the mixins would work. Some mixin's expose hidden properties. Jackrabbit has a unique identifier for every node (jcr:uuid) but if you tried to list the nodes properties it would not appear, unless you added the mix:referenceable mixin. Other mixin's tell the JCR which features to use, eg. versioning. If your JCR supports it you must add mix:versionable or mix:simpleVersionable to tell it which nodes to version.