jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppieg...@apache.org
Subject svn commit: r355142 - in /incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype: cnd.xml index.xml
Date Thu, 08 Dec 2005 17:10:23 GMT
Author: ppiegaze
Date: Thu Dec  8 09:10:20 2005
New Revision: 355142

URL: http://svn.apache.org/viewcvs?rev=355142&view=rev
Log:
added new details section to CND page, fixed up main NT page

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/cnd.xml
    incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/index.xml

Modified: incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/cnd.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/cnd.xml?rev=355142&r1=355141&r2=355142&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/cnd.xml (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/cnd.xml Thu Dec  8 09:10:20
2005
@@ -17,12 +17,12 @@
   -->
 <document>
     <properties>
-        <title>CND Notation</title>
+        <title>Node Type Notation</title>
     </properties>
     <body>
-        <section name="Introduction">
+        <section name="Node Type Notation">
             <p>
-                The Compact Namespace and Node Type Definition (CND) notation provides a
compact 
+                The <strong>Compact Namespace and Node Type Definition (CND)</strong>
notation provides a compact 
                 standardized syntax for defining node types and making namespace declarations.

                 The notation is intended both for documentation and for programmatically
registering 
                 node types (if you are unfamiliar with JCR node types, you may want to read
the 
@@ -191,10 +191,287 @@
 
 unquoted_string ::= /* a string */]]></source>
         </section>
-        <section name = "Comparison of Notations">
+            <section name="CND Notation in Detail">
+<source><![CDATA[cnd ::= {ns_mapping | node_type_def}]]></source>    
+        <p>        
+            A CND consists of zero or more blocks, each of which is either namespace declaration
or 
+            a node type definition. Namespace prefixes referenced in a node type definition
block must 
+            be declared in a preceding namespace declaration block.
+        </p>
+        <subsection name="Namespace Declaration">
+<source><![CDATA[ns_mapping ::= "<" prefix "=" uri ">"
+
+prefix ::= string
+
+uri ::= string]]></source>
+            <p>
+                A namespace declaration consists of prefix/URI pair. The prefix must be a
valid JCR 
+                namespace prefix, which is the same as a valid XML namespace prefix. The
URI can in 
+                fact be any string. Just as in XML, it need not actually be a URI, though
adhering 
+                to that convention is recommended.
+            </p>
+        </subsection>
+        <subsection name="Node Type Definition">
+<source><![CDATA[node_type_def ::= node_type_name [super_types] [options]
+                  {property_def | child_node_def}]]></source>
+            <p>
+                A node type definition consists of a node type name followed by an optional
supertypes 
+                block, an optional options block and zero or more blocks, each either a property
or 
+                node definition.
+            </p>
+        </subsection>
+        <subsection name="Node Type Name">
+<source><![CDATA[node_type_name ::= "[" string "]"]]></source>
+            <p>
+                The node type name is delimited by square brackets and must be a valid JCR
name. 
+                It may be single-quoted (see Quoting, below). This element is the only strictly

+                required element within a node type definition, though a definition consisting

+                only of a node type name would simply define a new node type identical to

