JBoss Community Archive (Read Only)

ModeShape 5

Built-in node types

The JCR 2.0 specification requires that repositories have a number of node types immediately available for use by client applications, and ModeShape defines a number of additional node types that are installed into every repository. None of these node types can be changed or modified.

Standard node types

The following is the CND representation of the standard JCR built-in node types:

<jcr='http://www.jcp.org/jcr/1.0'>
<nt='http://www.jcp.org/jcr/nt/1.0'>
<mix='http://www.jcp.org/jcr/mix/1.0'>

// ------------------------------------------------------------------------
//                             Pre-defined Node Types
// ------------------------------------------------------------------------

[nt:base] abstract
  - jcr:primaryType (name) mandatory autocreated 
      protected compute 
  - jcr:mixinTypes (name) protected multiple compute
  
[nt:unstructured] 
  orderable 
  - * (undefined) multiple 
  - * (undefined) 
  + * (nt:base) = nt:unstructured sns version 

[mix:created] mixin 
  - jcr:created (date) protected  
  - jcr:createdBy (string) protected

[nt:hierarchyNode] > mix:created abstract 

[nt:file] > nt:hierarchyNode 
  + jcr:content (nt:base) primary mandatory

[nt:linkedFile] > nt:hierarchyNode 
  - jcr:content (reference) primary mandatory

[nt:folder] > nt:hierarchyNode 
  + * (nt:hierarchyNode) version

[mix:referenceable] mixin 
  - jcr:uuid (string) mandatory autocreated protected initialize 

[mix:mimeType] mixin 
  - jcr:mimeType (string)  
  - jcr:encoding (string)

[mix:lastModified] mixin 
  - jcr:lastModified (date) 
  - jcr:lastModifiedBy (string)
  
[nt:resource] > mix:mimeType, mix:lastModified 
  - jcr:data (binary) primary mandatory

[nt:nodeType] 
  - jcr:nodeTypeName (name) mandatory protected copy 
  - jcr:supertypes (name) multiple protected copy
  - jcr:isAbstract (boolean) mandatory protected copy 
  - jcr:isMixin (boolean) mandatory protected copy
  - jcr:isQueryable (boolean) mandatory protected copy
  - jcr:hasOrderableChildNodes (boolean) mandatory protected copy 
  - jcr:primaryItemName (name) protected copy
  + jcr:propertyDefinition (nt:propertyDefinition)  = nt:propertyDefinition sns protected copy 
  + jcr:childNodeDefinition (nt:childNodeDefinition) = nt:childNodeDefinition sns protected copy

[nt:propertyDefinition] 
  - jcr:name (name) protected
  - jcr:autoCreated (boolean) mandatory protected 
  - jcr:mandatory (boolean) mandatory protected
  - jcr:isFullTextSearchable (boolean) mandatory protected
  - jcr:isQueryOrderable (boolean) mandatory protected
  - jcr:onParentVersion (string) mandatory protected
      < 'COPY', 'VERSION', 'INITIALIZE', 'COMPUTE', 
        'IGNORE', 'ABORT' 
  - jcr:protected (boolean) mandatory protected 
  - jcr:requiredType (string) mandatory protected
    < 'STRING', 'URI', 'BINARY', 'LONG', 'DOUBLE', 'DECIMAL', 'BOOLEAN', 
      'DATE', 'NAME', 'PATH', 'REFERENCE', 'WEAKREFERENCE', 'UNDEFINED'
  - jcr:valueConstraints (string) multiple protected 
  - jcr:availableQueryOperators (name) mandatory multiple protected 
  - jcr:defaultValues (undefined) multiple protected
  - jcr:multiple (boolean) mandatory protected

[nt:childNodeDefinition] 
  - jcr:name (name) protected
  - jcr:autoCreated (boolean) mandatory protected 
  - jcr:mandatory (boolean) mandatory protected
  - jcr:onParentVersion (string) mandatory protected 
      < 'COPY', 'VERSION', 'INITIALIZE', 'COMPUTE', 
        'IGNORE', 'ABORT' 
  - jcr:protected (boolean) mandatory protected
  - jcr:requiredPrimaryTypes (name) = 'nt:base' mandatory protected multiple 
  - jcr:defaultPrimaryType (name) protected
  - jcr:sameNameSiblings (boolean) mandatory protected 

[nt:versionHistory] > mix:referenceable 
  - jcr:versionableUuid (string) mandatory autocreated protected abort 
  - jcr:copiedFrom (weakreference) protected abort < 'nt:version' 
  + jcr:rootVersion (nt:version) = nt:version mandatory autocreated protected abort 
  + jcr:versionLabels (nt:versionLabels) = nt:versionLabels mandatory autocreated protected abort 
  + * (nt:version) = nt:version protected abort


