r1389 - in xwiki/trunk: . core/src/main/java/com/xpn/xwiki/plugin/query core/src/main/java/com/xpn/xwiki/store/jcr core/src/main/resources core/src/main/resources/jackrabbit lib src/main/xwiki/jcrdb/Blog src/main/xwiki/jcrdb/Main src/main/xwiki/jcrdb/XWiki src/test/resources src/test/resources/jackrabbit
Artem Melentev
amelentev at users.forge.objectweb.org
Sat Oct 14 04:39:18 CEST 2006
Author: amelentev
Date: 2006-10-14 04:39:17 +0200 (Sat, 14 Oct 2006)
New Revision: 1389
Added:
xwiki/trunk/core/src/main/resources/jackrabbit/
xwiki/trunk/core/src/main/resources/jackrabbit/nodetypes.cnd
xwiki/trunk/core/src/main/resources/jackrabbit/repository.xml
xwiki/trunk/core/src/main/resources/jcrmapping.xml
xwiki/trunk/lib/derby-10.1.3.1.jar
xwiki/trunk/lib/jackrabbit-core-1.1.jar
Removed:
xwiki/trunk/lib/derby-10.1.2.1.jar
xwiki/trunk/lib/jackrabbit-core-1.0.1.jar
xwiki/trunk/lib/jackrabbit-jcr-commons-1.0.1.jar
Modified:
xwiki/trunk/build.xml
xwiki/trunk/core/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java
xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrBaseStore.java
xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrStore.java
xwiki/trunk/src/main/xwiki/jcrdb/Blog/Macros
xwiki/trunk/src/main/xwiki/jcrdb/Main/WebRss
xwiki/trunk/src/main/xwiki/jcrdb/Main/WebSearch
xwiki/trunk/src/main/xwiki/jcrdb/XWiki/ArticleClass
xwiki/trunk/src/main/xwiki/jcrdb/XWiki/BlogRssCode
xwiki/trunk/src/test/resources/jackrabbit/nodetypes.cnd
xwiki/trunk/src/test/resources/jackrabbit/repository.xml
xwiki/trunk/src/test/resources/jcrmapping.xml
Log:
XWikiJcrStore:
object properties moved from obj/xp:prop/@value to obj/@xp:prop
fixed jcrdb
update jackrabbit 1.1
Modified: xwiki/trunk/build.xml
===================================================================
--- xwiki/trunk/build.xml 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/build.xml 2006-10-14 02:39:17 UTC (rev 1389)
@@ -153,7 +153,7 @@
mail-1.4.jar,
ical4j-0.9.19M.jar,
flickrapi-1.0a7.jar,
- jackrabbit-core-1.0.1.jar,jackrabbit-jcr-commons-1.0.1.jar,jcr-1.0.jar,graffito-jcr-mapping-1.0-a1-amelentev-dev.jar,slf4j-log4j12-1.0.1.jar,derby-10.1.2.1.jar,lucene-1.4.3.jar,
+ jackrabbit-core-1.1.jar,jcr-1.0.jar,graffito-jcr-mapping-1.0-a1-amelentev-dev.jar,slf4j-log4j12-1.0.1.jar,derby-10.1.3.1.jar,lucene-1.4.3.jar,
ant-1.6.5.jar,
ws-commons-java5-1.0.1.jar,
ws-commons-util-1.0.1.jar,
@@ -163,7 +163,8 @@
jgroups-2.2.9.3.jar,
jfreechart-1.0.0-rc1.jar,
jcommon-1.0.5.jar,
- jcaptcha-all-1.0.jar"/>
+ jcaptcha-all-1.0.jar
+ jdbc3-postgresql.jar"/>
<fileset id="libs.servlet.fileset" dir="${lib.dir}"
includes="servlet-api-2.4.jar" />
Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java 2006-10-14 02:39:17 UTC (rev 1389)
@@ -22,28 +22,29 @@
package com.xpn.xwiki.plugin.query;
+import java.util.List;
+import java.util.Set;
+
+import javax.jcr.ValueFactory;
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.query.Query;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.core.query.QueryParser;
+import org.apache.jackrabbit.core.query.QueryRootNode;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
+
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.XWikiException;
import com.xpn.xwiki.api.Api;
import com.xpn.xwiki.objects.classes.BaseClass;
-import com.xpn.xwiki.objects.classes.PropertyClass;
import com.xpn.xwiki.plugin.XWikiDefaultPlugin;
import com.xpn.xwiki.plugin.XWikiPluginInterface;
import com.xpn.xwiki.store.XWikiStoreInterface;
import com.xpn.xwiki.store.jcr.XWikiJcrStore;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jackrabbit.core.query.QueryParser;
-import org.apache.jackrabbit.core.query.QueryRootNode;
-import org.apache.jackrabbit.value.ValueFactoryImpl;
-import javax.jcr.ValueFactory;
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.query.Query;
-import java.util.List;
-import java.util.Set;
-
/** Plugin for Query API */
public class QueryPlugin extends XWikiDefaultPlugin implements IQueryFactory {
private static final Log log = LogFactory.getLog(QueryPlugin.class);
@@ -72,7 +73,7 @@
ValueFactory valueFactory = null;;
public ValueFactory getValueFactory() {
if (valueFactory==null) {
- valueFactory = new ValueFactoryImpl();
+ valueFactory = ValueFactoryImpl.getInstance();
}
return valueFactory;
}
Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrBaseStore.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrBaseStore.java 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrBaseStore.java 2006-10-14 02:39:17 UTC (rev 1389)
@@ -125,8 +125,13 @@
out.print("@ "+property.getName() + " = ");
if (property.getDefinition().isMultiple())
out.print("'"+property.getValues()+"'");
- else
- out.print("'"+property.getValue().getString()+"'");
+ else {
+ String s = property.getValue().getString();
+ if (s.length() > 50)
+ out.print("...");
+ else
+ out.print("'"+s+"'");
+ }
out.println(" - " + property.getType());
}
});
@@ -181,7 +186,7 @@
}
}
protected String getBaseDocPath(XWikiDocument doc) {
- return "/store/"+ encode(doc.getWeb()) + '/' + encode( ( doc.getName() ) );
+ return "/store/"+ encode(doc.getSpace()) + '/' + encode( ( doc.getName() ) );
}
protected String getDocPath(XWikiDocument doc) {
String s = getBaseDocPath(doc);
Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrStore.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrStore.java 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/store/jcr/XWikiJcrStore.java 2006-10-14 02:39:17 UTC (rev 1389)
@@ -21,6 +21,37 @@
*/
package com.xpn.xwiki.store.jcr;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.jcr.ItemExistsException;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFactory;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.query.InvalidQueryException;
+import javax.jcr.query.Query;
+import javax.jcr.query.Row;
+import javax.jcr.query.RowIterator;
+import javax.jcr.version.VersionException;
+import javax.transaction.NotSupportedException;
+
+import org.apache.portals.graffito.jcr.query.Filter;
+import org.apache.portals.graffito.jcr.query.QueryManager;
+
import com.xpn.xwiki.XWiki;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.XWikiException;
@@ -32,27 +63,22 @@
import com.xpn.xwiki.objects.BaseCollection;
import com.xpn.xwiki.objects.BaseObject;
import com.xpn.xwiki.objects.BaseProperty;
+import com.xpn.xwiki.objects.BaseStringProperty;
+import com.xpn.xwiki.objects.DBStringListProperty;
+import com.xpn.xwiki.objects.DateProperty;
+import com.xpn.xwiki.objects.DoubleProperty;
+import com.xpn.xwiki.objects.FloatProperty;
+import com.xpn.xwiki.objects.IntegerProperty;
+import com.xpn.xwiki.objects.ListProperty;
+import com.xpn.xwiki.objects.LongProperty;
+import com.xpn.xwiki.objects.StringListProperty;
import com.xpn.xwiki.objects.classes.BaseClass;
import com.xpn.xwiki.objects.classes.PropertyClass;
import com.xpn.xwiki.render.XWikiRenderer;
import com.xpn.xwiki.stats.impl.XWikiStats;
import com.xpn.xwiki.store.XWikiStoreInterface;
import com.xpn.xwiki.util.Util;
-import org.apache.portals.graffito.jcr.query.Filter;
-import org.apache.portals.graffito.jcr.query.QueryManager;
-import javax.jcr.*;
-import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.query.InvalidQueryException;
-import javax.jcr.query.Query;
-import javax.jcr.query.Row;
-import javax.jcr.query.RowIterator;
-import javax.jcr.version.VersionException;
-import javax.transaction.NotSupportedException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.*;
-
/** XWikiJCRStore - XWiki Store System backend to JCR */
public class XWikiJcrStore extends XWikiJcrBaseStore implements XWikiStoreInterface {
public XWikiJcrStore(XWiki xwiki, XWikiContext context) throws SecurityException, IllegalArgumentException, NoSuchMethodException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, XWikiException {
@@ -116,7 +142,7 @@
executeWrite(context, new JcrCallBack() {
public Object doInJcr(XWikiJcrSession ses) throws RepositoryException, XWikiException {
Node storeNode = ses.getStoreNode();
- Node spaceNode = JcrUtil.getOrCreateSubNode(storeNode, doc.getWeb(), ntXWikiSpace);
+ Node spaceNode = JcrUtil.getOrCreateSubNode(storeNode, doc.getSpace(), ntXWikiSpace);
String docNodeName = doc.getName();
String docLang = doc.getLanguage();
if (docLang!=null) {
@@ -125,16 +151,32 @@
docNodeName += "." + docLang;
}
Node docNode = JcrUtil.getOrCreateSubNode(spaceNode, docNodeName, ntXWikiDocument);
- Node baseDocNode = JcrUtil.getOrCreateSubNode(spaceNode, doc.getName(), ntXWikiDocument);
- Node attachNode = JcrUtil.getOrCreateSubNode(docNode, "attach", ntXWikiAttachments);
+ Node baseDocNode = JcrUtil.getOrCreateSubNode(spaceNode, doc.getName(), ntXWikiDocument);
ses.updateObject(docNode, doc);
- NodeIterator ni = attachNode.getNodes();
- while (ni.hasNext()) {
- ni.nextNode().setProperty("doc", docNode);
+ if (doc.hasElement(XWikiDocument.HAS_ATTACHMENTS)) {
+ Node nattachs = JcrUtil.getOrCreateSubNode(baseDocNode, "attach", ntXWikiAttachments);
+ Iterator it = doc.getAttachmentList().iterator();
+ Set attachset = new HashSet();
+ while (it.hasNext()) {
+ XWikiAttachment att = (XWikiAttachment) it.next();
+ attachset.add( att.getFilename() );
+ Node natt = JcrUtil.getOrCreateSubNode(nattachs, att.getFilename(), ntXWikiAttachment);
+ ses.updateObject(natt, att);
+ natt.setProperty("doc", baseDocNode);
+ }
+ NodeIterator ni = nattachs.getNodes();
+ while (ni.hasNext()) {
+ Node natt = ni.nextNode();
+ if (!attachset.contains(natt.getName()))
+ natt.remove();
+ }
+ } else {
+ try {
+ baseDocNode.getNode("attach").remove();
+ } catch (PathNotFoundException e) {};
}
- // Not needed: Remove objects planned for removal
doc.setObjectsToRemove(new ArrayList());
if (bclass!=null) {
bclass.setName(doc.getFullName());
@@ -206,12 +248,12 @@
String oclassname = object.getClassName();
int i = oclassname.lastIndexOf(".");
- String oweb = oclassname.substring(0, i);
+ String ospace = oclassname.substring(0, i);
String oname = oclassname.substring(i+1);
Node wnode = docnode;
wnode = JcrUtil.getOrCreateSubNode(wnode, "obj", ntXWikiObjects);
- if (!"".equals(oweb)) // if className = internal, then save to .../doc/obj/internal
- wnode = JcrUtil.getOrCreateSubNode(wnode, oweb, ntXWikiSpaceObject);
+ if (!"".equals(ospace)) // if className = internal, then save to .../doc/obj/internal
+ wnode = JcrUtil.getOrCreateSubNode(wnode, ospace, ntXWikiSpaceObject);
Node onode;
if (stats)
onode = ses.insertObject(wnode, oname, object);
@@ -243,22 +285,25 @@
"Exception while saving object {0}", e, args);
}
}
- private BaseObject loadXWikiCollection(XWikiJcrSession ses, Node nobj, XWikiContext context) throws RepositoryException, XWikiException {
+ private BaseObject loadXWikiCollection(XWikiJcrSession ses, Node nobj, BaseClass bclass, XWikiContext context) throws RepositoryException, XWikiException {
BaseObject object = (BaseObject) ses.loadObject(nobj.getPath());
- if (!object.getClassName().equals("")) {
- BaseObject newobject = BaseClass.newCustomClassInstance(object.getClassName(), context);
- if (newobject!=null) {
- newobject.setId(object.getId());
- newobject.setClassName(object.getClassName());
- newobject.setName(object.getName());
- newobject.setNumber(object.getNumber());
- object = newobject;
- }
- }
- NodeIterator npi = nobj.getNodes(); // properties
- while (npi.hasNext()) {
- Node nprop = npi.nextNode();
- BaseProperty prop = loadXWikiProperty(ses, nprop);
+ BaseObject newobject = (BaseObject) bclass.newObject(context);
+ newobject.setId(object.getId());
+ newobject.setClassName(bclass.getName());
+ newobject.setNumber(object.getNumber());
+ object = newobject;
+ PropertyIterator pi = nobj.getProperties();
+ while (pi.hasNext()) {
+ Property iprop = pi.nextProperty();
+ String sprop = iprop.getName();
+ if (!sprop.startsWith("xp:"))
+ continue;
+ int ind = sprop.indexOf(':');
+ sprop = sprop.substring(ind+1);
+ PropertyClass pc = (PropertyClass) bclass.get(sprop);
+ BaseProperty prop = pc.newProperty();
+ prop.setName(sprop);
+ loadXWikiProperty(ses, iprop, prop);
prop.setObject(object);
object.addField(prop.getName(), prop);
}
@@ -266,17 +311,76 @@
}
private void saveXWikiProperty(XWikiJcrSession ses, Node objnode, BaseProperty prop) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException {
- Node propNode = ses.insertObject(objnode, "xp:"+prop.getName(), prop);
- propNode.setProperty("obj", objnode);
+ if (prop.getValue()==null) return;
+ final String propname = "xp:"+prop.getName();
+ final ValueFactory vf = ses.getValueFactory();
+ if (prop instanceof BaseStringProperty) {
+ objnode.setProperty(propname, (String)prop.getValue());
+ } else if (DateProperty.class.equals(prop)) {
+ Date date = (Date) prop.getValue();
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ objnode.setProperty(propname, vf.createValue(cal));
+ } else if (IntegerProperty.class.equals(prop.getClass())
+ || LongProperty.class.equals(prop.getClass())) {
+ objnode.setProperty(propname, vf.createValue(
+ ((Number)prop.getValue()).longValue()
+ ));
+ } else if (FloatProperty.class.equals(prop.getClass())
+ || DoubleProperty.class.equals(prop.getClass())) {
+ objnode.setProperty(propname, vf.createValue(
+ ((Number)prop.getValue()).doubleValue()
+ ));
+ } else if (StringListProperty.class.equals(prop.getClass())) {
+ objnode.setProperty(propname, vf.createValue(
+ ((StringListProperty) prop).getTextValue()
+ ));
+ } else if (DBStringListProperty.class.equals(prop.getClass())) {
+ List list = ((DBStringListProperty) prop).getList();
+ Value[] v = new Value[ list.size() ];
+ for (int i=0; i<list.size(); i++)
+ v[i] = vf.createValue((String)list.get(i));
+ objnode.setProperty(propname, v);
+ }
+ /*was: Node propNode = ses.insertObject(objnode, "xp:"+prop.getName(), prop);
+ propNode.setProperty("obj", objnode);*/
}
- private BaseProperty loadXWikiProperty(XWikiJcrSession ses, Node nprop) throws RepositoryException {
- BaseProperty prop = (BaseProperty) ses.loadObject(nprop.getPath());
+ private void loadXWikiProperty(XWikiJcrSession ses, Property iprop, BaseProperty prop) throws RepositoryException {
+ if (prop instanceof BaseStringProperty) {
+ prop.setValue(
+ iprop.getString());
+ } else if (DateProperty.class.equals(prop)) {
+ prop.setValue(
+ iprop.getDate().getTime());
+ } else if (IntegerProperty.class.equals(prop.getClass())) {
+ prop.setValue(
+ new Integer((int) iprop.getLong()));
+ } else if (LongProperty.class.equals(prop.getClass())) {
+ prop.setValue(
+ new Long(iprop.getLong()));
+ } else if (FloatProperty.class.equals(prop.getClass())) {
+ prop.setValue(
+ new Float(iprop.getDouble()));
+ } else if (DoubleProperty.class.equals(prop.getClass())) {
+ prop.setValue(
+ new Double(iprop.getDouble()));
+ } else if (StringListProperty.class.equals(prop.getClass())) {
+ ((StringListProperty)prop).setTextValue(
+ iprop.getString() );
+ } else if (DBStringListProperty.class.equals(prop.getClass())) {
+ Value[] v = iprop.getValues();
+ List list = new ArrayList(v.length);
+ for (int i=0; i<v.length; i++)
+ list.add(v[i].getString());
+ ((ListProperty)prop).setList(list);
+ }
+ /*was: BaseProperty prop = (BaseProperty) ses.loadObject(nprop.getPath());
final String sname = nprop.getName();
int ip = sname.indexOf(":");
if (ip<0)
return null;
prop.setName( decode( sname.substring(ip+1) ) );
- return prop;
+ return prop;*/
}
public XWikiDocument loadXWikiDoc(final XWikiDocument doc, final XWikiContext context) throws XWikiException {
@@ -292,19 +396,26 @@
retdoc.setStore(context.getWiki().getStore());
retdoc.setDatabase(context.getDatabase());
retdoc.setNew(false);
- if (retdoc.getAttachmentList()==null)
- retdoc.setAttachmentList(new ArrayList());
- Iterator it = retdoc.getAttachmentList().iterator();
- while (it.hasNext()) {
- XWikiAttachment att = (XWikiAttachment) it.next();
- att.setDoc(retdoc);
- }
} else {
doc.setNew(true);
return doc;
}
- Node baseDocNode = ses.getNode(getBaseDocPath(doc));
- //TODO: handle the case where there are no xWikiClass and xWikiObject in the Database
+ Node baseDocNode = ses.getNode(getBaseDocPath(retdoc));
+
+ if (retdoc.hasElement(XWikiDocument.HAS_ATTACHMENTS)) {
+ List attlist = new ArrayList();
+ NodeIterator ni = baseDocNode.getNode("attach").getNodes();
+ while (ni.hasNext()) {
+ Node natt = ni.nextNode();
+ XWikiAttachment att = (XWikiAttachment) ses.loadObject(natt.getPath());
+ att.setFilename(natt.getName());
+ att.setDoc(retdoc);
+ attlist.add(att);
+ }
+ retdoc.setAttachmentList(attlist);
+ } else
+ retdoc.setAttachmentList(new ArrayList(0));
+
BaseClass bclass = new BaseClass();
String cxml = retdoc.getxWikiClassXML();
if (cxml!=null) {
@@ -324,8 +435,8 @@
// Store this XWikiClass in the context so that we can use it in case of recursive usage of classes
context.addBaseClass(bclass);
- if (doc.hasElement(XWikiDocument.HAS_OBJECTS)) {
- Node nobjs = JcrUtil.getOrCreateSubNode(baseDocNode, "obj", ntXWikiObjects);
+ if (retdoc.hasElement(XWikiDocument.HAS_OBJECTS)) {
+ Node nobjs = baseDocNode.getNode("obj");
NodeIterator nsi = nobjs.getNodes(); // spaces
while (nsi.hasNext()) {
Node nspace = nsi.nextNode();
@@ -335,8 +446,9 @@
NodeIterator noi = nspace.getNodes(); // objects
while (noi.hasNext()) {
Node nobj = noi.nextNode();
- BaseObject object = loadXWikiCollection(ses, nobj, context);
- object.setName(doc.getFullName());
+ BaseClass objclass = context.getWiki().getClass(nspace.getName() + "." + nobj.getName(), context);
+ BaseObject object = loadXWikiCollection(ses, nobj, objclass, context);
+ object.setName(retdoc.getFullName());
retdoc.setObject(object.getClassName(), object.getNumber(), object);
}
}
@@ -588,7 +700,7 @@
public Object doInJcr(XWikiJcrSession session) throws Exception {
Filter filter = session.getObjectQueryManager().createFilter(XWikiDocument.class);
filter.addEqualTo("name", doc.getName());
- filter.addEqualTo("web", doc.getWeb());
+ filter.addEqualTo("space", doc.getSpace());
filter.addNotEqualTo("language", "");
return searchStringAttribute(session, filter, "language");
}
@@ -651,7 +763,7 @@
return (List) executeRead(context, new JcrCallBack(){
public Object doInJcr(XWikiJcrSession session) throws Exception {
Filter filter = session.getObjectQueryManager().createFilter(XWikiDocument.class)
- .addEqualTo("web", spaceName);
+ .addEqualTo("space", spaceName);
return searchStringAttribute(session, filter, "name");
}
});
@@ -666,12 +778,12 @@
executeRead(context, new JcrCallBack(){
public Object doInJcr(XWikiJcrSession session) throws Exception {
// XXX: if username contains "'" ?
- String xpath = "store/*/*/obj/XWiki/XWikiGroups/xp:member[@value='"+username+"' or @value='"+shortname+"']";
+ String xpath = "store/*/*/obj/XWiki/XWikiGroups[@xp:member='"+username+"' or @xp:member='"+shortname+"']/jcr:deref(@doc, '*')/@fullName";
Query query = session.getQueryManager().createQuery(xpath, Query.XPATH);
- NodeIterator ni = query.execute().getNodes();
+ RowIterator ni = query.execute().getRows();
while (ni.hasNext()) {
- Node docnode = ni.nextNode().getParent().getParent().getParent().getParent();
- result.add(docnode.getParent().getName() + "." + docnode.getName());
+ Row row = ni.nextRow();
+ result.add(row.getValues()[0].getString());
}
return null;
}
@@ -681,6 +793,44 @@
throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_JCR_OTHER, "Exception while listGroupsForUser", e);
}
}
+ //
+ public List getAllObjectsByClass(final Class cl, XWikiContext context) throws XWikiException {
+ QueryManager qm = getObjectQueryManager(context);
+ return getObjects( qm.createQuery( qm.createFilter(cl) ), context );
+ }
+ public QueryManager getObjectQueryManager(XWikiContext context) throws XWikiException {
+ // TODO: store query manager in class.
+ try {
+ return (QueryManager) executeRead(context, new JcrCallBack() {
+ public Object doInJcr(XWikiJcrSession session) throws Exception {
+ return session.getObjectQueryManager();
+ }
+ });
+ } catch (Exception e) {
+ throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_JCR_OTHER, "Exception while getObjectQueryManager", e);
+ }
+ }
+
+ public List getObjects(final org.apache.portals.graffito.jcr.query.Query query, XWikiContext context) throws XWikiException {
+ final List result = new ArrayList();
+ try {
+ executeRead(context, new JcrCallBack() {
+ public Object doInJcr(XWikiJcrSession session) throws Exception {
+ String xpath = session.getObjectQueryManager().buildJCRExpression(query);
+ NodeIterator ni = session.getQueryManager().createQuery(xpath, Query.XPATH).execute().getNodes();
+ while (ni.hasNext()) {
+ Node node = ni.nextNode();
+ Object object = session.loadObject(node.getPath());
+ result.add(object);
+ }
+ return null;
+ }
+ });
+ } catch (Exception e) {
+ throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_JCR_OTHER, "Exception while getObjects", e);
+ }
+ return result;
+ }
public void notSupportedCall() {
new NotSupportedException().printStackTrace();
@@ -772,43 +922,5 @@
public List search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context) throws XWikiException {
notSupportedCall();
return null;
- }
- //
- public List getAllObjectsByClass(final Class cl, XWikiContext context) throws XWikiException {
- QueryManager qm = getObjectQueryManager(context);
- return getObjects( qm.createQuery( qm.createFilter(cl) ), context );
- }
- public QueryManager getObjectQueryManager(XWikiContext context) throws XWikiException {
- // TODO: store query manager in class.
- try {
- return (QueryManager) executeRead(context, new JcrCallBack() {
- public Object doInJcr(XWikiJcrSession session) throws Exception {
- return session.getObjectQueryManager();
- }
- });
- } catch (Exception e) {
- throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_JCR_OTHER, "Exception while getObjectQueryManager", e);
- }
- }
-
- public List getObjects(final org.apache.portals.graffito.jcr.query.Query query, XWikiContext context) throws XWikiException {
- final List result = new ArrayList();
- try {
- executeRead(context, new JcrCallBack() {
- public Object doInJcr(XWikiJcrSession session) throws Exception {
- String xpath = session.getObjectQueryManager().buildJCRExpression(query);
- NodeIterator ni = session.getQueryManager().createQuery(xpath, Query.XPATH).execute().getNodes();
- while (ni.hasNext()) {
- Node node = ni.nextNode();
- Object object = session.loadObject(node.getPath());
- result.add(object);
- }
- return null;
- }
- });
- } catch (Exception e) {
- throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_JCR_OTHER, "Exception while getObjects", e);
- }
- return result;
- }
+ }
}
Added: xwiki/trunk/core/src/main/resources/jackrabbit/nodetypes.cnd
===================================================================
--- xwiki/trunk/core/src/main/resources/jackrabbit/nodetypes.cnd 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/core/src/main/resources/jackrabbit/nodetypes.cnd 2006-10-14 02:39:17 UTC (rev 1389)
@@ -0,0 +1,108 @@
+// XWiki JCR node types definition
+// Compact Namespace and Node Type Definition (CND) - http://jackrabbit.apache.org/doc/nodetype/cnd.html
+
+<xwiki = 'http://www.xwiki.org'>
+<graffito = 'http://incubator.apache.org/graffito'>
+
+[graffito:discriminator] > nt:base
+ mixin
+ - graffito:classname (string) mandatory
+
+// \[<Node type name>\] > [<Supertypes>]
+[xwiki:root]
+ // + Child nodes: <name> (<classes>)[ = <default class>]
+ + store (xwiki:store)
+
+[xwiki:store]
+ + * (xwiki:space) = xwiki:space
+
+[xwiki:space]
+ + * (xwiki:document) = xwiki:document
+
+[xwiki:document] > nt:base, mix:referenceable
+ // - <property> (<class>) = <defval>
+ // node name = doc.name + "." + language
+ // parent node name = doc.space
+ - name (string)
+ - space (string)
+ - fullName (string)
+ - id (long)
+ - title (string)
+ - language (string)
+ - defaultLanguage (string)
+ - translation (long)
+ - date (date)
+ - contentUpdateDate (date)
+ - creationDate (date)
+ - author (string) = 'XWiki.XWikiGuest'
+ - contentAuthor (string) = 'XWiki.XWikiGuest'
+ - creator (string) = 'XWiki.XWikiGuest'
+ - content (string)
+ - archive (string)
+ - version (string)
+ - parent (string)
+ - xWikiClassXML (string)
+ - elements (long)
+ - defaultTemplate (string)
+ + class (xwiki:class) = xwiki:class
+ + obj (xwiki:objects) = xwiki:objects
+ + attach (xwiki:attachments) = xwiki:attachments
+ + lock (xwiki:lock) = xwiki:lock
+ + links (xwiki:links) = xwiki:links
+
+[xwiki:attachments]
+ + * (xwiki:attachment) = xwiki:attachment
+
+[xwiki:attachment] > nt:base, mix:referenceable
+ - filesize (long)
+ - author (string) = 'XWiki.XWikiGuest'
+ - version (string) = '1.1'
+ - comment (string)
+ - date (date)
+ - doc (reference)
+ + content (xwiki:attachmentContent) = xwiki:attachmentContent
+ + archive (xwiki:attachmentArchive) = xwiki:attachmentArchive
+
+[xwiki:attachmentContent]
+ - jcr:data (binary)
+ - attach (reference)
+
+[xwiki:attachmentArchive] > xwiki:attachmentContent
+
+[xwiki:class] > nt:base
+ // name = parent(document) node name
+ - customClass (string)
+ + * (xwiki:propertyClass) = xwiki:propertyClass
+
+[xwiki:propertyClass] > nt:unstructured
+ // name = node name
+ - prettyname (string)
+ - unmodifiable (boolean) = false
+ - number (long) // TODO: orderable xwiki:propertyClass
+
+[xwiki:objects] > nt:base
+ + * (xwiki:spaceobject) = xwiki:spaceobject
+ + internal (xwiki:object) = xwiki:object multiple
+
+[xwiki:spaceobject] > nt:base
+ + * (xwiki:object) = xwiki:object multiple
+
+[xwiki:object] > nt:base
+ // classname = parent node name + node name
+ - number (long)
+ - className (string)
+ - doc (reference)
+ - * (undefined) // xp:propname
+ - * (undefined) multiple // dblist
+
+[xwiki:lock] > nt:base
+ - userName (string)
+ - date (date)
+
+[xwiki:links] > nt:base
+ + * (xwiki:link) = xwiki:link
+
+[xwiki:link] > nt:base
+ // node name = link
+ - fullName (string)
+ - docId (long)
Added: xwiki/trunk/core/src/main/resources/jackrabbit/repository.xml
===================================================================
--- xwiki/trunk/core/src/main/resources/jackrabbit/repository.xml 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/core/src/main/resources/jackrabbit/repository.xml 2006-10-14 02:39:17 UTC (rev 1389)
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE Repository [
+ <!--
+ the Repository element configures a repository instance;
+ individual workspaces of the repository are configured through
+ separate configuration files called workspace.xml which are
+ located in a subfolder of the workspaces root directory
+ (see Workspaces element).
+
+ it consists of
+
+ a FileSystem element (the virtual file system
+ used by the repository to persist global state such as
+ registered namespaces, custom node types, etc..
+
+ a Security element that specifies the name of the app-entry
+ in the JAAS config and the access manager
+
+ a Workspaces element that specifies the location of the
+ workspaces root directory, the name of the default workspace,
+ the maximum idle time before a workspace is automatically
+ shutdown (optional) and the workspace configuration root directory
+ within the virtual repository file system (optional)
+
+ a Workspace element that is used as a workspace configuration
+ template; it is used to create the initial workspace if there's
+ no workspace yet and for creating additional workspaces through
+ the api
+
+ a Versioning element that is used for configuring
+ versioning-related settings
+
+ a SearchIndex element that is used for configuring Indexing-related
+ settings on the /jcr:system tree.
+ -->
+ <!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning,SearchIndex?)>
+
+ <!--
+ a virtual file system
+ -->
+ <!ELEMENT FileSystem (param*)>
+ <!ATTLIST FileSystem
+ class CDATA #REQUIRED>
+
+ <!--
+ the Security element specifies the name (appName attribute)
+ of the JAAS configuration app-entry for this repository.
+
+ it also specifies the access manager to be used (AccessManager element).
+ -->
+ <!ELEMENT Security (AccessManager, LoginModule?)>
+ <!ATTLIST Security
+ appName CDATA #REQUIRED>
+
+ <!--
+ the AccessManager element configures the access manager to be used by
+ this repository instance; the class attribute specifies the FQN of the
+ class implementing the AccessManager interface
+ -->
+ <!ELEMENT AccessManager (param*)>
+ <!ATTLIST AccessManager
+ class CDATA #REQUIRED>
+
+ <!--
+ generic parameter (name/value pair)
+ -->
+ <!ELEMENT param EMPTY>
+ <!ATTLIST param
+ name CDATA #REQUIRED
+ value CDATA #REQUIRED>
+
+ <!--
+ the LoginModule element optionally specifies a JAAS login module to
+ authenticate users. This feature allows the use of Jackrabbit in a
+ non-JAAS environment.
+ -->
+ <!ELEMENT LoginModule (param*)>
+ <!ATTLIST LoginModule
+ class CDATA #REQUIRED>
+
+ <!--
+ the Workspaces element specifies the physical workspaces root directory
+ (rootPath attribute), the name of the default workspace
+ (defaultWorkspace attribute), the (optional) maximum amount of time in
+ seconds before an idle workspace is automatically shutdown
+ (maxIdleTime attribute) and the (optional) workspace configuration
+ root directory within the virtual repository file system (configRootPath
+ attribute).
+
+ individual workspaces are configured through individual workspace.xml
+ files located in a subfolder each of either
+
+ a) the physical workspaces root directory
+
+ or, if configRootPath had been specified,
+
+ b) the configuration root directory within the virtual repository file system.
+ -->
+ <!ELEMENT Workspaces EMPTY>
+ <!ATTLIST Workspaces
+ rootPath CDATA #REQUIRED
+ defaultWorkspace CDATA #REQUIRED
+ configRootPath CDATA #IMPLIED
+ maxIdleTime CDATA #IMPLIED>
+
+ <!--
+ the Workspace element serves as a workspace configuration template;
+ it is used to create the initial workspace if there's no workspace yet
+ and for creating additional workspaces through the api
+ -->
+ <!ELEMENT Workspace (FileSystem,PersistenceManager,SearchIndex?)>
+ <!ATTLIST Workspace
+ name CDATA #REQUIRED>
+
+ <!--
+ the PersistenceManager element configures the persistence manager
+ to be used for the workspace; the class attribute specifies the
+ FQN of the class implementing the PersistenceManager interface
+ -->
+ <!ELEMENT PersistenceManager (param*)>
+ <!ATTLIST PersistenceManager
+ class CDATA #REQUIRED>
+
+ <!--
+ the SearchIndex element specifies the locaction of the search index
+ (used by the QueryHandler); the class attribute specifies the
+ FQN of the class implementing the QueryHandler interface.
+ -->
+ <!ELEMENT SearchIndex (param*,FileSystem?)>
+ <!ATTLIST SearchIndex
+ class CDATA #REQUIRED>
+
+ <!--
+ the Versioning element configures the persistence manager
+ to be used for persisting version state
+ -->
+ <!ELEMENT Versioning (FileSystem, PersistenceManager)>
+ <!ATTLIST Versioning
+ rootPath CDATA #REQUIRED
+ >
+]>
+<!-- Example Repository Configuration File -->
+<Repository>
+ <!--
+ virtual file system where the repository stores global state
+ (e.g. registered namespaces, custom node types, etc.)
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/repository"/>
+ </FileSystem>
+
+ <!--
+ security configuration
+ -->
+ <Security appName="Jackrabbit">
+ <!--
+ access manager:
+ class: FQN of class implementing the AccessManager interface
+ -->
+ <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
+ <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+ </AccessManager>
+
+ <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
+ <!-- anonymous user name ('anonymous' is the default value) -->
+ <param name="anonymousId" value="anonymous"/>
+ </LoginModule>
+ </Security>
+
+ <!--
+ location of workspaces root directory and name of default workspace
+ -->
+ <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
+ <!--
+ workspace configuration template:
+ used to create the initial workspace if there's no workspace yet
+ -->
+ <Workspace name="${wsp.name}">
+ <!--
+ virtual file system of the workspace:
+ class: FQN of class implementing the FileSystem interface
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${wsp.home}"/>
+ </FileSystem>
+ <!--
+ persistence manager of the workspace:
+ class: FQN of class implementing the PersistenceManager interface
+ -->
+ <PersistenceManager class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager">
+ <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+ <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+ </PersistenceManager>
+ <!--
+ Search index and the file system it uses.
+ class: FQN of class implementing the QueryHandler interface
+
+ If required by the QueryHandler implementation, one may configure
+ a FileSystem that the handler may use.
+
+ Supported parameters for lucene search index:
+ - path: location of the index. This parameter is mandatory!
+ - useCompoundFile: advises lucene to use compound files for the index files
+ - minMergeDocs: minimum number of nodes in an index until segments are merged
+ - volatileIdleTime: idle time in seconds until the volatile index is
+ moved to persistent index even though minMergeDocs is not reached.
+ - maxMergeDocs: maximum number of nodes in segments that will be merged
+ - mergeFactor: determines how often segment indices are merged
+ - maxFieldLength: the number of words that are fulltext indexed at most per property.
+ - bufferSize: maximum number of documents that are held in a pending
+ queue until added to the index
+ - cacheSize: size of the document number cache. This cache maps
+ uuids to lucene document numbers
+ - forceConsistencyCheck: runs a consistency check on every startup. If
+ false, a consistency check is only performed when the search index
+ detects a prior forced shutdown.
+ - autoRepair: errors detected by a consistency check are automatically
+ repaired. If false, errors are only written to the log.
+ - analyzer: class name of a lucene analyzer to use for fulltext indexing of text.
+ - queryClass: class name that implements the javax.jcr.query.Query interface.
+ this class must extend the class: org.apache.jackrabbit.core.query.AbstractQueryImpl
+ - idleTime: idle time in seconds after which an unused query handler is shut down.
+ If the query handler is later used again it is automatically started.
+ Default value -1 disables this feature.
+ - respectDocumentOrder: If true and the query does not contain an 'order by' clause,
+ result nodes will be in document order. For better performance when queries return
+ a lot of nodes set to 'false'.
+
+ Note: all parameters (except path) in this SearchIndex config are default
+ values and can be omitted.
+ -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${wsp.home}/index"/>
+ <param name="useCompoundFile" value="true"/>
+ <param name="minMergeDocs" value="100"/>
+ <param name="volatileIdleTime" value="3"/>
+ <param name="maxMergeDocs" value="100000"/>
+ <param name="mergeFactor" value="10"/>
+ <param name="maxFieldLength" value="10000"/>
+ <param name="bufferSize" value="10"/>
+ <param name="cacheSize" value="1000"/>
+ <param name="forceConsistencyCheck" value="false"/>
+ <param name="autoRepair" value="true"/>
+ <param name="analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+ <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl"/>
+ <param name="idleTime" value="-1"/>
+ <param name="respectDocumentOrder" value="true"/>
+ </SearchIndex>
+ </Workspace>
+
+ <!--
+ Configures the versioning
+ -->
+ <Versioning rootPath="${rep.home}/version">
+ <!--
+ Configures the filesystem to use for versioning for the respective
+ persistence manager
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/version"/>
+ </FileSystem>
+
+ <!--
+ Configures the perisistence manager to be used for persisting version state.
+ Please note that the current versioning implementation is based on
+ a 'normal' persistence manager, but this could change in future
+ implementations.
+ -->
+ <PersistenceManager class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager">
+ <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+ <param name="schemaObjectPrefix" value="version_"/>
+ </PersistenceManager>
+
+ </Versioning>
+
+ <!--
+ Search index for content that is shared repository wide
+ (/jcr:system tree, contains mainly versions)
+
+ The same parameters are supported as in the search index configuration
+ inside the workspace definition element.
+
+ This element is optional. If omitted, the /jcr:system tree will not be
+ indexed and no results will be returned for that tree!
+ -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${rep.home}/repository/index"/>
+ </SearchIndex>
+
+</Repository>
Added: xwiki/trunk/core/src/main/resources/jcrmapping.xml
===================================================================
--- xwiki/trunk/core/src/main/resources/jcrmapping.xml 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/core/src/main/resources/jcrmapping.xml 2006-10-14 02:39:17 UTC (rev 1389)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- validating error, becouse local rel. path <!DOCTYPE graffito-jcr PUBLIC "-//The Apache Software Foundation//DTD Repository//EN" "dtd/graffito-jcr-mapping.dtd"> -->
+<graffito-jcr>
+ <class-descriptor className="com.xpn.xwiki.doc.XWikiDocument" jcrNodeType="xwiki:document" discriminator="false">
+ <!-- Field-descriptor is used to map simple attributes to jcr property -->
+ <field-descriptor fieldName="fullName" jcrName="fullName"/>
+ <field-descriptor fieldName="name" jcrName="name"/>
+ <field-descriptor fieldName="space" jcrName="space"/>
+ <field-descriptor fieldName="id" jcrName="id"/>
+ <field-descriptor fieldName="title" jcrName="title" />
+ <field-descriptor fieldName="language" jcrName="language" />
+ <field-descriptor fieldName="defaultLanguage" jcrName="defaultLanguage" />
+ <field-descriptor fieldName="translation" jcrName="translation" />
+ <field-descriptor fieldName="date" jcrName="date" />
+ <field-descriptor fieldName="contentUpdateDate" jcrName="contentUpdateDate" />
+ <field-descriptor fieldName="creationDate" jcrName="creationDate" />
+ <field-descriptor fieldName="author" jcrName="author" />
+ <field-descriptor fieldName="contentAuthor" jcrName="contentAuthor" />
+ <field-descriptor fieldName="creator" jcrName="creator" />
+ <field-descriptor fieldName="content" jcrName="content" />
+ <field-descriptor fieldName="version" jcrName="version" />
+ <field-descriptor fieldName="parent" jcrName="parent" />
+ <field-descriptor fieldName="xWikiClassXML" jcrName="xWikiClassXML" />
+ <field-descriptor fieldName="elements" jcrName="elements" />
+ <field-descriptor fieldName="defaultTemplate" jcrName="defaultTemplate" />
+ <!--manual: <bean-descriptor fieldName="xWikiClass" jcrName="class" jcrNodeType="xwiki:class" />-->
+ <!--manual: <collection-descriptor fieldName="attachmentList" elementClassName="com.xpn.xwiki.doc.XWikiAttachment" jcrName="attach" jcrNodeType="xwiki:attachments" />-->
+ </class-descriptor>
+
+
+ <class-descriptor className="com.xpn.xwiki.objects.classes.BaseClass" discriminator="false" jcrNodeType="xwiki:class">
+ <field-descriptor fieldName="customClass" jcrName="customClass"/>
+ </class-descriptor>
+
+ <class-descriptor className="com.xpn.xwiki.objects.classes.PropertyClass" abstract="true" discriminator="true">
+ <field-descriptor fieldName="prettyName" jcrName="prettyName"/>
+ <field-descriptor fieldName="unmodifiable" jcrName="unmodifiable"/>
+ <field-descriptor fieldName="number" jcrName="number"/>
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.NumberClass" extend="com.xpn.xwiki.objects.classes.PropertyClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="size" jcrName="size"/>
+ <field-descriptor fieldName="numberType" jcrName="numberType"/>
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.StringClass" extend="com.xpn.xwiki.objects.classes.PropertyClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="size" jcrName="size"/>
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.DateClass" extend="com.xpn.xwiki.objects.classes.PropertyClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="size" jcrName="size" />
+ <field-descriptor fieldName="emptyIsToday" jcrName="emptyIsToday" />
+ <field-descriptor fieldName="dateFormat" jcrName="dateFormat" />
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.PasswordClass" extend="com.xpn.xwiki.objects.classes.PropertyClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="size" jcrName="size"/>
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.TextAreaClass" extend="com.xpn.xwiki.objects.classes.PropertyClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="size" jcrName="size" />
+ <field-descriptor fieldName="rows" jcrName="rows" />
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.BooleanClass" extend="com.xpn.xwiki.objects.classes.PropertyClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="displayType" jcrName="displayType"/>
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.ListClass" extend="com.xpn.xwiki.objects.classes.PropertyClass" abstract="true" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="size" jcrName="size" />
+ <field-descriptor fieldName="displayType" jcrName="displayType" />
+ <field-descriptor fieldName="multiSelect" jcrName="multiSelect" />
+ <field-descriptor fieldName="relationalStorage" jcrName="relationalStorage" />
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.StaticListClass" extend="com.xpn.xwiki.objects.classes.ListClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="values" jcrName="values" />
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.DBListClass" extend="com.xpn.xwiki.objects.classes.ListClass" jcrNodeType="xwiki:propertyClass">
+ <field-descriptor fieldName="sql" jcrName="sql" /> <!-- xpath, jcrsql? -->
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.GroupsClass" extend="com.xpn.xwiki.objects.classes.ListClass" jcrNodeType="xwiki:propertyClass">
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.LevelsClass" extend="com.xpn.xwiki.objects.classes.ListClass" jcrNodeType="xwiki:propertyClass">
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.objects.classes.UsersClass" extend="com.xpn.xwiki.objects.classes.ListClass" jcrNodeType="xwiki:propertyClass">
+ </class-descriptor>
+
+ <class-descriptor className="com.xpn.xwiki.objects.BaseObject" jcrNodeType="xwiki:object" discriminator="false">
+ <field-descriptor fieldName="number" jcrName="number" />
+ </class-descriptor>
+
+ <class-descriptor className="com.xpn.xwiki.doc.XWikiAttachment" jcrNodeType="xwiki:attachment" discriminator="false">
+ <field-descriptor fieldName="filesize" jcrName="filesize" />
+ <field-descriptor fieldName="author" jcrName="author" />
+ <field-descriptor fieldName="version" jcrName="version" />
+ <field-descriptor fieldName="comment" jcrName="comment" />
+ <field-descriptor fieldName="date" jcrName="date" />
+ <bean-descriptor fieldName="attachment_content" jcrName="content" jcrNodeType="xwiki:attachmentContent" autoRetrieve="false" autoUpdate="false" autoInsert="false" />
+ <bean-descriptor fieldName="attachment_archive" jcrName="archive" jcrNodeType="xwiki:attachmentArchive" autoRetrieve="false" autoUpdate="false" autoInsert="false" />
+ </class-descriptor>
+
+ <class-descriptor className="com.xpn.xwiki.doc.XWikiLock" jcrNodeType="xwiki:lock">
+ <field-descriptor fieldName="userName" jcrName="userName"/>
+ <field-descriptor fieldName="date" jcrName="date"/>
+ </class-descriptor>
+ <class-descriptor className="com.xpn.xwiki.doc.XWikiLink" jcrNodeType="xwiki:link">
+ <!-- link = node name -->
+ <field-descriptor fieldName="docId" jcrName="docId"/>
+ <field-descriptor fieldName="fullName" jcrName="fullName"/>
+ </class-descriptor>
+
+ <class-descriptor className="com.xpn.xwiki.stats.impl.DocumentStats" extend="com.xpn.xwiki.objects.BaseObject">
+ <field-descriptor fieldName="action" jcrName="action" />
+ <field-descriptor fieldName="pageViews" jcrName="pageViews" />
+ <field-descriptor fieldName="uniqueVisitors" jcrName="uniqueVisitors" />
+ <field-descriptor fieldName="period" jcrName="period" />
+ <field-descriptor fieldName="visits" jcrName="visits" />
+ </class-descriptor>
+
+ <class-descriptor className="com.xpn.xwiki.stats.impl.RefererStats" extend="com.xpn.xwiki.objects.BaseObject">
+ <field-descriptor fieldName="referer" jcrName="referer" />
+ <field-descriptor fieldName="pageViews" jcrName="pageViews" />
+ <field-descriptor fieldName="period" jcrName="period" />
+ </class-descriptor>
+
+ <class-descriptor className="com.xpn.xwiki.stats.impl.VisitStats" extend="com.xpn.xwiki.objects.BaseObject">
+ <field-descriptor fieldName="IP" jcrName="IP" />
+ <field-descriptor fieldName="userAgent" jcrName="userAgent" />
+ <field-descriptor fieldName="cookie" jcrName="cookie" />
+ <field-descriptor fieldName="uniqueID" jcrName="uniqueID" />
+ <field-descriptor fieldName="pageViews" jcrName="pageViews" />
+ <field-descriptor fieldName="pageSaves" jcrName="pageSaves" />
+ <field-descriptor fieldName="downloads" jcrName="downloads" />
+ <field-descriptor fieldName="startDate" jcrName="startDate" />
+ <field-descriptor fieldName="endDate" jcrName="endDate" />
+ </class-descriptor>
+</graffito-jcr>
Deleted: xwiki/trunk/lib/derby-10.1.2.1.jar
===================================================================
(Binary files differ)
Added: xwiki/trunk/lib/derby-10.1.3.1.jar
===================================================================
(Binary files differ)
Property changes on: xwiki/trunk/lib/derby-10.1.3.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: xwiki/trunk/lib/jackrabbit-core-1.0.1.jar
===================================================================
(Binary files differ)
Added: xwiki/trunk/lib/jackrabbit-core-1.1.jar
===================================================================
(Binary files differ)
Property changes on: xwiki/trunk/lib/jackrabbit-core-1.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: xwiki/trunk/lib/jackrabbit-jcr-commons-1.0.1.jar
===================================================================
(Binary files differ)
Modified: xwiki/trunk/src/main/xwiki/jcrdb/Blog/Macros
===================================================================
--- xwiki/trunk/src/main/xwiki/jcrdb/Blog/Macros 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/main/xwiki/jcrdb/Blog/Macros 2006-10-14 02:39:17 UTC (rev 1389)
@@ -20,7 +20,7 @@
#if($category=='')
#set ($xpath = "*/*[@fullName!='XWiki.ArticleClassTemplate']/obj/XWiki/ArticleClass/jcr:deref(@doc, '*')")
#else
-#set ($xpath = "*/*[@fullName!='XWiki.ArticleClassTemplate']/obj/XWiki/ArticleClass/xp:category[@value='${category}']/jcr:deref(@obj, '*')/jcr:deref(@doc, '*')")
+#set ($xpath = "*/*[@fullName!='XWiki.ArticleClassTemplate']/obj/XWiki/ArticleClass[@xp:category='${category}']/jcr:deref(@doc, '*')")
#end
#set($cdate = "")
#set($inbitems = $xwiki.parseInt($nbitems))
Modified: xwiki/trunk/src/main/xwiki/jcrdb/Main/WebRss
===================================================================
--- xwiki/trunk/src/main/xwiki/jcrdb/Main/WebRss 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/main/xwiki/jcrdb/Main/WebRss 2006-10-14 02:39:17 UTC (rev 1389)
@@ -17,8 +17,7 @@
<title></title>
<template></template>
<content>$response.setContentType("text/xml")
-#set ($sql = "where 1=1 order by doc.date desc")
-#set ($list = $xwiki.searchDocuments($sql , 20 , 0))
+#set ($list = $xwiki.query.getDocs("*.*", "@fullName", "- at date").setMaxResults(20).list())
#set ($baseurl = "http://${request.serverName}")
#includeForm("XWiki.WebRssCode")</content>
</xwikidoc>
Modified: xwiki/trunk/src/main/xwiki/jcrdb/Main/WebSearch
===================================================================
--- xwiki/trunk/src/main/xwiki/jcrdb/Main/WebSearch 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/main/xwiki/jcrdb/Main/WebSearch 2006-10-14 02:39:17 UTC (rev 1389)
@@ -54,7 +54,7 @@
1.1 Search in text fields
-#set ($xpath = "*/*/obj/*/*/*[jcr:contains(@value, '$text')]/jcr:deref(@obj, '*')/jcr:deref(@doc, '*')")
+#set ($xpath = "*/*/obj/*/*[jcr:contains(., '$text')]/jcr:deref(@doc, '*')")
#foreach ( $item in $xwiki.query.getDocs($xpath, "@fullName", "").setFirstResult($start).setMaxResults($nb).list())
#if ($xwiki.hasAccessLevel("view", $context.user, "${context.database}:${item}"))
#set($bentrydoc = $xwiki.getDocument($item))
@@ -78,7 +78,7 @@
1.1 Search in attachment file content
-#set ($xpath = "*/*/attach/*/content[jcr:contains(@jcr:data, 'a')]/jcr:deref(@attach, '*')/jcr:deref(@doc, '*')")
+#set ($xpath = "*/*/attach/*/content[jcr:contains(@jcr:data, '$text')]/jcr:deref(@attach, '*')/jcr:deref(@doc, '*')")
#foreach ( $item in $xwiki.query.getDocs($xpath, "@fullName", "").setFirstResult($start).setMaxResults($nb).list())
#if ($xwiki.hasAccessLevel("view", $context.user, "${context.database}:${item}"))
#set($bentrydoc = $xwiki.getDocument($item))
Modified: xwiki/trunk/src/main/xwiki/jcrdb/XWiki/ArticleClass
===================================================================
--- xwiki/trunk/src/main/xwiki/jcrdb/XWiki/ArticleClass 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/main/xwiki/jcrdb/XWiki/ArticleClass 2006-10-14 02:39:17 UTC (rev 1389)
@@ -49,7 +49,7 @@
<size>5</size>
<relationalStorage>1</relationalStorage>
<name>category</name>
-<sql>/*/*/obj/Blog/Categories/xp:name/@value</sql>
+<sql>/*/*/obj/Blog/Categories/@xp:name</sql>
<number>2</number>
<classType>com.xpn.xwiki.objects.classes.DBListClass</classType>
</category>
Modified: xwiki/trunk/src/main/xwiki/jcrdb/XWiki/BlogRssCode
===================================================================
--- xwiki/trunk/src/main/xwiki/jcrdb/XWiki/BlogRssCode 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/main/xwiki/jcrdb/XWiki/BlogRssCode 2006-10-14 02:39:17 UTC (rev 1389)
@@ -17,10 +17,7 @@
<title></title>
<template></template>
<content>{pre}
-#if(!$sql)
-#set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.date desc")
-#end
-#set($list = $xwiki.searchDocuments($sql))
+#set($list = $xwiki.query.getDocs("*/*[@fullName!='XWiki.ArticleClassTemplate']/obj/XWiki/ArticleClass/jcr:deref(@doc, '*')", "@fullName", "- at date").setMaxResults(20).list())
#set($rsvc= $xwiki.xWiki.getRightService())
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wiki="http://purl.org/rss/1.0/modules/wiki/"
encoding="ISO-8859-1" >
Modified: xwiki/trunk/src/test/resources/jackrabbit/nodetypes.cnd
===================================================================
--- xwiki/trunk/src/test/resources/jackrabbit/nodetypes.cnd 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/test/resources/jackrabbit/nodetypes.cnd 2006-10-14 02:39:17 UTC (rev 1389)
@@ -22,22 +22,21 @@
[xwiki:document] > nt:base, mix:referenceable
// - <property> (<class>) = <defval>
// node name = doc.name + "." + language
- // parent node name = doc.web (space)
+ // parent node name = doc.space
- name (string)
- - web (string)
+ - space (string)
- fullName (string)
- id (long)
- title (string)
- language (string)
- defaultLanguage (string)
- translation (long)
- - date (date) // ? (becouse graffito-jcr-mappings, date<->long) TODO: date type
+ - date (date)
- contentUpdateDate (date)
- creationDate (date)
- - author (string) = 'XWiki.XWikiGuest'
- - contentAuthor (string)= 'XWiki.XWikiGuest'
- - creator (string) = 'XWiki.XWikiGuest'
- - web (string)
+ - author (string) = 'XWiki.XWikiGuest'
+ - contentAuthor (string) = 'XWiki.XWikiGuest'
+ - creator (string) = 'XWiki.XWikiGuest'
- content (string)
- archive (string)
- version (string)
@@ -55,7 +54,6 @@
+ * (xwiki:attachment) = xwiki:attachment
[xwiki:attachment] > nt:base, mix:referenceable
- - filename (string)
- filesize (long)
- author (string) = 'XWiki.XWikiGuest'
- version (string) = '1.1'
@@ -82,25 +80,21 @@
- unmodifiable (boolean) = false
- number (long) // TODO: orderable xwiki:propertyClass
-[xwiki:objects]
+[xwiki:objects] > nt:base
+ * (xwiki:spaceobject) = xwiki:spaceobject
+ internal (xwiki:object) = xwiki:object multiple
-[xwiki:spaceobject]
+[xwiki:spaceobject] > nt:base
+ * (xwiki:object) = xwiki:object multiple
-[xwiki:object] > nt:base, mix:referenceable
- // classname = node name, docname = parent node name
+[xwiki:object] > nt:base
+ // classname = parent node name + node name
- number (long)
- className (string)
- doc (reference)
- + * (xwiki:property) = xwiki:property
+ - * (undefined) // xp:propname
+ - * (undefined) multiple // dblist
-[xwiki:property] > nt:unstructured
- //- classproperty (reference) // reference to xwiki:propertyClass
- // - value (undefined)
- // - obj (reference)
-
[xwiki:lock] > nt:base
- userName (string)
- date (date)
Modified: xwiki/trunk/src/test/resources/jackrabbit/repository.xml
===================================================================
--- xwiki/trunk/src/test/resources/jackrabbit/repository.xml 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/test/resources/jackrabbit/repository.xml 2006-10-14 02:39:17 UTC (rev 1389)
@@ -1,4 +1,20 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<!DOCTYPE Repository [
<!--
the Repository element configures a repository instance;
@@ -16,8 +32,11 @@
a Security element that specifies the name of the app-entry
in the JAAS config and the access manager
- a Workspaces element that specifies to the location of
- workspaces root directory and the name of default workspace
+ a Workspaces element that specifies the location of the
+ workspaces root directory, the name of the default workspace,
+ the maximum idle time before a workspace is automatically
+ shutdown (optional) and the workspace configuration root directory
+ within the virtual repository file system (optional)
a Workspace element that is used as a workspace configuration
template; it is used to create the initial workspace if there's
@@ -41,7 +60,7 @@
<!--
the Security element specifies the name (appName attribute)
- of the JAAS configuration app-entry for this repository.
+ of the JAAS configuration app-entry for this repository.
it also specifies the access manager to be used (AccessManager element).
-->
@@ -66,7 +85,7 @@
name CDATA #REQUIRED
value CDATA #REQUIRED>
- <!--
+ <!--
the LoginModule element optionally specifies a JAAS login module to
authenticate users. This feature allows the use of Jackrabbit in a
non-JAAS environment.
@@ -75,18 +94,30 @@
<!ATTLIST LoginModule
class CDATA #REQUIRED>
- <!--
- the Workspaces element specifies the workspaces root directory
- (rootPath attribute) and the name of the default workspace
- (defaultWorkspace attribute).
+ <!--
+ the Workspaces element specifies the physical workspaces root directory
+ (rootPath attribute), the name of the default workspace
+ (defaultWorkspace attribute), the (optional) maximum amount of time in
+ seconds before an idle workspace is automatically shutdown
+ (maxIdleTime attribute) and the (optional) workspace configuration
+ root directory within the virtual repository file system (configRootPath
+ attribute).
individual workspaces are configured through individual workspace.xml
- files located in a subfolder each of the workspaces root directory.
+ files located in a subfolder each of either
+
+ a) the physical workspaces root directory
+
+ or, if configRootPath had been specified,
+
+ b) the configuration root directory within the virtual repository file system.
-->
<!ELEMENT Workspaces EMPTY>
<!ATTLIST Workspaces
- rootPath CDATA #REQUIRED
- defaultWorkspace CDATA #REQUIRED>
+ rootPath CDATA #REQUIRED
+ defaultWorkspace CDATA #REQUIRED
+ configRootPath CDATA #IMPLIED
+ maxIdleTime CDATA #IMPLIED>
<!--
the Workspace element serves as a workspace configuration template;
@@ -149,11 +180,6 @@
<LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
<!-- anonymous user name ('anonymous' is the default value) -->
<param name="anonymousId" value="anonymous"/>
- <!--
- default user name to be used instead of the anonymous user
- when no login credentials are provided (unset by default)
- -->
- <!-- <param name="defaultUserId" value="superuser"/> -->
</LoginModule>
</Security>
@@ -178,15 +204,63 @@
class: FQN of class implementing the PersistenceManager interface
-->
<PersistenceManager class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager">
- <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
- <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+ <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+ <param name="schemaObjectPrefix" value="${wsp.name}_"/>
</PersistenceManager>
<!--
Search index and the file system it uses.
class: FQN of class implementing the QueryHandler interface
+
+ If required by the QueryHandler implementation, one may configure
+ a FileSystem that the handler may use.
+
+ Supported parameters for lucene search index:
+ - path: location of the index. This parameter is mandatory!
+ - useCompoundFile: advises lucene to use compound files for the index files
+ - minMergeDocs: minimum number of nodes in an index until segments are merged
+ - volatileIdleTime: idle time in seconds until the volatile index is
+ moved to persistent index even though minMergeDocs is not reached.
+ - maxMergeDocs: maximum number of nodes in segments that will be merged
+ - mergeFactor: determines how often segment indices are merged
+ - maxFieldLength: the number of words that are fulltext indexed at most per property.
+ - bufferSize: maximum number of documents that are held in a pending
+ queue until added to the index
+ - cacheSize: size of the document number cache. This cache maps
+ uuids to lucene document numbers
+ - forceConsistencyCheck: runs a consistency check on every startup. If
+ false, a consistency check is only performed when the search index
+ detects a prior forced shutdown.
+ - autoRepair: errors detected by a consistency check are automatically
+ repaired. If false, errors are only written to the log.
+ - analyzer: class name of a lucene analyzer to use for fulltext indexing of text.
+ - queryClass: class name that implements the javax.jcr.query.Query interface.
+ this class must extend the class: org.apache.jackrabbit.core.query.AbstractQueryImpl
+ - idleTime: idle time in seconds after which an unused query handler is shut down.
+ If the query handler is later used again it is automatically started.
+ Default value -1 disables this feature.
+ - respectDocumentOrder: If true and the query does not contain an 'order by' clause,
+ result nodes will be in document order. For better performance when queries return
+ a lot of nodes set to 'false'.
+
+ Note: all parameters (except path) in this SearchIndex config are default
+ values and can be omitted.
-->
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
+ <param name="useCompoundFile" value="true"/>
+ <param name="minMergeDocs" value="100"/>
+ <param name="volatileIdleTime" value="3"/>
+ <param name="maxMergeDocs" value="100000"/>
+ <param name="mergeFactor" value="10"/>
+ <param name="maxFieldLength" value="10000"/>
+ <param name="bufferSize" value="10"/>
+ <param name="cacheSize" value="1000"/>
+ <param name="forceConsistencyCheck" value="false"/>
+ <param name="autoRepair" value="true"/>
+ <param name="analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+ <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl"/>
+ <param name="idleTime" value="-1"/>
+ <param name="respectDocumentOrder" value="true"/>
</SearchIndex>
</Workspace>
@@ -199,26 +273,34 @@
persistence manager
-->
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
- <param name="path" value="${rep.home}/version" />
+ <param name="path" value="${rep.home}/version"/>
</FileSystem>
<!--
- Configures the persistence manager to be used for persisting version state.
+ Configures the perisistence manager to be used for persisting version state.
Please note that the current versioning implementation is based on
a 'normal' persistence manager, but this could change in future
implementations.
-->
<PersistenceManager class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager">
- <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
- <param name="schemaObjectPrefix" value="version_"/>
+ <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+ <param name="schemaObjectPrefix" value="version_"/>
</PersistenceManager>
+
</Versioning>
-
+
<!--
Search index for content that is shared repository wide
(/jcr:system tree, contains mainly versions)
+
+ The same parameters are supported as in the search index configuration
+ inside the workspace definition element.
+
+ This element is optional. If omitted, the /jcr:system tree will not be
+ indexed and no results will be returned for that tree!
-->
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${rep.home}/repository/index"/>
</SearchIndex>
+
</Repository>
Modified: xwiki/trunk/src/test/resources/jcrmapping.xml
===================================================================
--- xwiki/trunk/src/test/resources/jcrmapping.xml 2006-10-13 14:39:02 UTC (rev 1388)
+++ xwiki/trunk/src/test/resources/jcrmapping.xml 2006-10-14 02:39:17 UTC (rev 1389)
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- validating error, becouse local rel. path <!DOCTYPE graffito-jcr PUBLIC "-//The Apache Software Foundation//DTD Repository//EN" "dtd/graffito-jcr-mapping.dtd"> -->
<graffito-jcr>
- <class-descriptor className="com.xpn.xwiki.doc.XWikiDocument" jcrNodeType="xwiki:document" discriminator="false">
- <!-- Field-descriptor is used to map simple attributes to jcr property -->
- <!--<field-descriptor fieldName="jcrPath" path="true" />-->
+ <class-descriptor className="com.xpn.xwiki.doc.XWikiDocument" jcrNodeType="xwiki:document" discriminator="false">
+ <!-- Field-descriptor is used to map simple attributes to jcr property -->
<field-descriptor fieldName="fullName" jcrName="fullName"/>
<field-descriptor fieldName="name" jcrName="name"/>
- <field-descriptor fieldName="web" jcrName="web"/>
+ <field-descriptor fieldName="space" jcrName="space"/>
<field-descriptor fieldName="id" jcrName="id"/>
<field-descriptor fieldName="title" jcrName="title" />
<field-descriptor fieldName="language" jcrName="language" />
@@ -18,7 +17,6 @@
<field-descriptor fieldName="author" jcrName="author" />
<field-descriptor fieldName="contentAuthor" jcrName="contentAuthor" />
<field-descriptor fieldName="creator" jcrName="creator" />
- <field-descriptor fieldName="web" jcrName="web" />
<field-descriptor fieldName="content" jcrName="content" />
<field-descriptor fieldName="version" jcrName="version" />
<field-descriptor fieldName="parent" jcrName="parent" />
@@ -26,18 +24,16 @@
<field-descriptor fieldName="elements" jcrName="elements" />
<field-descriptor fieldName="defaultTemplate" jcrName="defaultTemplate" />
<!--manual: <bean-descriptor fieldName="xWikiClass" jcrName="class" jcrNodeType="xwiki:class" />-->
- <collection-descriptor fieldName="attachmentList" elementClassName="com.xpn.xwiki.doc.XWikiAttachment" jcrName="attach" jcrNodeType="xwiki:attachments" />
+ <!--manual: <collection-descriptor fieldName="attachmentList" elementClassName="com.xpn.xwiki.doc.XWikiAttachment" jcrName="attach" jcrNodeType="xwiki:attachments" />-->
</class-descriptor>
<class-descriptor className="com.xpn.xwiki.objects.classes.BaseClass" discriminator="false" jcrNodeType="xwiki:class">
<field-descriptor fieldName="customClass" jcrName="customClass"/>
- <!--manual: <collection-descriptor fieldName="propertyClasses" elementClassName="com.xpn.xwiki.objects.classes.PropertyClass" jcrName="props" jcrNodeType="xwiki:dirPropertyClass"/>-->
</class-descriptor>
<class-descriptor className="com.xpn.xwiki.objects.classes.PropertyClass" abstract="true" discriminator="true">
<field-descriptor fieldName="prettyName" jcrName="prettyName"/>
- <!--not needed, done by graffito: <field-descriptor fieldName="classType" jcrName="graffito:classname" jcrProtected="true"/>-->
<field-descriptor fieldName="unmodifiable" jcrName="unmodifiable"/>
<field-descriptor fieldName="number" jcrName="number"/>
</class-descriptor>
@@ -82,65 +78,20 @@
<class-descriptor className="com.xpn.xwiki.objects.classes.UsersClass" extend="com.xpn.xwiki.objects.classes.ListClass" jcrNodeType="xwiki:propertyClass">
</class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.BaseObject" discriminator="true" jcrNodeType="xwiki:object">
+ <class-descriptor className="com.xpn.xwiki.objects.BaseObject" jcrNodeType="xwiki:object" discriminator="false">
<field-descriptor fieldName="number" jcrName="number" />
- <field-descriptor fieldName="className" jcrName="className" />
- <!--node name = <field-descriptor fieldName="className" jcrName="className" />-->
- <!--<collection-descriptor fieldName="propertiesCol" elementClassName="com.xpn.xwiki.objects.BaseProperty" />-->
</class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.BaseProperty" jcrNodeType="xwiki:property" discriminator="true">
- <!--not needed, done by graffito: <field-descriptor fieldName="classType" jcrName="graffito:classname" jcrProtected="true" />-->
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.IntegerProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="value" jcrName="value" fieldType="java.lang.Integer" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.LongProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="value" jcrName="value" fieldType="java.lang.Long" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.FloatProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="value" jcrName="value" fieldType="java.lang.Float" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.DoubleProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="value" jcrName="value" fieldType="java.lang.Double" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.StringProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="value" jcrName="value" fieldType="java.lang.String" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.DateProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="value" jcrName="value" fieldType="java.util.Date" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.LargeStringProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="value" jcrName="value" fieldType="java.lang.String" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.StringListProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <field-descriptor fieldName="textValue" jcrName="value" fieldType="java.lang.String" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.objects.DBStringListProperty" extend="com.xpn.xwiki.objects.BaseProperty" discriminator="true" jcrNodeType="xwiki:property">
- <collection-descriptor fieldName="list" elementClassName="java.lang.String" jcrName="value" collectionConverter="org.apache.portals.graffito.jcr.persistence.collectionconverter.impl.MultiValueCollectionConverterImpl"/>
- </class-descriptor>
-
<class-descriptor className="com.xpn.xwiki.doc.XWikiAttachment" jcrNodeType="xwiki:attachment" discriminator="false">
- <field-descriptor fieldName="filename" jcrName="filename" id="true" /> <!-- TODO: id=path - not supported by graffito-jcr -->
<field-descriptor fieldName="filesize" jcrName="filesize" />
<field-descriptor fieldName="author" jcrName="author" />
<field-descriptor fieldName="version" jcrName="version" />
- <field-descriptor fieldName="comment" jcrName="comment" />
- <field-descriptor fieldName="date" jcrName="date" />
+ <field-descriptor fieldName="comment" jcrName="comment" />
+ <field-descriptor fieldName="date" jcrName="date" />
<bean-descriptor fieldName="attachment_content" jcrName="content" jcrNodeType="xwiki:attachmentContent" autoRetrieve="false" autoUpdate="false" autoInsert="false" />
<bean-descriptor fieldName="attachment_archive" jcrName="archive" jcrNodeType="xwiki:attachmentArchive" autoRetrieve="false" autoUpdate="false" autoInsert="false" />
</class-descriptor>
- <!--manual storing:
- <class-descriptor className="com.xpn.xwiki.doc.XWikiAttachmentContent" jcrNodeType="xwiki:attachmentContent" discriminator="false">
- <field-descriptor fieldName="jcrPath" path="true" />
- <field-descriptor fieldName="content" jcrName="jcr:data" />
- </class-descriptor>
- <class-descriptor className="com.xpn.xwiki.doc.XWikiAttachmentArchive" jcrNodeType="xwiki:attachmentArchive" discriminator="false">
- <field-descriptor fieldName="jcrPath" path="true" />
- <field-descriptor fieldName="archive" jcrName="jcr:data" />
- </class-descriptor>-->
-
<class-descriptor className="com.xpn.xwiki.doc.XWikiLock" jcrNodeType="xwiki:lock">
<field-descriptor fieldName="userName" jcrName="userName"/>
<field-descriptor fieldName="date" jcrName="date"/>
@@ -176,4 +127,4 @@
<field-descriptor fieldName="startDate" jcrName="startDate" />
<field-descriptor fieldName="endDate" jcrName="endDate" />
</class-descriptor>
-</graffito-jcr>
+</graffito-jcr>
More information about the Xwiki-notifications
mailing list