+                <code>nt:base</code>.
+            </p>
+        </subsection>
+        <subsection name="Supertypes">
+<source><![CDATA[supertypes ::= ">" string_list]]></source>
+            <p>
+                After the node type name comes the optional list of supertypes. If this element
is 
+                not present and the node type is not a mixin (see ?1.3.5 Options), then a
supertype 
+                of <code>nt:base</code> is assumed. If present, the element consists
of a 
+                greater-than sign followed by a comma delimited list of node type names,
each of which 
+                may optionally be single-quoted (see Quoting below). In Jackrabbit,
+                multile inheritance of node typoes is supported, sot his listy can be greater
than
+                one item in length.
+            </p>
+        </subsection>
+        <subsection name="Options">
+<source><![CDATA[options ::= orderable_opt | mixin_opt | orderable_opt
+            mixin_opt | mixin_opt orderable_opt
+
+orderable_opt ::= "orderable" | "ord" | "o"
+
+mixin_opt ::= "mixin" | "mix" | "m"]]></source>
+        <p>
+            The option indicators follow the node type name and optional supertype list.
+        </p>
+        <p>
+            If the keyword orderable (or a short form) is present, then the orderable 
+            child node setting of the node type is true. If the keyword is missing, 
+            then the setting is false.
+        </p>
+        <p>
+            If the keyword mixin (or a short form) is present, then this is a mixin 
+            node type. If the keyword is missing, then this is a primary node type.
+        </p>
+        </subsection>
+        <subsection name="Property Definition">
+<source><![CDATA[property_def ::= "-" property_name [property_type_decl]
+                 [default_values] [attributes]
+                 [value_constraints]]]></source>
+            <p>
+                A property definition consists of a minus sign followed by a property 
+                name, followed in turn by optional elements defining the property type, 
+                the default values, the property attributes and the value constraints.
+            </p>
+        </subsection>
+        <subsection name="Property Name">
+<source><![CDATA[property_name ::= string]]></source>
+            <p>
+                The property name must be a valid JCR name or *, to indicate a residual 
+                property definition. It may be single-quoted.
+            </p>
+        </subsection>
+        <subsection name="Property Type">
+<source><![CDATA[property_type_decl ::= "(" property_type ")"
+
+property_type ::= "STRING" | "String |"string" |
+                  "BINARY" | "Binary" | "binary" |
+                  "LONG" | "Long" | "long" |
+                  "DOUBLE" | "Double" | "double" |
+                  "BOOLEAN" | "Boolean" | "boolean" |
+                  "DATE" | "Date" | "date" |
+                  "NAME | "Name | "name |
+                  "PATH" | "Path" | "path" |
+                  "REFERENCE" | "Reference" | "reference" |
+                  "UNDEFINED" | "Undefined" | "undefined" | "*"]]></source>
+            <p>
+                The property type is indicated by a keyword delimited by parentheses. 
+                If the property type declaration is missing a type of STRING is assumed.
+            </p>
+        </subsection>
+        <subsection name="Default Values">
+<source><![CDATA[default_values ::= "=" string_list]]></source>
+        The default value or values, in the case of a multi-value property, are indicated

+        by an equal sign followed by either a single value in string form or a comma-delimited

+        list of values. The values may be single-quoted. If the default value definition
is 
+        missing then no default value is set.
+        </subsection>
+        <subsection name="Attributes">
+<source><![CDATA[attributes ::= "primary" | "pri" | "!" |
+               "autocreated" | "aut" | "a" |
+               "mandatory" | "man" | "m" |
+               "protected" | "pro" | "p" |
+               "multiple" | "mul" | "*" |
+               "COPY" | "Copy" | "copy" |
+               "VERSION" | "Version" | "version" |
+               "INITIALIZE" | "Initialize" | "initialize" |
+               "COMPUTE" | "Compute" | "compute" |
+               "IGNORE" | "Ignore" | "ignore" |
+               "ABORT" | "Abort" | "abort"]]></source>
+            <p>
+                The attribute indicators describe the characteristics of the property. The

+                presence of an attribute keyword indicates that the corresponding 
+                characteristic applies to this property. It's absence indicates that the

+                corresponding characteristic does not apply.
+            </p>
+            <p>
+                The primary keyword indicates that this property is the primary item. 
+                It may appear on a maximum of one property or child node definition 
+                within a node type definition.
+            </p>
+            <p>
+                The multiple keyword indicates that this property is multi-valued.
+            </p>
+            <p>
+                A maximum of one on-version indicator may be present. If none is present

+                then an on-version setting of <code>COPY</code> is assumed.
+            </p>
+        </subsection>
+        <subsection name="Value Constraints">
+<source><![CDATA[value_constraints ::= "<" string_list]]></source>
+            <p>
+                Value constraint are specified by a less-than sign followed by a 
+                comma-delimited list of constraint strings, each optionally single-quoted.
+            </p>
+        </subsection>
+        <subsection name="Child Node Definition">
+<source><![CDATA[child_node_def ::= "+" node_name [required_types]
+             [default_type] [attributes]]]></source>
+            <p>
+                A child node definition consists of a plus sign followed by a 
+                property name, followed in turn by optional elements defining the 
+                required primary node types, the default node type, and the node 
+                attributes.
+            </p>
+        </subsection>
+        <subsection name="Node Name">
+<source><![CDATA[node_name ::= string]]></source>
+            <p>
+                The node name must be a valid JCR name or <code>*</code>, to
indicate a
+                residual child node definition. It may be single-quoted.
+            </p>
+        </subsection>
+        <subsection name="Required Primary Node Types">
+<source><![CDATA[required_types ::= "(" string_list ")"]]></source>
+            <p>
+                The required node types of the child node are indicated by a comma-delimited
+                list of node types, within parentheses. If this element is missing then a

