You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2016/07/29 12:33:42 UTC
svn commit: r1754506 -
/sling/site/trunk/content/documentation/bundles/repository-initialization.mdtext
Author: bdelacretaz
Date: Fri Jul 29 12:33:42 2016
New Revision: 1754506
URL: http://svn.apache.org/viewvc?rev=1754506&view=rev
Log:
Add register namespaces and nodetypes example statements
Modified:
sling/site/trunk/content/documentation/bundles/repository-initialization.mdtext
Modified: sling/site/trunk/content/documentation/bundles/repository-initialization.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/repository-initialization.mdtext?rev=1754506&r1=1754505&r2=1754506&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/repository-initialization.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/repository-initialization.mdtext Fri Jul 29 12:33:42 2016
@@ -21,7 +21,8 @@ They are called in increasing order of t
If any of them throws an Exception, the `SlingRepository` service is not registered.
## The 'repoinit' Repository Initialization Language
-The `org.apache.sling.repoinit.parser` implements a mini-language meant to create paths, service users and Access Control Lists in a content repository.
+The `org.apache.sling.repoinit.parser` implements a mini-language meant to create paths, service users and Access Control Lists in a content repository, as
+well as registering JCR namespaces and node types.
The language grammar is defined (using the JavaCC compiler-compiler, which has no runtime dependencies) in the `RepoInitGrammar.jjt` file in that module, and the automated tests provide a number of [test cases](https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/parser/src/test/resources/testcases) which demonstrate various features.
@@ -29,7 +30,7 @@ The companion `org.apache.sling.jcr.repo
registered by default with a service ranking of 100. It also provides a `JcrRepoInitOpsProcessor` service to explicitly apply the output
of the repoinit parser to a JCR repository.
-Here's a current example from the test cases mentioned above, that uses all language features as of version 1.0.0 of the parser module.
+Here's a current example from the test cases mentioned above, that uses all language features as of version 1.0.2 of the parser module.
The language is self-explaining but please refer to the actual test cases for details that are guaranteed to be up to date, assuming the tests pass.
@@ -61,6 +62,24 @@ The language is self-explaining but plea
deny jcr:write on /content/example.com
deny jcr:all on / nodetypes example:Page
end
+
+ # register namespace requires
+ # o.a.s.repoinit.parser 1.0.4
+ # and o.a.s.jcr.repoinit 1.0.2
+ register namespace ( NSprefix ) uri:someURI/v1.42
+
+ # register nodetypes in CND format
+ # (same bundle requirements as register namespaces)
+ # The optional << markers are used when embedding
+ # this in a Sling provisioning model, to avoid syntax errors
+ register nodetypes
+ <<===
+ << <slingevent='http://sling.apache.org/jcr/event/1.0'>
+ <<
+ << [slingevent:Event] > nt:unstructured, nt:hierarchyNode
+ << - slingevent:topic (string)
+ << - slingevent:properties (binary)
+ ===>>
create service user the-last-one