[nt:versionLabels] 
  - * (reference) protected abort < 'nt:version'

[nt:version] > mix:referenceable 
  - jcr:created (date) mandatory autocreated protected abort 
  - jcr:predecessors (reference) protected multiple abort < 'nt:version' 
  - jcr:successors (reference) protected multiple abort < 'nt:version' 
  - jcr:activity (reference) protected abort < 'nt:activity' 
  + jcr:frozenNode (nt:frozenNode) protected abort

[nt:frozenNode] > mix:referenceable 
  orderable 
  - jcr:frozenPrimaryType (name) mandatory autocreated protected abort 
  - jcr:frozenMixinTypes (name) protected multiple abort 
  - jcr:frozenUuid (string) mandatory autocreated protected abort 
  - * (undefined) protected abort 
  - * (undefined) protected multiple abort 
  + * (nt:base) protected sns abort

[nt:versionedChild] 
  - jcr:childVersionHistory (reference) mandatory autocreated protected abort < 'nt:versionHistory'

[nt:query] 
  - jcr:statement (string) 
  - jcr:language (string)

[nt:activity] > mix:referenceable 
  - jcr:activityTitle (string) mandatory autocreated protected


[mix:simpleVersionable] mixin 
  - jcr:isCheckedOut (boolean) = 'true' mandatory autocreated protected ignore 

[mix:versionable] > mix:simpleVersionable, mix:referenceable mixin 
  - jcr:versionHistory (reference) mandatory protected ignore < 'nt:versionHistory' 
  - jcr:baseVersion (reference) mandatory protected ignore < 'nt:version' 
  - jcr:predecessors (reference) mandatory protected multiple ignore < 'nt:version' 
  - jcr:mergeFailed (reference) protected multiple abort 
  - jcr:activity (reference) protected < 'nt:version' 
  - jcr:configuration (reference) protected ignore < 'nt:configuration'

[nt:configuration] > mix:versionable 
  - jcr:root (reference) mandatory autocreated protected

[nt:address] 
  - jcr:protocol (string) 
  - jcr:host (string)  
  - jcr:port (string) 
  - jcr:repository (string) 
  - jcr:workspace (string) 
  - jcr:path (path) 
  - jcr:id (weakreference)

[nt:naturalText] 
  - jcr:text (string) 
  - jcr:messageId (string)


// ------------------------------------------------------------------------
//                             Pre-defined Mixins
// ------------------------------------------------------------------------

[mix:etag] mixin
  - jcr:etag (string) protected autocreated

[mix:lockable] mixin 
  - jcr:lockOwner (string) protected ignore 
  - jcr:lockIsDeep (boolean) protected ignore 

[mix:lifecycle] mixin 
  - jcr:lifecyclePolicy (reference) protected initialize 
  - jcr:currentLifecycleState (string) protected initialize

[mix:managedRetention] > mix:referenceable mixin 
  - jcr:hold (string) protected multiple 
  - jcr:isDeep (boolean) protected multiple 
  - jcr:retentionPolicy (reference) protected

[mix:shareable] > mix:referenceable mixin

[mix:title] mixin 
  - jcr:title (string) 
  - jcr:description (string)  

[mix:language] mixin 
  - jcr:language (string) 

ModeShape built-in node types

The following is the CND representation of the ModeShape-specific built-in node types. Note that many of these outline the structure of nodes under the '/jcr:system' area of the repository and are protected (meaning clients can view but not directly modify their content).

//------------------------------------------------------------------------------
// N A M E S P A C E S
//------------------------------------------------------------------------------
<jcr = "http://www.jcp.org/jcr/1.0">
<nt  = "http://www.jcp.org/jcr/nt/1.0">
<mix = "http://www.jcp.org/jcr/mix/1.0">
<mode = "http://www.modeshape.org/1.0">

//------------------------------------------------------------------------------
// N O D E T Y P E S
//------------------------------------------------------------------------------

[mode:namespace] > nt:base primaryitem mode:uri
- mode:uri (string) protected version
- mode:generated (boolean) protected version

[mode:namespaces] > nt:base
+ * (mode:namespace) = mode:namespace protected version

[mode:nodeTypes] > nt:base
+ * (nt:nodeType) = nt:nodeType protected version

[mode:lock] > nt:base
- mode:lockToken (string) protected ignore
- jcr:lockOwner (string) protected ignore
- mode:lockingSession (string) protected ignore
- mode:expirationDate (date) protected ignore
- mode:isSessionScoped (boolean) protected ignore
- jcr:lockIsDeep (boolean) protected ignore
- mode:isHeldBySession (boolean) protected ignore
- mode:workspace (string) protected ignore

[mode:locks] > nt:base
+ * (mode:lock) = mode:lock protected ignore