+                required primary node type of <code>nt:base</code> is assumed.
This is the 
+                least restrictive setting possible.
+            </p>
+        </subsection>
+        <subsection name="Default Primary Node Type">
+<source><![CDATA[default_type ::= "=" string]]></source>
+            <p>
+                The default primary node type is indicated by an equals-sign followed 
+                by a node type name, which may be single-quoted. If this element is 
+                missing then no default primary node type is set.
+            </p>
+        </subsection>
+        <subsection name="Attributes">
+<source><![CDATA[attributes ::= "primary" | "pri" | "!" |
+               "autocreated" | "aut" | "a" |
+               "mandatory" | "man" | "m" |
+               "protected" | "pro" | "p" |
+               "multiple" | "mul" | "*" |
+               "COPY" | "Copy" | "copy" |
+               "VERSION" | "Version" | "version" |
+               "INITIALIZE" | "Initialize" | "initialize" |
+               "COMPUTE" | "Compute" | "compute" |
+               "IGNORE" | "Ignore" | "ignore" |
+               "ABORT" | "Abort" | "abort"]]></source>
+            <p>
+                The attribute indicators describe the characteristics of the property. 
+                The presence of an attribute keyword indicates that the corresponding 
+                characteristic applies to this property. It's absence indicates that 
+                the corresponding characteristic does not apply.
+            </p>
+            <p>
+                The primary keyword indicates that this node is the primary item. It 
+                may appear on a maximum of one property or child node definition within 
+                a node type definition.
+            </p>
+            <p>
+                The multiple keyword indicates that this node may have same-name siblings.
+            </p>
+            <p>
+                A maximum of one on-version indicator may be present. If none is present

+                then an on-version setting of <code>COPY</code> is assumed.
+            </p>
+        </subsection>
+        <subsection name="Quoting">
+<source><![CDATA[string_list ::= string {"," string}
+
+string ::= quoted_string | unquoted_string
+
+quoted_string :: = "'" unquoted_string "'"
+
+unquoted_string ::= /* a string */]]></source>
+            <p>
+                Single quotes (') are used to allow for strings (i.e., names, prefixes, 
+                URIs, values or constraint strings) with characters that would otherwise

+                be interpreted as delimiters.
+            </p>
+        </subsection>
+        <subsection name="Escaping">
+        <p>
+            The standard Java escape sequences are also supported:<br/>
+            <code>\n</code> newline<br/>
+            <code>\t</code> tab<br/>
+            <code>\b</code> backspace<br/>
+            <code>\f</code> form feed<br/>
+            <code>\r</code> return<br/>
+            <code>\"</code> double quote<br/>
+            <code>\'</code> single quote<br/>
+            <code>\\</code> 	back slash<br/>
+            <code>\uHHHH</code> Unicode character in hexadecimal<br/>
+        </p>
+        </subsection>
+        <subsection name="Comments">
+            <p>
+                Comment can also be included in the notation using either of the standard

+                Java forms:
+            </p>
+<source><![CDATA[// A comment
+
+/* Another comment */]]></source>
+        </subsection>
+        <subsection name="Whitespace and Short Forms">
+            <p>
+                The notation can be compacted by taking advantage of the following 
+                the fact that spacing around keychars (<code>[ ] &gt; , - ( ) =
&lt;</code>), 
+                newlines and indentation are not required. So, the following is also 
+                well-formed:
+            </p>
+<source><![CDATA[[x]>y,z orderable mixin -p(date)=a,b primary mandatory autocreated
protected multiple version <c,d]]></source>
+            <p>
+                Additionally, though spaces are required around the keywords 
+                (<code>orderable</code>, <code>mixin</code>, <code>date</code>,

+                <code>mandatory</code>, etc..), short forms for keywords can
be
+                 used. So, this:
+            </p>
+<source><![CDATA[[x]>y,z o m-p(date)=a,b ! m a p * version <c,d]]></source>
+            <p>
+                is well-formed (but perhaps not recommended!).
+            </p>
+        </subsection>
+    </section>
+        
+        <section name = "Why this Weird Notation?">
+            <p>
+                <strong>Here's why:</strong>
+            </p>
             <subsection name = "Old Documentation Notation">
                 <p>
