Wiki source code of JCR Storage
Last modified by Vincent Massol on 2024/11/19 16:12
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{toc start='2'/}} | ||
| 2 | |||
| 3 | == Goal == | ||
| 4 | |||
| 5 | XWiki works on [[Java Content Repository>>http://jcp.org/en/jsr/detail?id=283]]. | ||
| 6 | |||
| 7 | == JCR node hierarchy == | ||
| 8 | |||
| 9 | {{html clean="false" wiki="true"}} | ||
| 10 | Similar to [[Design.AlternativePageStore]] and [[Design.WebDAV Service]]. format: node or property name (jcr node type). | ||
| 11 | * {{code}}<wikiname> (jcr workspace) = single xwiki in multiwiki setup.{{/code}} | ||
| 12 | ** {{code}}/ (jcr:root){{/code}} | ||
| 13 | *** {{code}}<space> (xwiki:space){{/code}} | ||
| 14 | **** {{code}}<documentName> (xwiki:document){{/code}} | ||
| 15 | ***** {{code}}<document properties>{{/code}} | ||
| 16 | ***** {{code}}objects{{/code}} | ||
| 17 | ****** {{code}}<class.name>{{/code}} | ||
| 18 | ******* {{code}}<number> (xwiki:object){{/code}} | ||
| 19 | ******** {{code}}<object properties>{{/code}} | ||
| 20 | ***** {{code}}attachments{{/code}} | ||
| 21 | ****** {{code}}<filename> (xwiki:attachment extends [[nt:file>>http://wiki.apache.org/jackrabbit/nt%3afile]]){{/code}} | ||
| 22 | ***** {{code}}translations{{/code}} | ||
| 23 | ****** {{code}}<language> (xwiki:document){{/code}} | ||
| 24 | ***** {{code}}lock (xwiki:lock){{/code}} | ||
| 25 | ****** {{code}}author{{/code}} | ||
| 26 | ****** {{code}}date{{/code}} | ||
| 27 | |||
| 28 | == Store classes == | ||
| 29 | |||
| 30 | * use value objects for storage (from xwiki data model proposal: [[sandbox/org.xwiki.model>>http://svn.xwiki.org/svnroot/xwiki/sandbox/org.xwiki.model/]]): org.xwiki.store.value.DocumentValue, ObjectValue, etc | ||
| 31 | ** value objects allow us to eliminate xwiki-core dependency in jcrstore. we can reuse value objects in new data model later as in sandbox/org.xwiki.model | ||
| 32 | * put all storage specific code in DAO classes: DocumentDAO, ObjectDAO, etc | ||
| 33 | * Implement a clean xwiki stores with only business code and delegate storage specific code to DAO classes | ||
| 34 | * convert value objects to/from xwiki business objects: org.xwiki.store.value.ValueConverter, DocumentValue <-> XWikiDocument, etc. | ||
| 35 | |||
| 36 | == JCR specific code == | ||
| 37 | |||
| 38 | Many ideas are from [[springmodules-jcr>>https://springmodules.dev.java.net/docs/reference/0.9/html/jcr.html]]. | ||
| 39 | |||
| 40 | * RepositoryProvider provides a jcr repository. | ||
| 41 | * SessionFactory create/manage jcr sessions. | ||
| 42 | * JcrTemplate execute jcr code via callbacks/closures. | ||
| 43 | |||
| 44 | == Quering == | ||
| 45 | |||
| 46 | Use our QueryManager for quering. Add JCRSQL2 language to it. | ||
| 47 | Translate [[XWQL>>Design.XWiki Query Language]] to JCRSQL2. | ||
| 48 | |||
| 49 | == Problems == | ||
| 50 | |||
| 51 | * XWQL needs JCRSQL2 query language from JCRv2. JCRv1 has very limited quering power. But JCRv2 is late. Release was planed at September 2008. | ||
| 52 | ** Without XWQL/JCRSQL2 it is almost impossible to run xwiki on jcr because it contains very much queries which need to be rewritten on xpath (not always possible). | ||
| 53 | |||
| 54 | == Status == | ||
| 55 | |||
| 56 | * JcrStore prototype located in [[sandbox/jcrstore>>http://svn.xwiki.org/svnroot/xwiki/sandbox/jcrstore/]] | ||
| 57 | ** Contains DefaultStore, basic JCR and InMemory DAOs, some tests of it on jackrabbit. | ||
| 58 | |||
| 59 | {{/html}} |