[mode:versionHistoryFolder] > nt:base
+ * (nt:versionHistory) = nt:versionHistory protected ignore
+ * (mode:versionHistoryFolder) protected ignore

[mode:versionStorage] > mode:versionHistoryFolder

[mode:repository] > nt:base, mix:created

[mode:federation]
+ mode:projection (mode:projection) = mode:projection sns protected ignore

[mode:projection]
- mode:externalNodeKey (String) mandatory protected ignore
- mode:projectedNodeKey (String) mandatory protected ignore
- mode:alias (String) mandatory protected ignore

[mode:system] > nt:base
- * (undefined) protected
- * (undefined) multiple protected
+ mode:namespaces (mode:namespaces) = mode:namespaces autocreated mandatory protected abort
+ mode:locks (mode:locks) = mode:locks autocreated mandatory protected abort
+ mode:repository (mode:repository) = mode:repository autocreated protected abort
+ mode:federation (mode:federation) = mode:federation autocreated protected abort
+ mode:indexes (mode:indexes) = mode:indexes autocreated protected abort
+ jcr:nodeTypes (mode:nodeTypes) = mode:nodeTypes autocreated mandatory protected abort
+ jcr:versionStorage (mode:versionStorage) = mode:versionStorage autocreated mandatory protected abort

[mode:root] > nt:base, mix:referenceable orderable
- * (undefined) multiple version
- * (undefined) version
+ jcr:system (mode:system) = mode:system autocreated mandatory protected ignore
+ * (nt:base) = nt:unstructured sns version

// This is the same as 'nt:resource' (which should generally be used instead)...
[mode:resource] > nt:base, mix:mimeType, mix:lastModified primaryitem jcr:data
- jcr:data (binary) mandatory

[mode:share] > mix:referenceable    // Used for non-original shared nodes, but never really exposed to JCR clients
- mode:sharedUuid (reference) mandatory protected initialize 

[mode:hashed] mixin
- mode:sha1 (string)

// A marker node type that can be used to denote areas into which files can be published.
// Published areas have optional titles and descriptions.
[mode:publishArea] > mix:title mixin

[mode:derived] mixin
- mode:derivedFrom (path) // the location of the original information from which this was derived
- mode:derivedAt (date)  // the timestamp of the last change to the original information from which this was derived

[mode:accessControllable] mixin 
    + mode:acl (mode:Acl) protected 
[mode:Acl] noquery
    + * (mode:Permission) protected
[mode:Permission] noquery
    - name (string) nofulltext
    - privileges (string) multiple nofulltext protected

// -----------------------
// Query index definitions
// -----------------------

// We organize the indexes by providers for several reasons. 
// 1. It's easier to ensure that all indexes have a provider.
// 2. The name of the indexes really needs to be unique only for a given provider
// 3. When an index is removed, we know which provider it is for based upon the path.

[mode:indexes]
+ * (mode:indexProvider) = mode:indexProvider protected ignore

[mode:indexProvider]
+ * (mode:index) = mode:index protected ignore

[mode:index] > mix:referenceable, mix:created, mix:lastModified
- mode:kind (string) mandatory protected ignore
    < 'VALUE', 'UNIQUE_VALUE', 'ENUMERATED_VALUE', 'TEXT', 'NODE_TYPE'
- mode:nodeTypeName (name) = 'nt:base' mandatory protected ignore
- mode:workspaces (string) = "*" mandatory protected ignore
- mode:synchronous (boolean) = 'true' mandatory protected ignore
- jcr:description (string) protected ignore
- * (undefined) protected ignore
- * (undefined) multiple protected ignore
+ mode:indexColumn (mode:indexColumn) = mode:indexColumn mandatory protected sns

[mode:indexColumn] > mix:referenceable
- mode:propertyName (name) mandatory protected ignore
- mode:columnTypeName (string) mandatory protected 
    < 'STRING', 'URI', 'BINARY', 'LONG', 'DOUBLE', 'DECIMAL', 'BOOLEAN', 
      'DATE', 'NAME', 'PATH', 'REFERENCE', 'WEAKREFERENCE', 'UNDEFINED'

// -----------------------
// Large unordered collections
// -----------------------
[mode:unorderedCollection] mixin abstract

// Tiny unordered collection, where the number of range buckets is 16
[mode:unorderedTinyCollection] > mode:unorderedCollection mixin

// Small unordered collection, where the number of range buckets is 256
[mode:unorderedSmallCollection] > mode:unorderedCollection mixin

// Large unordered collection, where the number of range buckets is 4096
[mode:unorderedLargeCollection] > mode:unorderedCollection mixin

// Very large unordered collection, where the number of range buckets is 65536
[mode:unorderedHugeCollection] > mode:unorderedCollection mixin
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:12:56 UTC, last content change 2016-04-07 07:21:08 UTC.