-                    Here is the definition of the built-in node type nt:resource using 
+                    Here is the definition of the built-in node type <code>nt:resource</code>
using 
                     the old documentation notation (used in v1.0 of the JCR specification,

                     for example):
                 </p>
@@ -304,6 +581,9 @@
 - jcr:data (binary) mandatory
 - jcr:lastModified (date) mandatory ignore]]></source>
             </subsection>
+            <p>
+                <strong>Case closed</strong>.
+            </p>
         </section>
     </body>
 </document>

Modified: incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/index.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/index.xml?rev=355142&r1=355141&r2=355142&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/index.xml (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/site/xdoc/doc/nodetype/index.xml Thu Dec  8
09:10:20 2005
@@ -20,7 +20,7 @@
         <title>Node Types</title>
     </properties>
     <body>
-        <section name="What is a Node Type?">
+        <section name="Node Types">
             <p>
                 Each node in a Jackrabbit workspace tree has a node type that defines the
                 child nodes and properties it may (or must) have. Developers can use node
types to
@@ -69,21 +69,21 @@
                 A node type definition has the following attributes:
             </p>
             <dl>
-                <dt>Name</dt>
+                <dt><strong>Name</strong></dt>
                 <dd>
                     Every node type registered with the repository has a unique name. The
naming conventions for node
                     types are the same as for items (i.e., they may have a colon delimited
prefix).
                 </dd>
-                <dt>Supertypes</dt>
+                <dt><strong>Supertypes</strong></dt>
                 <dd>
                     A primary node type (with the exception of nt:base) must extend another
node type (and may extend
                     more than one node type). A mixin node type may extend another node type.
                 </dd>
-                <dt>Mixin Status</dt>
+                <dt><strong>Mixin Status</strong></dt>
                 <dd>
                     A node type may be either primary or mixin.
                 </dd>
-                <dt>Orderable Child Nodes Status</dt>
+                <dt><strong>Orderable Child Nodes Status</strong></dt>
                 <dd>
                     A primary node type may specify that child nodes are client-orderable.
If this status is set to
                     true, then
@@ -92,19 +92,19 @@
                     node types control a node's status in this regard. This setting on a
mixin node type will not have
                     any effect on the node.
                 </dd>
-                <dt>Property Definitions</dt>
+                <dt><strong>Property Definitions</strong></dt>
                 <dd>
                     A node type contains a set of definitions specifying the properties that
nodes of this node type are
                     allowed (or required) to have and the characteristics of those properties
(see below).
                 </dd>
-                <dt>Child Node Definitions</dt>
+                <dt><strong>Child Node Definitions</strong></dt>
                 <dd>
                     A node type contains a set of definitions specifying the child nodes
that nodes of this node type
                     are allowed (or required) to have and the characteristics of those child
nodes (including, in turn,
                     <i>their</i>
                     node types, see below).
                 </dd>
-                <dt>Primary Item Name</dt>
+                <dt><strong>Primary Item Name</strong></dt>
                 <dd>
                     A node type may specify one child item (property or node) by name as
the primary item. This
                     indicator is used by the method <code>Node.getPrimaryItem()</code>.
@@ -115,34 +115,34 @@
                     A property definition (within a node type definition) contains the the
following information:
                 </p>
                 <dl>
-                    <dt>Name</dt>
+                    <dt><strong>Name</strong></dt>
                     <dd>
                         The name of the property to which this definition applies, or '*'
if this definition is
                         a "residual definition', meaning that it applies to any additional
properties with any
                         names apart from those otherwise defined in this node type.
                     </dd>
-                    <dt>Required Type</dt>
+                    <dt><strong>Required Type</strong></dt>
                     <dd>
                         The required type of the property. One of <code>STRING</code>,
<code>BINARY</code>,
                         <code>LONG</code>,<code>DOUBLE</code>,<code>DATE</code>,<code>PATH</code>,
                         <code>NAME</code>,<code>REFERENCE</code>
or <code>UNDEFINED</code>.
                         Specifying a type of <code>UNDEFINED</code> means that
the property can be of any type.
                     </dd>
-                    <dt>Value Constraints</dt>
+                    <dt><strong>Value Constraints</strong></dt>
                     <dd>
                         The value constraints on the property define the range of values
that may be assigned
                         to this property.
                     </dd>
-                    <dt>Default Value</dt>
+                    <dt><strong>Default Value</strong></dt>
                     <dd>
                         The value that the property will have if it is auto-created.
                     </dd>
-                    <dt>Auto-create Status</dt>
+                    <dt><strong>Auto-create Status</strong></dt>
                     <dd>
                         Whether this property will be auto-created when its parent node is
created. Only properties
                         with a default value can be auto-created.
                     </dd>
-                    <dt>Mandatory Status</dt>
+                    <dt><strong>Mandatory Status</strong></dt>
                     <dd>
                         A mandatory property is one that must exist. If a node of a type
that specifies a
                         mandatory property is created then any attempt to save that node
without
@@ -151,17 +151,17 @@
                         single-value property must have a value. A mandatory multi-value
property on the other hand
                         may have zero or more values.
                     </dd>
-                    <dt>On-Parent-Version Status</dt>
+                    <dt><strong>On-Parent-Version Status</strong></dt>
                     <dd>
                         The onParentVersion status of specifies what happens to this property
if a
                         new version of its parent node is created (ie, a checked-in is done
on it).
                     </dd>
-                    <dt>Protected Status</dt>
+                    <dt><strong>Protected Status</strong></dt>
                     <dd>
                         A protected property is one which cannot be modified
                         (ie, have child nodes or properties added or removed) or removed
from its parent through the JCR API.
                     </dd>
-                    <dt>Multiple Values Status</dt>
+                    <dt><strong>Multiple Values Status</strong></dt>
                     <dd>
                         Whether this property can have multiple values, meaning that it stores
an array of values,
                         not just one. Note that this "multiple values" flag is special in
that a given node type
@@ -177,13 +177,13 @@
                     A child node definition (within a node type definition) contains the
the following information:
                 </p>
                 <dl>
-                    <dt>Name</dt>
+                    <dt><strong>Name</strong></dt>
                     <dd>
                         The name of the child node to which this definition applies or '*'
if this definition is
                         a "residual definition', meaning that it applies to any additional
child nodes with any
                         names apart from those otherwise defined in this node type.
                     </dd>
-                    <dt>Required Primary Types</dt>
+                    <dt><strong>Required Primary Types</strong></dt>
                     <dd>
                         If it specifies only a single
                         node type N then the primary node type of this child node must be
N or a subtype
@@ -192,32 +192,32 @@
                         is possible because Jackrabbit supports multiple inheritance among
node types and that each
                         node still has one and only one primary node type.
                     </dd>
-                    <dt>Default Primary Type</dt>
+                    <dt><strong>Default Primary Type</strong></dt>
                     <dd>
                         This is the primary node type automatically
                         assigned if no node type information is specified when the node is
created.
                     </dd>
-                    <dt>Auto-create Status</dt>
+                    <dt><strong>Auto-create Status</strong></dt>
                     <dd>
                         Governs whether this child node will be auto-created when its parent
node is created.
                     </dd>
-                    <dt>Mandatory Status</dt>
+                    <dt><strong>Mandatory Status</strong></dt>
                     <dd>
                         Governs whether the child node is mandatory. A mandatory child node
is one that must exist. If a
                         mandatory child node is missing from a parent node then save on the
parent node will fail.
                     </dd>
-                    <dt>On-Parent-Version Status</dt>
+                    <dt><strong>On-Parent-Version Status</strong></dt>
                     <dd>
                         This specifies what to do with the child node if
                         its parent node is versioned.
                     </dd>
-                    <dt>Protected Status</dt>
+                    <dt><strong>Protected Status</strong></dt>
                     <dd>
                         This governs whether the child node is protected. A protected node
is one which cannot be
                         modified (have child node or properties added to it or removed from
it) or be removed from its
                         parent through the JCR API.
                     </dd>
-                    <dt>Same-Name Siblings Status</dt>
+                    <dt><strong>Same-Name Siblings Status</strong></dt>
                     <dd>
                         This governs whether this child node can have same-name siblings,
meaning that the parent node
                         can have more than one child node of this name.
@@ -286,7 +286,6 @@
         }
     }
 }]]></source>
-            <br/>
             <br/>
             <a href="cnd.html"><strong>Continue to Node Type Notation</strong></a>
         </section>



Mime
View raw message