r1408 - in xwiki/trunk: . core/src/main/java/com/xpn/xwiki core/src/main/java/com/xpn/xwiki/api core/src/main/java/com/xpn/xwiki/doc core/src/main/java/com/xpn/xwiki/objects core/src/main/java/com/xpn/xwiki/objects/classes core/src/main/java/com/xpn/xwiki/objects/meta core/src/main/java/com/xpn/xwiki/validation core/src/main/resources src/test/java/com/xpn/xwiki/test src/test/resources

Ludovic Dubost ludovic at users.forge.objectweb.org
Thu Oct 19 04:23:23 CEST 2006


Author: ludovic
Date: 2006-10-19 04:23:21 +0200 (Thu, 19 Oct 2006)
New Revision: 1408

Added:
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiDefaultValidation.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationException.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationInterface.java
   xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiFakeRequest.java
Modified:
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWikiContext.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/api/XWiki.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/StringListProperty.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/DBListClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/LevelsClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/StaticListClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/PropertyMetaClass.java
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/StaticListMetaClass.java
   xwiki/trunk/core/src/main/resources/xwiki.hbm.xml
   xwiki/trunk/src/test/java/com/xpn/xwiki/test/ClassesTest.java
   xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiDocumentTest.java
   xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiTest.java
   xwiki/trunk/src/test/resources/xwiki.hbm.xml
   xwiki/trunk/xwiki.iml
   xwiki/trunk/xwiki.ipr
   xwiki/trunk/xwiki.iws
   xwiki/trunk/xwikibase.iml
Log:
Improved list to support different values in display and storage
Support translation of list display fields
Support text input field for list (for keywords or tags)
Added getMessageTool in XWikiContext
Added getMessage in XWiki API
Started implementing validation


Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -74,6 +74,8 @@
 import com.xpn.xwiki.util.Util;
 import com.xpn.xwiki.web.*;
 import com.xpn.xwiki.web.includeservletasstring.IncludeServletAsString;
+import com.xpn.xwiki.validation.XWikiValidationInterface;
+import com.xpn.xwiki.validation.XWikiValidationException;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.UsernamePasswordCredentials;
 import org.apache.commons.httpclient.methods.GetMethod;
@@ -4158,4 +4160,41 @@
             }
         }
     }
+
+    public boolean validateDocument(XWikiDocument doc, XWikiContext context) throws XWikiException {
+        XWikiValidationException xwe;
+        String validationScript = "";
+        XWikiRequest req = context.getRequest();
+        if (req!=null) {
+            validationScript = req.get("xvalidation");
+        }
+        if ((validationScript==null)||(validationScript.trim().equals(""))) {
+            validationScript = doc.getValidationScript();
+        }
+        if ((validationScript==null)||(validationScript.trim().equals(""))) {
+           XWikiValidationInterface validObject = (XWikiValidationInterface) parseGroovyFromPage(validationScript, context);
+           return validObject.validateDocument(doc, context);   
+        }
+        return true;
+    }
+
+    public String getMessage(String item, XWikiContext context) {
+        XWikiMessageTool msg = context.getMessageTool();
+        if (msg==null)
+         return item;
+        else
+         return msg.get(item);
+    }
+
+    public String parseMessage(String id, XWikiContext context) {
+        XWikiMessageTool msg = (XWikiMessageTool) context.get("msg");
+        return parseContent(msg.get(id), context);
+    }
+
+    public String parseMessage(XWikiContext context) {
+        String message = (String) context.get("message");
+        if (message == null)
+            return null;
+        return parseMessage(message, context);
+    }
 }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWikiContext.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWikiContext.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWikiContext.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -319,4 +319,8 @@
     public String getLinksQueryString() {
         return (String) get("links_qs");
     }
+
+    public XWikiMessageTool getMessageTool() {
+      return ((XWikiMessageTool) get("msg"));
+    }    
 }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/api/XWiki.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/api/XWiki.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/api/XWiki.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -401,10 +401,7 @@
      * @return Final message
      */
     public String parseMessage() {
-        String message = (String) context.get("message");
-        if (message == null)
-            return null;
-        return parseMessage(message);
+        return xwiki.parseMessage(context);
     }
 
     /**
@@ -417,11 +414,23 @@
      * @return the result of the parsed message
      */
     public String parseMessage(String id) {
-        XWikiMessageTool msg = (XWikiMessageTool) context.get("msg");
-        return parseContent(msg.get(id));
+        return xwiki.parseMessage(id, context);
     }
 
     /**
+     * API to get a message
+     * A message can be an error message or an information message either as text
+     * or as a message ID pointing to ApplicationResources
+     * The message is also parsed for velocity scripts
+     * @return Final message
+     * @param id
+     * @return the result of the parsed message
+     */
+    public String getMessage(String id) {
+        return xwiki.getMessage(id, context);
+    }
+
+    /**
      * API to parse a velocity template provided by the current Skin
      * The template is first looked in the skin active for the user, the space or the wiki.
      * If the template does not exist in that skin, the template is looked up in the "parent skin" of the skin
@@ -2061,7 +2070,7 @@
     }
 
     public String getUniquePageName(String space, String name){
-        return xwiki.getUniquePageName(space, name, context);
+        return "";// xwiki.getUniquePageName(space, name, context);
     }
 
     public String clearName(String name){

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -137,6 +137,8 @@
     // Template by default assign to a view
     private String defaultTemplate;
 
+    //
+    private String validationScript;
     private Object wikiNode;
 
     // We are using a SoftReference which will allow the archive to be
@@ -2920,4 +2922,12 @@
     public void setCustomClass(String customClass) {
         this.customClass = customClass;
     }
+
+    public void setValidationScript(String validationScript) {
+        this.validationScript = validationScript;
+    }
+
+    public String getValidationScript() {
+        return validationScript;
+    }
 }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/StringListProperty.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/StringListProperty.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/StringListProperty.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -1,23 +1,23 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
 
 package com.xpn.xwiki.objects;
 

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -53,6 +53,7 @@
     private String defaultWeb;
     private String defaultViewSheet;
     private String defaultEditSheet;
+    private String validationScript;
     private String nameField;
 
     // This insures natural ordering between properties
@@ -418,25 +419,6 @@
         return false;
     }
 
-    public boolean addDBListField(String fieldName, String fieldPrettyName, String sql) {
-        return addDBListField(fieldName, fieldPrettyName, 1, false, sql);
-    }
-
-    public boolean addDBListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql) {
-        if (get(fieldName)==null) {
-            DBListClass list_class = new DBListClass();
-            list_class.setName(fieldName);
-            list_class.setPrettyName(fieldPrettyName);
-            list_class.setSize(size);
-            list_class.setMultiSelect(multiSelect);
-            list_class.setSql(sql);
-            list_class.setObject(this);
-            put(fieldName, list_class);
-            return true;
-        }
-        return false;
-    }
-
     public boolean addNumberField(String fieldName, String fieldPrettyName, int size, String type) {
         if (get(fieldName)==null) {
             NumberClass number_class = new NumberClass();
@@ -636,4 +618,13 @@
 
         return select.toString();
     }
+
+    public void setValidationScript(String validationScript) {
+        this.validationScript = validationScript;
+    }
+
+    public String getValidationScript() {
+        return validationScript;
+    }
+
 }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/DBListClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/DBListClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/DBListClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -29,6 +29,8 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
 
 public class DBListClass extends ListClass {
     public DBListClass(PropertyMetaClass wclass) {
@@ -52,6 +54,26 @@
         }
     }
 
+    public Map getMap(XWikiContext context) {
+        List list = getList(context);
+        Map map = new HashMap();
+        if ((list==null)||(list.size()==0))
+         return map;
+        for(int i=0;i<list.size();i++) {
+            Object res = list.get(i);
+            if (res instanceof String)
+             map.put(res, res);
+            else {
+                String[] res2 = (String[]) res;
+                if (res2.length==1)
+                    map.put(res2[0], res2[0]);
+                else
+                    map.put(res2[0], res2[1]);
+            }
+        }
+        return map;
+    }
+
     public String getSql() {
         return getLargeStringValue("sql");
     }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -12,9 +12,7 @@
 import org.apache.ecs.xhtml.option;
 import org.apache.ecs.xhtml.select;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 public class GroupsClass extends ListClass {
 
@@ -41,6 +39,10 @@
         return list;
     }
 
+    public Map getMap(XWikiContext context) {
+        return new HashMap();
+    }
+
     public boolean isUsesList() {
         return (getIntValue("usesList")==1);
     }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/LevelsClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/LevelsClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/LevelsClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -12,9 +12,7 @@
 import org.apache.ecs.xhtml.option;
 import org.apache.ecs.xhtml.select;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 public class LevelsClass extends ListClass {
 
@@ -49,6 +47,10 @@
         return list;
     }
 
+    public Map getMap(XWikiContext context) {
+        return new HashMap();
+    }
+
     public BaseProperty newProperty() {
         return new StringProperty();
     }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -46,7 +46,7 @@
 		setDisplayType("select");
 		setMultiSelect(false);
 		setSize(1);
-	}
+    }
 
 	public ListClass(PropertyMetaClass wclass) {
 		this("list", "List", wclass);
@@ -56,7 +56,11 @@
 		this(null);
 	}
 
-	public String getDisplayType() {
+    public String getSeparators() {
+        return null;
+    }
+    
+    public String getDisplayType() {
 		return getStringValue("displayType");
 	}
 
@@ -88,19 +92,54 @@
 		setIntValue("relationalStorage", storage ? 1 : 0);
 	}
 
-	public static List getListFromString(String value) {
+    public static List getListFromString(String value) {
+        return getListFromString(value, "|", true);
+    }
+
+    public static List getListFromString(String value, String separators, boolean withMap) {
 		List list = new ArrayList();
 		if (value == null)
 			return list;
 
-		String val = StringUtils.replace(value, "\\|", "%PIPE%");
-		String[] result = StringUtils.split(val, "|");
-		for (int i = 0; i < result.length; i++)
-			list.add(StringUtils.replace(result[i], "%PIPE%", "|"));
-		return list;
+        if (separators==null)
+         separators = "|";
+
+        String val = value;
+        if (separators.length()==1)
+          val = StringUtils.replace(val, "\\" + separators, "%PIPE%");
+
+        String[] result = StringUtils.split(val, separators);
+		for (int i = 0; i < result.length; i++) {
+		    String element = StringUtils.replace(result[i], "%PIPE%", separators);
+            if (withMap&&(element.indexOf('=')!=-1)) {
+              list.add(StringUtils.split(element,"=")[0]);                
+            }
+            else
+              list.add(element);
+        }
+        return list;
 	}
 
-	public BaseProperty newProperty() {
+    public static Map getMapFromString(String value) {
+        Map map = new HashMap();
+        if (value == null)
+            return map;
+
+        String val = StringUtils.replace(value, "\\|", "%PIPE%");
+        String[] result = StringUtils.split(val, "|");
+        for (int i = 0; i < result.length; i++) {
+            String element = StringUtils.replace(result[i], "%PIPE%", "|");
+            if (element.indexOf('=')!=-1) {
+                String[] data = StringUtils.split(element,"=");
+                map.put(data[0], data[1]);
+            }
+            else
+              map.put(element, element);
+        }
+        return map;
+    }
+
+    public BaseProperty newProperty() {
 		BaseProperty lprop;
 
 		if (isRelationalStorage() && isMultiSelect())
@@ -111,7 +150,7 @@
 			lprop = new StringProperty();
 
 		if (isMultiSelect() && getDisplayType().equals("input")) {
-			((ListProperty) lprop).setFormStringSeparator("|");
+			((ListProperty) lprop).setFormStringSeparator("" + getSeparators().charAt(0));
 		}
 
 		return lprop;
@@ -119,25 +158,31 @@
 
 	public BaseProperty fromString(String value) {
 		BaseProperty prop = newProperty();
-		if (isMultiSelect()) {
-			if (!getDisplayType().equals("input")) {
-				((ListProperty) prop).setList(getListFromString(value));
-			} else {
-				((ListProperty) prop).setList(Arrays.asList(StringUtils.split(value, " ,|")));
-			}
-		} else
+        if (isMultiSelect()) {
+            ((ListProperty) prop).setList(getListFromString(value, getSeparators(), false));
+        } else
 			prop.setValue(value);
 		return prop;
 	}
 
 	public BaseProperty fromStringArray(String[] strings) {
-		if ((!isMultiSelect()) || (strings.length == 1))
+        BaseProperty prop = newProperty();
+        List list = new ArrayList();
+        ((ListProperty) prop).setList(list);
+		if (strings.length==0)
+         return prop;
+
+        if (!isMultiSelect())
 			return fromString(strings[0]);
-		List list = new ArrayList();
-		for (int i = 0; i < strings.length; i++)
+
+        if ((strings.length==1)&&getDisplayType().equals("input")) {
+            ((ListProperty) prop).setList(getListFromString(strings[0], getSeparators(), false));
+            return prop;
+        }
+
+        // If Multiselect and multiple results
+        for (int i = 0; i < strings.length; i++)
 			list.add(strings[i]);
-		BaseProperty prop = newProperty();
-		((ListProperty) prop).setList(list);
 		return prop;
 	}
 
@@ -163,7 +208,23 @@
 		return lprop;
 	}
 
-	public void displayHidden(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) {
+    protected String getDisplayValue(String value, Map map, XWikiContext context) {
+        String result = (String) map.get(value);
+        if (result==null)
+         result = value;
+        if ((context==null)||(context.getWiki()==null))
+         return result;
+        else {
+            String msgname = getFieldFullName() + "_" + result;
+            String newresult = context.getWiki().getMessage(msgname, context);
+            if (msgname.equals(newresult))
+             return result;
+            else
+             return newresult;
+        }
+    }
+
+    public void displayHidden(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) {
 		input input = new input();
 		BaseProperty prop = (BaseProperty) object.safeget(name);
 		if (prop != null)
@@ -178,11 +239,16 @@
 	public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) {
 		List selectlist;
 		BaseProperty prop = (BaseProperty) object.safeget(name);
+        Map map = getMap(context);
 		if ((prop instanceof ListProperty) || (prop instanceof DBStringListProperty)) {
 			selectlist = (List) prop.getValue();
-			buffer.append(StringUtils.join(selectlist.toArray(), " "));
-		} else {
-			buffer.append(prop.getValue().toString());
+            List newlist = new ArrayList();
+            for (int i=0; i<selectlist.size();i++) {
+                newlist.add(getDisplayValue((String)selectlist.get(i), map, context));
+            }
+            buffer.append(StringUtils.join(newlist.toArray(), " "));
+        } else {
+			buffer.append(getDisplayValue((String)prop.getValue(), map, context));
 		}
 	}
 
@@ -193,7 +259,7 @@
 			if (prop != null)
 				input.setValue(prop.toFormString());
 			input.setType("text");
-			input.setSize(60);
+			input.setSize(getSize());
 			input.setName(prefix + name);
 			input.setID(prefix + name);
 			buffer.append(input.toString());
@@ -206,6 +272,7 @@
 
 	protected void displayRadioEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) {
 		List list = getList(context);
+        Map map = getMap(context);
 		List selectlist;
 
 		BaseProperty prop = (BaseProperty) object.safeget(name);
@@ -225,16 +292,14 @@
 
 			if (selectlist.contains(value))
 				radio.setChecked(true);
-			radio.addElement(value);
-			buffer.append(radio.toString());
+			radio.addElement(getDisplayValue(value, map, context));
+            buffer.append(radio.toString());
 			if (it.hasNext()) {
 				buffer.append("<br/>");
 			}
 		}
 	}
 
-
-
     protected void displaySelectEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) {
 		select select = new select(prefix + name, 1);
 		select.setMultiple(isMultiSelect());
@@ -243,6 +308,7 @@
 		select.setID(prefix + name);
 
 		List list = getList(context);
+        Map map = getMap(context);
 		List selectlist;
 
 		BaseProperty prop = (BaseProperty) object.safeget(name);
@@ -258,7 +324,7 @@
 		// Add options from Set
 		for (Iterator it = list.iterator(); it.hasNext();) {
 			String value = it.next().toString();
-			String display = getDisplayValue(context, value);
+			String display = getDisplayValue(value, map, context);
 			option option = new option(value, value);
 			option.addElement(display);
 			if (selectlist.contains(value))
@@ -270,21 +336,8 @@
 	}
 
 	public abstract List getList(XWikiContext context);
+    public abstract Map getMap(XWikiContext context);
 
-	private String getDisplayValue(XWikiContext context, String value) {
-		try {
-			XWikiMessageTool msg = (XWikiMessageTool) context.get("msg");
-			String strname = "option_" + value;
-			String result = msg.get(strname);
-			if (result.equals(strname)) {
-				return value;
-			}
-			return result;
-		} catch (Exception e) {
-			return value;
-		}
-	}
-
     public String displaySearch(String name, String prefix, XWikiCriteria criteria, XWikiContext context){
         if (getDisplayType().equals("input")) {
             return super.displaySearch(name, prefix, criteria, context);
@@ -319,7 +372,7 @@
 
             if (selectlist.contains(value))
                 radio.setChecked(true);
-            radio.addElement(value);
+            radio.addElement(getDisplayValue(value, getMap(context), context));
             buffer.append(radio.toString());
             if(it.hasNext()){
             	buffer.append("<br/>");
@@ -356,7 +409,7 @@
         for (Iterator it=list.iterator();it.hasNext();) {
             String value = it.next().toString();
             option option = new option(value, value);
-            option.addElement(value);
+            option.addElement(getDisplayValue(value, getMap(context), context));
             if (selectlist.contains(value))
                 option.setSelected(true);
             select.addElement(option);

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -47,6 +47,7 @@
     private BaseClass object;
     private int id;
     private PropertyMetaClass pMetaClass;
+    private String validationRegExp;
 
     public PropertyClass() {
     }
@@ -360,4 +361,13 @@
 
     public void fromSearchMap(XWikiQuery query, Map map) {
     }
+
+    public void setValidationRegExp(String validationRegExp) {
+        this.validationRegExp = validationRegExp;
+    }
+
+    public String getValidationRegExp() {
+        return validationRegExp;
+    }
+
 }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/StaticListClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/StaticListClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/StaticListClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -26,11 +26,13 @@
 import com.xpn.xwiki.objects.meta.PropertyMetaClass;
 
 import java.util.List;
+import java.util.Map;
 
 public class StaticListClass extends ListClass {
 
     public StaticListClass(PropertyMetaClass wclass) {
         super("staticlist", "Static List", wclass);
+        setSeparators(" ,|");
     }
 
     public StaticListClass() {
@@ -45,8 +47,21 @@
         setStringValue("values", values);
     }
 
+    public String getSeparators() {
+        return getStringValue("separators");
+    }
+
+    public void setSeparators(String separators) {
+        setStringValue("separators", separators);
+    }
+
     public List getList(XWikiContext context) {
         String values = (String) getValues();
         return getListFromString(values);
     }
+
+    public Map getMap(XWikiContext context) {
+        String values = (String) getValues();
+        return getMapFromString(values);
+    }
 }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -12,9 +12,7 @@
 import org.apache.ecs.xhtml.option;
 import org.apache.ecs.xhtml.select;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 public class UsersClass extends ListClass {
 
@@ -40,6 +38,10 @@
         return list;
     }
 
+    public Map getMap(XWikiContext context) {
+        return new HashMap();
+    }
+
     public boolean isUsesList() {
         return (getIntValue("usesList")==1);
     }

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/PropertyMetaClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/PropertyMetaClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/PropertyMetaClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -67,6 +67,12 @@
         number_class.setPrettyName("Number");
         number_class.setNumberType("integer");
         safeput("number", number_class);
+
+        StringClass validationRegExp_class = new StringClass(this);
+        validationRegExp_class.setName("validationRegExp");
+        validationRegExp_class.setPrettyName("Validation Regular Expression");
+        validationRegExp_class.setSize(40);
+        safeput("validationRegExp", validationRegExp_class);
     }
 
     public BaseCollection getObject() {

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/StaticListMetaClass.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/StaticListMetaClass.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/objects/meta/StaticListMetaClass.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -40,6 +40,12 @@
         values_class.setPrettyName("Values");
         values_class.setSize(40);
         safeput("values", values_class);
+
+        StringClass separators_class = new StringClass(this);
+        separators_class.setName("separators");
+        separators_class.setPrettyName("Separators");
+        separators_class.setSize(5);
+        safeput("separators", separators_class);        
     }
 
     public BaseCollection newObject(XWikiContext context) {

Added: xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiDefaultValidation.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiDefaultValidation.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiDefaultValidation.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -0,0 +1,14 @@
+package com.xpn.xwiki.validation;
+
+import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.objects.BaseObject;
+import com.xpn.xwiki.doc.XWikiDocument;
+
+public class XWikiDefaultValidation implements XWikiValidationInterface {
+    public boolean validateDocument(XWikiDocument doc, XWikiContext context) {
+        return true;
+    }
+    public boolean validateObject(BaseObject object, XWikiContext context) {
+        return true;
+    }
+}

Added: xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationException.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationException.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationException.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author jeremi
+ */
+package com.xpn.xwiki.validation;
+
+import com.xpn.xwiki.XWikiException;
+
+public class XWikiValidationException extends XWikiException {
+}

Added: xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationInterface.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationInterface.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationInterface.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -0,0 +1,10 @@
+package com.xpn.xwiki.validation;
+
+import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.objects.BaseObject;
+import com.xpn.xwiki.doc.XWikiDocument;
+
+public interface XWikiValidationInterface {
+    public boolean validateDocument(XWikiDocument doc, XWikiContext context);
+    public boolean validateObject(BaseObject object, XWikiContext context);
+}

Modified: xwiki/trunk/core/src/main/resources/xwiki.hbm.xml
===================================================================
--- xwiki/trunk/core/src/main/resources/xwiki.hbm.xml	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/core/src/main/resources/xwiki.hbm.xml	2006-10-19 02:23:21 UTC (rev 1408)
@@ -86,11 +86,15 @@
         <property name="elements" type="integer" not-null="true">
             <column name="XWD_ELEMENTS" />
         </property>
-        
+
         <property name="defaultTemplate" type="string">
             <column name="XWD_DEFAULT_TEMPLATE" />
         </property>
 
+        <property name="validationScript" type="string">
+            <column name="XWD_VALIDATION_SCRIPT" />
+        </property>
+
     </class>
 
     <class name="com.xpn.xwiki.doc.XWikiDocumentArchive" table="xwikidoc">
@@ -125,7 +129,7 @@
             <column name="XWL_FULLNAME" length="255"/>
         </property>
     </class>
-    
+
     <class name="com.xpn.xwiki.doc.XWikiAttachment" table="xwikiattachment">
         <id name="id" type="long" unsaved-value="any">
             <column name="XWA_ID" not-null="true"/>
@@ -202,6 +206,9 @@
         <property name="customDisplay" type="string">
             <column name="XWP_CUSTOMDISPLAY" length="60000" />
         </property>
+        <property name="validationRegExp" type="string">
+            <column name="XWP_VALIDATION_REGEXP" />
+        </property>
 
         <joined-subclass name="com.xpn.xwiki.objects.classes.NumberClass" table="xwikinumberclasses">
             <key>
@@ -350,6 +357,9 @@
         <property name="customClass" type="string">
             <column name="XWO_CUSTOM_CLASS" length="255"/>
         </property>
+        <property name="validationScript" type="string">
+            <column name="XWO_VALIDATION_SCRIPT" />
+        </property>
     </class>
 
 
@@ -749,7 +759,7 @@
             <column name="XWP_DATE" />
         </property>
     </class>
-    
+
     <!-- XWikiPreferences custom mapping -->
     <!--
     <class entity-name="XWiki.XWikiUsers" table="xwikiusers">

Modified: xwiki/trunk/src/test/java/com/xpn/xwiki/test/ClassesTest.java
===================================================================
--- xwiki/trunk/src/test/java/com/xpn/xwiki/test/ClassesTest.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/src/test/java/com/xpn/xwiki/test/ClassesTest.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -36,14 +36,7 @@
 import com.xpn.xwiki.objects.ListProperty;
 import com.xpn.xwiki.objects.NumberProperty;
 import com.xpn.xwiki.objects.StringProperty;
-import com.xpn.xwiki.objects.classes.BaseClass;
-import com.xpn.xwiki.objects.classes.BooleanClass;
-import com.xpn.xwiki.objects.classes.NumberClass;
-import com.xpn.xwiki.objects.classes.PasswordClass;
-import com.xpn.xwiki.objects.classes.PropertyClass;
-import com.xpn.xwiki.objects.classes.StaticListClass;
-import com.xpn.xwiki.objects.classes.StringClass;
-import com.xpn.xwiki.objects.classes.TextAreaClass;
+import com.xpn.xwiki.objects.classes.*;
 
 public class ClassesTest extends TestCase {
 
@@ -137,6 +130,7 @@
         StaticListClass pclass = new StaticListClass();
         pclass.setMultiSelect(true);
         pclass.setDisplayType("input");
+        pclass.setSeparators("|, ");
 
         ListProperty property;
         property = (ListProperty)pclass.fromString ("1");
@@ -193,23 +187,63 @@
         testDisplayer(cname, obj, bclass, viewexpected, editexpected, null);
     }
 
-    public static void testDisplayer(String cname, BaseObject obj, BaseClass bclass, String viewexpected, String editexpected, XWikiContext context) {
+    public static void testDisplayer(String cname, BaseObject obj, BaseClass bclass, String[] viewexpected, String[] editexpected) {
+        testDisplayer(cname, obj, bclass, viewexpected, editexpected, null);
+    }
+
+    public static void testDisplayer(String cname, BaseObject obj, BaseClass bclass, String[] viewexpected, String[] editexpected, XWikiContext context) {
         if (context==null)
             context = new XWikiContext();
         StringBuffer result = new StringBuffer();
         PropertyClass pclass = (PropertyClass)bclass.get(cname);
         pclass.displayView(result,cname, "", obj, context);
-        assertEquals("Class " + cname + " view displayer not correct:\n" +
-            "Expected: " + viewexpected + "\nResult: " + result,
-            viewexpected.toLowerCase(), result.toString().toLowerCase());
-
+        for (int i=0;i<viewexpected.length;i++) {
+         assertEquals("Class " + cname + " view displayer not correct:\n" +
+            "Expected: " + viewexpected[i] + "\nResult: " + result,
+            viewexpected[i].toLowerCase(), result.toString().toLowerCase());
+        }
         result = new StringBuffer();
-        pclass.displayEdit(result,cname, "", obj, context);
-        assertTrue("Class " + cname + " edit displayer not correct" +
-            "\nExpected: " + editexpected + "\nResult: " + result,
-            result.toString().toLowerCase().indexOf(editexpected.toLowerCase())!=-1);
+        for (int i=0;i<editexpected.length;i++) {
+         pclass.displayEdit(result,cname, "", obj, context);
+         assertTrue("Class " + cname + " edit displayer not correct" +
+            "\nExpected: " + editexpected[i] + "\nResult: " + result,
+            result.toString().toLowerCase().indexOf(editexpected[i].toLowerCase())!=-1);
+        }
 
         pclass.displayHidden(result,cname, "", obj, context);
         pclass.displaySearch(result,cname, "", new XWikiQuery(), context);
     }
+
+    public static void testDisplayer(String cname, BaseObject obj, BaseClass bclass, String viewexpected, String editexpected, XWikiContext context) {
+        String[] viewexpected2 = new String[1];
+        viewexpected2[0] = viewexpected;
+        String[] editexpected2 = new String[1];
+        editexpected2[0] = editexpected;
+        testDisplayer(cname, obj, bclass, viewexpected2, editexpected2, context );
+    }
+
+    /**
+     * 
+     * @throws XWikiException
+     */
+    public void testListMapDisplayers() throws XWikiException {
+        XWikiDocument doc = new XWikiDocument();
+        Utils.prepareAdvancedObject(doc);
+        BaseClass bclass = doc.getxWikiClass();
+        ((StaticListClass)bclass.get("category")).setValues("1=France|2=Germany|3=UK|4=USA|5=Other");
+        ((StaticListClass)bclass.get("category2")).setValues("1=France|2=Germany|3=UK|4=USA|5=Other");
+        ((StaticListClass)bclass.get("category3")).setValues("1=France|2=Germany|3=UK|4=USA|5=Other");
+        BaseObject obj = doc.getObject(bclass.getName(), 0);
+
+        String[] viewresult = {"France"};
+        String[] editresult = {"<select", ">France"};
+        testDisplayer("category", obj, bclass, viewresult, editresult);
+        viewresult = new String[] {"France Germany"};
+        editresult = new String[] {"<select", "multiple", ">France", ">Germany", ">UK"};
+        testDisplayer("category2", obj, bclass, viewresult, editresult);
+        viewresult = new String[] {"France Germany"};
+        editresult = new String[] {"<select", "multiple", ">France"};
+        testDisplayer("category3", obj, bclass, viewresult, editresult);
+    }
+
 }

Modified: xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiDocumentTest.java
===================================================================
--- xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiDocumentTest.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiDocumentTest.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -23,11 +23,294 @@
 
 import com.xpn.xwiki.doc.XWikiDocument;
 import com.xpn.xwiki.XWikiException;
+import com.xpn.xwiki.validation.XWikiValidationException;
+import com.xpn.xwiki.objects.classes.BaseClass;
+import com.xpn.xwiki.objects.classes.StringClass;
+import com.xpn.xwiki.web.XWikiRequest;
 import com.xpn.xwiki.api.Document;
 
+import java.util.HashMap;
+import java.util.Map;
+
 public class XWikiDocumentTest  extends HibernateTestCase {
 
+    protected String invalidGroovy1 = "public class ValidationTest implements XWikiValidationInterface { public boolean validateDocument(doc, context} { return false; };";
+    protected String validGroovy1 = "public class ValidationTest implements XWikiValidationInterface  extends XWikiDefaultValidation { public boolean validateDocument(doc, context} { if (doc.content.length>10) return false; else return true; };";
+    protected String invalidGroovy2 = invalidGroovy1;
+    protected String validGroovy2 = "public class ValidationTest implements XWikiValidationInterface  extends XWikiDefaultValidation { public boolean validateObject(object, context} { if (object.get(\"test\").length()>10) return false; else return true; };";
 
+    public void testValidationAPI() throws XWikiException {
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest1", context);
+        xwiki.validateDocument(doc, context);
+    }
+
+    public void testValidationScriptFailsToCompile() throws XWikiException {
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy1);
+        xwiki.saveDocument(scriptdoc, context);
+
+        Map map = new HashMap();
+        map.put("xvalidation", "Test.ValidationGroovy");
+        XWikiRequest request = new XWikiFakeRequest(map);
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have failed with XWikiException and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            // Without a script we should get here
+            return;
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationScriptFails() throws XWikiException {
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setContent("abcdefghijklmnopqrstuvwxyz");
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy1);
+        xwiki.saveDocument(scriptdoc, context);
+        Map map = new HashMap();
+        map.put("xvalidation", "Test.ValidationGroovy");
+        XWikiRequest request = new XWikiFakeRequest(map);
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            // This is good our validation has failed
+            return;
+        } catch (XWikiException e) {
+            assertTrue("Validation should have failed with XWikiValidationException and it failed with XWikiException", false);
+            // This is not good the validation script failed to be run
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationScriptWorks() throws XWikiException {
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setContent("abcdef");
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy1);
+        xwiki.saveDocument(scriptdoc, context);
+        Map map = new HashMap();
+        map.put("xvalidation", "Test.ValidationGroovy");
+        XWikiRequest request = new XWikiFakeRequest(map);
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have worked and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            assertTrue("Validation should have worked and it failed with XWikiException", false);
+        }
+    }
+
+    public void testValidationDocScriptFailsToCompile() throws XWikiException {
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy1);
+        xwiki.saveDocument(scriptdoc, context);
+
+        doc.setValidationScript("Test.ValidationGroovy");
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have failed with XWikiException and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            // Without a script we should get here
+            return;
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationDocScriptFails() throws XWikiException {
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setContent("abcdefghijklmnopqrstuvwxyz");
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy1);
+        xwiki.saveDocument(scriptdoc, context);
+        doc.setValidationScript("Test.ValidationGroovy");
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            // This is good our validation has failed
+            return;
+        } catch (XWikiException e) {
+            assertTrue("Validation should have failed with XWikiValidationException and it failed with XWikiException", false);
+            // This is not good the validation script failed to be run
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationDocScriptWorks() throws XWikiException {
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setContent("abcdef");
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy1);
+        xwiki.saveDocument(scriptdoc, context);
+        doc.setValidationScript("Test.ValidationGroovy");
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have worked and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            assertTrue("Validation should have worked and it failed with XWikiException", false);
+        }
+    }
+
+
+    public void testValidationClassScriptFailsToCompile() throws XWikiException {
+        XWikiDocument classdoc  = xwiki.getDocument("Test.ValidationClass", context);
+        BaseClass bclass = classdoc.getxWikiClass();
+        bclass.setValidationScript("Test.ValidationGroovy");
+        bclass.addTextField("test", "test", 10);
+
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setStringValue("Test.ValidationClass", "test", "abcdefghijklmnopqrstuvwxyz");
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy2);
+        xwiki.saveDocument(scriptdoc, context);
+
+        Map map = new HashMap();
+        map.put("xvalidation", "Test.ValidationGroovy");
+        XWikiRequest request = new XWikiFakeRequest(map);
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have failed with XWikiException and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            // Without a script we should get here
+            return;
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationClassScriptFails() throws XWikiException {
+        XWikiDocument classdoc  = xwiki.getDocument("Test.ValidationClass", context);
+        BaseClass bclass = classdoc.getxWikiClass();
+        bclass.setValidationScript("Test.ValidationGroovy1");
+        bclass.addTextField("test", "test", 10);
+
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setStringValue("Test.ValidationClass", "test", "abcdefghijklmnopqrstuvwxyz");
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(validGroovy2);
+
+        xwiki.saveDocument(scriptdoc, context);
+        Map map = new HashMap();
+        map.put("xvalidation", "Test.ValidationGroovy");
+        XWikiRequest request = new XWikiFakeRequest(map);
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            // This is good our validation has failed
+            return;
+        } catch (XWikiException e) {
+            assertTrue("Validation should have failed with XWikiValidationException and it failed with XWikiException", false);
+            // This is not good the validation script failed to be run
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationClassScriptWorks() throws XWikiException {
+        XWikiDocument classdoc  = xwiki.getDocument("Test.ValidationClass", context);
+        BaseClass bclass = classdoc.getxWikiClass();
+        bclass.setValidationScript("Test.ValidationGroovy");
+        bclass.addTextField("test", "test", 10);
+
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setStringValue("Test.ValidationClass", "test", "abcdef");
+
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(validGroovy2);
+
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have worked and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            assertTrue("Validation should have worked and it failed with XWikiException", false);
+        }
+    }
+
+
+    public void testValidationFieldRegExpInvalid() throws XWikiException {
+        XWikiDocument classdoc  = xwiki.getDocument("Test.ValidationClass", context);
+        BaseClass bclass = classdoc.getxWikiClass();
+
+        // Add regexp to field
+        bclass.addTextField("test", "test", 10);
+        ((StringClass)bclass.get("test")).setValidationRegExp("/dfdgfg///");
+
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(invalidGroovy2);
+        xwiki.saveDocument(scriptdoc, context);
+
+        Map map = new HashMap();
+        map.put("xvalidation", "Test.ValidationGroovy");
+        XWikiRequest request = new XWikiFakeRequest(map);
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have failed with XWikiException and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            // Without a script we should get here
+            return;
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationFieldRegexpFails() throws XWikiException {
+        XWikiDocument classdoc  = xwiki.getDocument("Test.ValidationClass", context);
+        BaseClass bclass = classdoc.getxWikiClass();
+
+        // Add regexp to field
+        bclass.addTextField("test", "test", 10);
+        ((StringClass)bclass.get("test")).setValidationRegExp("abc.*xyz");
+
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(validGroovy2);
+
+        xwiki.saveDocument(scriptdoc, context);
+        Map map = new HashMap();
+        map.put("xvalidation", "Test.ValidationGroovy");
+        XWikiRequest request = new XWikiFakeRequest(map);
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            // This is good our validation has failed
+            return;
+        } catch (XWikiException e) {
+            assertTrue("Validation should have failed with XWikiValidationException and it failed with XWikiException", false);
+            // This is not good the validation script failed to be run
+        }
+        assertTrue("Validation should have failed with XWikiException and it did not fail", false);
+    }
+
+    public void testValidationFieldRegexpWorks() throws XWikiException {
+        XWikiDocument classdoc  = xwiki.getDocument("Test.ValidationClass", context);
+        BaseClass bclass = classdoc.getxWikiClass();
+
+        // Add regexp to field
+        bclass.addTextField("test", "test", 10);
+        ((StringClass)bclass.get("test")).setValidationRegExp("abc.*xyz");
+
+        XWikiDocument doc  = xwiki.getDocument("Test.ValidationTest", context);
+        doc.setStringValue("Test.ValidationClass", "test", "abcdefghijklmnopqrstuvwxyz");
+
+        XWikiDocument scriptdoc  = xwiki.getDocument("Test.ValidationGroovy", context);
+        scriptdoc.setContent(validGroovy2);
+
+        try {
+         xwiki.validateDocument(doc, context);
+        } catch (XWikiValidationException e) {
+            assertTrue("Validation should have worked and it failed with XWikiValidationException", false);
+        } catch (XWikiException e) {
+            assertTrue("Validation should have worked and it failed with XWikiException", false);
+        }
+    }
+
+
     public void testCustomClass() throws XWikiException {
         XWikiDocument doc  = xwiki.getDocument("Test.CustomTest", context);
         doc.setCustomClass(CustomDocumentClass.class.getName());

Added: xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiFakeRequest.java
===================================================================
--- xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiFakeRequest.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiFakeRequest.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -0,0 +1,405 @@
+/* Copyright 2006, XpertNet SARL, and individual contributors as indicated
+* by the contributors.txt.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*
+*
+ at author ludovic
+*/
+
+package com.xpn.xwiki.test;
+
+import com.xpn.xwiki.web.XWikiRequest;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.ServletInputStream;
+import javax.servlet.RequestDispatcher;
+import javax.portlet.*;
+import java.util.*;
+import java.security.Principal;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.io.BufferedReader;
+import java.io.InputStream;
+
+public class XWikiFakeRequest implements XWikiRequest {
+    protected Map map;
+
+    public XWikiFakeRequest(Map map) {
+        this.map = map;
+    }
+
+    public boolean isWindowStateAllowed(WindowState windowState) {
+        return false;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public boolean isPortletModeAllowed(PortletMode portletMode) {
+        return false;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public PortletMode getPortletMode() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public WindowState getWindowState() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public PortletPreferences getPreferences() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public PortletSession getPortletSession() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public PortletSession getPortletSession(boolean b) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public String getProperty(String string) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Enumeration getProperties(String string) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Enumeration getPropertyNames() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public PortalContext getPortalContext() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public String getAuthType() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Cookie[] getCookies() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public long getDateHeader(String arg0) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public String getHeader(String arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Enumeration getHeaders(String arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Enumeration getHeaderNames() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public int getIntHeader(String arg0) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public String getMethod() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getPathInfo() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getPathTranslated() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getContextPath() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getQueryString() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getRemoteUser() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public boolean isUserInRole(String arg0) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public Principal getUserPrincipal() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getRequestedSessionId() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getRequestURI() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public StringBuffer getRequestURL() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getServletPath() {
+		return "";
+	}
+
+	public HttpSession getSession(boolean arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public HttpSession getSession() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public boolean isRequestedSessionIdValid() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+    public String getResponseContentType() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Enumeration getResponseContentTypes() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public boolean isRequestedSessionIdFromCookie() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean isRequestedSessionIdFromURL() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean isRequestedSessionIdFromUrl() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public Object getAttribute(String arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Enumeration getAttributeNames() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getCharacterEncoding() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+    public InputStream getPortletInputStream() throws IOException {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void setCharacterEncoding(String arg0)
+			throws UnsupportedEncodingException {
+		// TODO Auto-generated method stub
+
+	}
+
+	public int getContentLength() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public String getContentType() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public ServletInputStream getInputStream() throws IOException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+    public String getParameter(String arg0) {
+        Object obj = map.get(arg0);
+        if (obj instanceof String[])
+            return ((String[])obj)[0];
+        if (obj instanceof String)
+            return (String)obj;
+        else
+            return obj.toString();
+    }
+
+	public Enumeration getParameterNames() {
+	    Vector v = new Vector();
+        Iterator it = map.keySet().iterator();
+        while (it.hasNext()) {
+            v.add(it.next());
+        }
+       return v.elements();
+	}
+
+	public String[] getParameterValues(String arg0) {
+        Object obj = map.get(arg0);
+        if (obj instanceof String[])
+            return (String[])obj;
+        if (obj instanceof String) {
+            String[] res = new String[1];
+            res[0] = (String)obj;
+            return res;
+        }
+        else {
+            String[] res = new String[1];
+            res[0] = obj.toString();
+            return res;
+        }
+	}
+
+	public Map getParameterMap() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getProtocol() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getScheme() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getServerName() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+    public int getServerPort() {
+        return 0;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public int getServerort() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public BufferedReader getReader() throws IOException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getRemoteAddr() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getRemoteHost() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void setAttribute(String arg0, Object arg1) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public void removeAttribute(String arg0) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public Locale getLocale() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Enumeration getLocales() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public boolean isSecure() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public RequestDispatcher getRequestDispatcher(String arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getRealPath(String arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public int getRemotePort() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public String getLocalName() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getLocalAddr() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public int getLocalPort() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+    public String get(String name) {
+        return getParameter(name);
+    }
+
+    public HttpServletRequest getHttpServletRequest() {
+        return null;  
+    }
+}
+

Modified: xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiTest.java
===================================================================
--- xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiTest.java	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/src/test/java/com/xpn/xwiki/test/XWikiTest.java	2006-10-19 02:23:21 UTC (rev 1408)
@@ -75,11 +75,11 @@
         getXWiki().createUser("LudovicDubost", map, "", "", "view, edit", getXWikiContext());
         XWikiDocument doc = getXWiki().getDocument("XWiki.LudovicDubost", getXWikiContext());
         String xml = doc.getXMLContent(getXWikiContext());
-        assertTrue("XML should should contain password field", xml.indexOf("<password>")!=-1);
+        assertTrue("XML should contain password field", xml.indexOf("<password>")!=-1);
         assertTrue("XML should contain password", xml.indexOf("toto")!=-1);
         Document ddoc = doc.newDocument(getXWikiContext());
         xml = ddoc.getXMLContent();
-        assertTrue("XML should should contain password field", xml.indexOf("<password>")!=-1);
+        assertTrue("XML should contain password field", xml.indexOf("<password>")!=-1);
         assertTrue("XML should not contain password", xml.indexOf("toto")==-1);
     }
 

Modified: xwiki/trunk/src/test/resources/xwiki.hbm.xml
===================================================================
--- xwiki/trunk/src/test/resources/xwiki.hbm.xml	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/src/test/resources/xwiki.hbm.xml	2006-10-19 02:23:21 UTC (rev 1408)
@@ -70,6 +70,11 @@
             <column name="XWD_VERSION" length="255" not-null="true"/>
         </property>
 
+        <property name="customClass" type="string">
+            <column name="XWD_CUSTOM_CLASS" length="255" not-null="true"/>
+        </property>
+
+
         <property name="parent" type="string">
             <column name="XWD_PARENT" length="511" not-null="true"/>
         </property>
@@ -86,6 +91,10 @@
             <column name="XWD_DEFAULT_TEMPLATE" />
         </property>
 
+        <property name="validationScript" type="string">
+            <column name="XWD_VALIDATION_SCRIPT" />
+        </property>
+
     </class>
 
     <class name="com.xpn.xwiki.doc.XWikiDocumentArchive" table="xwikidoc">
@@ -194,6 +203,12 @@
         <property name="number" type="integer">
             <column name="XWP_NUMBER" />
         </property>
+        <property name="customDisplay" type="string">
+            <column name="XWP_CUSTOMDISPLAY" length="60000" />
+        </property>
+        <property name="validationRegExp" type="string">
+            <column name="XWP_VALIDATION_REGEXP" />
+        </property>
 
         <joined-subclass name="com.xpn.xwiki.objects.classes.NumberClass" table="xwikinumberclasses">
             <key>
@@ -342,6 +357,9 @@
         <property name="customClass" type="string">
             <column name="XWO_CUSTOM_CLASS" length="255"/>
         </property>
+        <property name="validationScript" type="string">
+            <column name="XWO_VALIDATION_SCRIPT" />
+        </property>
     </class>
 
 

Modified: xwiki/trunk/xwiki.iml
===================================================================
--- xwiki/trunk/xwiki.iml	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/xwiki.iml	2006-10-19 02:23:21 UTC (rev 1408)
@@ -148,6 +148,14 @@
       <attribute name="method" value="1" />
       <attribute name="URI" value="/WEB-INF/lib" />
     </containerElement>
+    <containerElement type="library" name="Tomcat" level="application_server_libraries">
+      <attribute name="method" value="0" />
+      <attribute name="URI" value="&lt;N/A&gt;" />
+    </containerElement>
+    <containerElement type="library" name="Tomcat 5.0" level="application">
+      <attribute name="method" value="0" />
+      <attribute name="URI" value="&lt;N/A&gt;" />
+    </containerElement>
     <containerElement type="library" name="Unit Tests" level="project">
       <attribute name="method" value="1" />
       <attribute name="URI" value="/WEB-INF/lib" />

Modified: xwiki/trunk/xwiki.ipr
===================================================================
--- xwiki/trunk/xwiki.ipr	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/xwiki.ipr	2006-10-19 02:23:21 UTC (rev 1408)
@@ -103,15 +103,15 @@
         <used_levels>
           <error>
             <option name="myName" value="ERROR" />
-            <option name="myVal" value="200" />
+            <option name="myVal" value="400" />
           </error>
           <warning>
             <option name="myName" value="WARNING" />
-            <option name="myVal" value="100" />
+            <option name="myVal" value="300" />
           </warning>
           <information>
             <option name="myName" value="INFO" />
-            <option name="myVal" value="100" />
+            <option name="myVal" value="200" />
           </information>
           <server>
             <option name="myName" value="SERVER PROBLEM" />
@@ -305,11 +305,7 @@
   </component>
   <component name="StarteamVcsAdapter" />
   <component name="UI designer component loader factory" />
-  <component name="VssVcs">
-    <SourceSafePersistencyRemovedFolder>C:/dev/maven/trunks/plugins/maven-clover-plugin/src/main/java/org/apache/maven/plugin/clover/internal/execution</SourceSafePersistencyRemovedFolder>
-    <SourceSafePersistencyRemovedFolder>C:/dev/maven/trunks/plugins/maven-clover-plugin/src/it/notests/src/main/java/org/apache/maven/plugin/clover/samples/simple</SourceSafePersistencyRemovedFolder>
-    <SourceSafePersistencyRemovedFolder>C:/dev/maven/trunks/plugins/maven-clover-plugin/src/it/notest</SourceSafePersistencyRemovedFolder>
-  </component>
+  <component name="VssVcs" />
   <component name="WebManager">
     <option enabled="true" />
   </component>
@@ -511,7 +507,6 @@
       <CLASSES>
         <root url="jar://$PROJECT_DIR$/lib/googleadwords.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/googleapi.jar!/" />
-        <root url="jar://$PROJECT_DIR$/lib/alexa.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/terraservice.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/ipresolver.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/flickrapi-1.0a7.jar!/" />
@@ -530,9 +525,8 @@
     <library name="JCR">
       <CLASSES>
         <root url="jar://$PROJECT_DIR$/lib/jcr-1.0.jar!/" />
-        <root url="jar://$PROJECT_DIR$/lib/jackrabbit-jcr-commons-1.0.1.jar!/" />
-        <root url="jar://$PROJECT_DIR$/lib/jackrabbit-core-1.0.1.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/graffito-jcr-mapping-1.0-a1-amelentev-dev.jar!/" />
+        <root url="jar://$PROJECT_DIR$/lib/jackrabbit-core-1.1.jar!/" />
       </CLASSES>
       <JAVADOC />
       <SOURCES />
@@ -565,8 +559,9 @@
     </library>
     <library name="Jrcs">
       <CLASSES>
-        <root url="jar://$PROJECT_DIR$/lib/org.suigeneris.jrcs.rcs-0.3.0-xwiki.jar!/" />
-        <root url="jar://$PROJECT_DIR$/lib/org.suigeneris.jrcs.diff-0.3.0-xwiki.jar!/" />
+        <root url="jar://C:/dev/java/xwiki/lib/org.suigeneris.jrcs.rcs-0.3.0.jar!/" />
+        <root url="jar://C:/dev/java/xwiki/lib/org.suigeneris.jrcs.diff-0.3.0.jar!/" />
+        <root url="jar://C:/dev/java/xwiki/lib/org.suigeneris.jrcs.tests-0.3.0.jar!/" />
       </CLASSES>
       <JAVADOC />
       <SOURCES>

Modified: xwiki/trunk/xwiki.iws
===================================================================
--- xwiki/trunk/xwiki.iws	2006-10-18 20:59:05 UTC (rev 1407)
+++ xwiki/trunk/xwiki.iws	2006-10-19 02:23:21 UTC (rev 1408)
@@ -31,7 +31,35 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" name="Default" comment="">
-      <change type="DELETED" beforePath="C:\dev\java\xwikisvn\xwiki\trunk\lib\oscache-2.3.2.jar" afterPath="" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/validation" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/DBListClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/DBListClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwiki.iws" afterPath="$PROJECT_DIR$/xwiki.iws" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationException.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/resources/xwiki.hbm.xml" afterPath="$PROJECT_DIR$/src/test/resources/xwiki.hbm.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/resources/xwiki.hbm.xml" afterPath="$PROJECT_DIR$/core/src/main/resources/xwiki.hbm.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/LevelsClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/LevelsClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/XWikiContext.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/XWikiContext.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/validation/XWikiValidationInterface.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/XWikiTest.java" afterPath="$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/XWikiTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/XWikiDocumentTest.java" afterPath="$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/XWikiDocumentTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwikibase.iml" afterPath="$PROJECT_DIR$/xwikibase.iml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/api/XWiki.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/api/XWiki.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwiki.iml" afterPath="$PROJECT_DIR$/xwiki.iml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwiki.ipr" afterPath="$PROJECT_DIR$/xwiki.ipr" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/ClassesTest.java" afterPath="$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/ClassesTest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/StringListProperty.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/StringListProperty.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/meta/PropertyMetaClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/meta/PropertyMetaClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/meta/StaticListMetaClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/meta/StaticListMetaClass.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/validation/XWikiDefaultValidation.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/XWiki.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/XWiki.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/XWikiFakeRequest.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/StaticListClass.java" afterPath="$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/StaticListClass.java" />
     </list>
   </component>
   <component name="ChangeListSynchronizer" />
@@ -279,6 +307,71 @@
         <option name="CONDITION" value="" />
         <option name="LOG_MESSAGE" value="" />
       </breakpoint>
+      <breakpoint url="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java" line="250" class="com.xpn.xwiki.objects.classes.ListClass" package="com.xpn.xwiki.objects.classes">
+        <option name="ENABLED" value="true" />
+        <option name="SUSPEND_POLICY" value="SuspendAll" />
+        <option name="LOG_ENABLED" value="false" />
+        <option name="LOG_EXPRESSION_ENABLED" value="false" />
+        <option name="COUNT_FILTER_ENABLED" value="false" />
+        <option name="COUNT_FILTER" value="0" />
+        <option name="CONDITION_ENABLED" value="false" />
+        <option name="CLASS_FILTERS_ENABLED" value="false" />
+        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
+        <option name="CONDITION" value="" />
+        <option name="LOG_MESSAGE" value="" />
+      </breakpoint>
+      <breakpoint url="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/ListClass.java" line="246" class="com.xpn.xwiki.objects.classes.ListClass" package="com.xpn.xwiki.objects.classes">
+        <option name="ENABLED" value="true" />
+        <option name="SUSPEND_POLICY" value="SuspendAll" />
+        <option name="LOG_ENABLED" value="false" />
+        <option name="LOG_EXPRESSION_ENABLED" value="false" />
+        <option name="COUNT_FILTER_ENABLED" value="false" />
+        <option name="COUNT_FILTER" value="0" />
+        <option name="CONDITION_ENABLED" value="false" />
+        <option name="CLASS_FILTERS_ENABLED" value="false" />
+        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
+        <option name="CONDITION" value="" />
+        <option name="LOG_MESSAGE" value="" />
+      </breakpoint>
+      <breakpoint url="file://$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/ClassesTest.java" line="140" class="com.xpn.xwiki.test.ClassesTest" package="com.xpn.xwiki.test">
+        <option name="ENABLED" value="true" />
+        <option name="SUSPEND_POLICY" value="SuspendAll" />
+        <option name="LOG_ENABLED" value="false" />
+        <option name="LOG_EXPRESSION_ENABLED" value="false" />
+        <option name="COUNT_FILTER_ENABLED" value="false" />
+        <option name="COUNT_FILTER" value="0" />
+        <option name="CONDITION_ENABLED" value="false" />
+        <option name="CLASS_FILTERS_ENABLED" value="false" />
+        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
+        <option name="CONDITION" value="" />
+        <option name="LOG_MESSAGE" value="" />
+      </breakpoint>
+      <breakpoint url="file://$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/ClassesTest.java" line="138" class="com.xpn.xwiki.test.ClassesTest" package="com.xpn.xwiki.test">
+        <option name="ENABLED" value="true" />
+        <option name="SUSPEND_POLICY" value="SuspendAll" />
+        <option name="LOG_ENABLED" value="false" />
+        <option name="LOG_EXPRESSION_ENABLED" value="false" />
+        <option name="COUNT_FILTER_ENABLED" value="false" />
+        <option name="COUNT_FILTER" value="0" />
+        <option name="CONDITION_ENABLED" value="false" />
+        <option name="CLASS_FILTERS_ENABLED" value="false" />
+        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
+        <option name="CONDITION" value="" />
+        <option name="LOG_MESSAGE" value="" />
+      </breakpoint>
+      <breakpoint url="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java" line="2482" class="com.xpn.xwiki.doc.XWikiDocument" package="com.xpn.xwiki.doc">
+        <option name="ENABLED" value="true" />
+        <option name="SUSPEND_POLICY" value="SuspendAll" />
+        <option name="LOG_ENABLED" value="false" />
+        <option name="LOG_EXPRESSION_ENABLED" value="false" />
+        <option name="COUNT_FILTER_ENABLED" value="false" />
+        <option name="COUNT_FILTER" value="0" />
+        <option name="CONDITION_ENABLED" value="false" />
+        <option name="CLASS_FILTERS_ENABLED" value="false" />
+        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
+        <option name="CONDITION" value="" />
+        <option name="LOG_MESSAGE" value="" />
+      </breakpoint>
     </line_breakpoints>
     <breakpoint_any>
       <breakpoint>
@@ -603,75 +696,91 @@
   </component>
   <component name="FileEditorManager">
     <leaf>
-      <file leaf-file-name="log4j.properties" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/test/resources/log4j.properties">
+      <file leaf-file-name="ClassesTest.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/ClassesTest.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="0" column="7" selection-start="7" selection-end="7" vertical-scroll-proportion="0.0">
+            <state line="240" column="43" selection-start="11420" selection-end="11420" vertical-scroll-proportion="0.91274">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="web.xml" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/main/web.xml">
+      <file leaf-file-name="PropertyClass.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="10" column="98" selection-start="300" selection-end="300" vertical-scroll-proportion="0.022110553">
+            <state line="368" column="34" selection-start="12279" selection-end="12279" vertical-scroll-proportion="1.032258">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="pom.xml" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/pom.xml">
+      <file leaf-file-name="XWikiTest.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/XWikiTest.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="25" column="19" selection-start="996" selection-end="996" vertical-scroll-proportion="0.5527638">
+            <state line="139" column="17" selection-start="7760" selection-end="7760" vertical-scroll-proportion="0.22939068">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="pom.xml" pinned="false" current="true" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/core/pom.xml">
+      <file leaf-file-name="XWikiDocument.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="133" column="0" selection-start="4459" selection-end="4459" vertical-scroll-proportion="0.801005">
+            <state line="2484" column="0" selection-start="89037" selection-end="89037" vertical-scroll-proportion="0.25985664">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="XWiki.java" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/XWiki.java">
+      <file leaf-file-name="XWikiCacheStore.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="33" column="9" selection-start="1116" selection-end="1116" vertical-scroll-proportion="-0.5836735">
-              <folding>
-                <element signature="imports" expanded="true" />
-              </folding>
+            <state line="256" column="0" selection-start="10403" selection-end="10403" vertical-scroll-proportion="0.25985664">
+              <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="build.xml" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/build.xml">
+      <file leaf-file-name="XWikiHibernateStore.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/core/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java">
           <provider selected="true" editor-type-id="text-editor">
+            <state line="1366" column="63" selection-start="57257" selection-end="57257" vertical-scroll-proportion="0.47311828">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="XWikiDocumentTest.java" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/XWikiDocumentTest.java">
+          <provider selected="true" editor-type-id="text-editor">
             <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="version.properties" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/main/web/WEB-INF/version.properties">
+      <file leaf-file-name="xwiki.hbm.xml" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/test/resources/xwiki.hbm.xml">
           <provider selected="true" editor-type-id="text-editor">
+            <state line="267" column="38" selection-start="0" selection-end="31166" vertical-scroll-proportion="0.41535777">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="xwiki.hbm.xml" pinned="false" current="true" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/core/src/main/resources/xwiki.hbm.xml">
+          <provider selected="true" editor-type-id="text-editor">
             <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="web-test.xml" pinned="false" current="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/main/web-test.xml">
+      <file leaf-file-name="XWikiTest.class" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/build/xwikibase_test/com/xpn/xwiki/test/XWikiTest.class">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="114" column="20" selection-start="3826" selection-end="3826" vertical-scroll-proportion="0.022110553">
+            <state line="27" column="16" selection-start="1222" selection-end="1222" vertical-scroll-proportion="0.4973822">
               <folding />
             </state>
           </provider>
@@ -736,7 +845,6 @@
     <option name="SORT_ALPHABETICALLY" value="false" />
     <option name="HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED" value="false" />
   </component>
-  <component name="HighlightingSettingsPerFile" />
   <component name="InspectionManager">
     <option name="AUTOSCROLL_TO_SOURCE" value="false" />
     <option name="SPLITTER_PROPORTION" value="0.5" />
@@ -754,6 +862,9 @@
   <component name="JUnitProjectSettings">
     <option name="TEST_RUNNER" value="UI" />
   </component>
+  <component name="JetStyle.JetStylePlugin">
+    <jetstyle-conf />
+  </component>
   <component name="JspContextManager" />
   <component name="LvcsConfiguration">
     <option name="LOCAL_VCS_ENABLED" value="true" />
@@ -845,7 +956,7 @@
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
       </PATH>
@@ -859,15 +970,15 @@
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\src" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\src\test" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src\test" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
       </PATH>
@@ -881,17 +992,21 @@
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\src" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\src\main" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src\test" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src\test\resources" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+        </PATH_ELEMENT>
       </PATH>
       <PATH>
         <PATH_ELEMENT>
@@ -903,11 +1018,11 @@
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\core" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
       </PATH>
@@ -921,21 +1036,43 @@
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\core" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\core\src" />
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src\main" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
+      </PATH>
+      <PATH>
         <PATH_ELEMENT>
-          <option name="myItemId" value="PsiDirectory:C:\dev\xwiki\trunks-devs\xwiki\core\src\main" />
+          <option name="myItemId" value="xwiki.ipr" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+        </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="xwikibase" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+        </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk" />
           <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
         </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+        </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src\main" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+        </PATH_ELEMENT>
+        <PATH_ELEMENT>
+          <option name="myItemId" value="PsiDirectory:C:\dev\java\xwikisvn\xwiki\trunk\src\main\xwiki" />
+          <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+        </PATH_ELEMENT>
       </PATH>
       <PATH>
         <PATH_ELEMENT>
@@ -960,7 +1097,7 @@
       <showLibraryContents />
       <hideEmptyPackages />
       <abbreviatePackageNames />
-      <showStructure ProjectPane="false" J2EEPane="false" PackagesPane="false" Favorites="false" />
+      <showStructure Favorites="false" J2EEPane="false" Scope="false" PackagesPane="false" ProjectPane="false" />
       <autoscrollToSource />
       <autoscrollFromSource />
       <sortByType />
@@ -1033,42 +1170,28 @@
     <option name="referencePos" value="0" />
   </component>
   <component name="RestoreUpdateTree" />
-  <component name="RunManager" selected="Application.Groovy Export">
-    <tempConfiguration default="false" name="QueryGeneratorTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
-      <module name="xwikibase" />
+  <component name="RunManager" selected="JUnit.XWikiDocumentTest">
+    <tempConfiguration default="false" name="XWikiDocumentTest" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
+      <pattern value="com.xpn.xwiki.test.*" />
+      <module name="xwiki" />
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
-      <option name="PACKAGE_NAME" value="com.xpn.xwiki.test.plugin.query" />
-      <option name="MAIN_CLASS_NAME" value="com.xpn.xwiki.test.plugin.query.QueryGeneratorTest" />
-      <option name="METHOD_NAME" value="testRunQueryAsTable" />
-      <option name="TEST_OBJECT" value="method" />
-      <option name="VM_PARAMETERS" value="" />
-      <option name="PARAMETERS" value="" />
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/build/xwikibase_test" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <option name="PACKAGE_NAME" value="com.xpn.xwiki.test" />
+      <option name="MAIN_CLASS_NAME" value="com.xpn.xwiki.test.XWikiDocumentTest" />
+      <option name="METHOD_NAME" />
+      <option name="TEST_OBJECT" value="class" />
+      <option name="VM_PARAMETERS" />
+      <option name="PARAMETERS" />
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
       <option name="ADDITIONAL_CLASS_PATH" />
       <option name="TEST_SEARCH_SCOPE">
         <value defaultName="wholeProject" />
       </option>
-      <RunnerSettings RunnerId="Debug">
-        <option name="DEBUG_PORT" value="2646" />
-        <option name="TRANSPORT" value="0" />
-        <option name="LOCAL" value="true" />
-      </RunnerSettings>
-      <RunnerSettings RunnerId="Profile ">
-        <option name="myStartupWithAllocations" value="false" />
-        <option name="myCPUStartup" value="" />
-        <option name="myUsedMemoryThreshold" value="0" />
-        <option name="myDontLaunchUI" value="false" />
-        <option name="myCaptureMemoryOnExit" value="false" />
-        <option name="myCaptureCPUOnExit" value="false" />
-        <option name="mySnapshotsDir" value="" />
-        <option name="myForceJVMTI" value="false" />
-        <option name="myDisableAlloc" value="false" />
-        <option name="myDisableCounts" value="false" />
-      </RunnerSettings>
       <RunnerSettings RunnerId="Run" />
-      <ConfigurationWrapper RunnerId="Debug" />
       <ConfigurationWrapper RunnerId="Run" />
+      <method>
+        <option name="Make" value="true" />
+      </method>
     </tempConfiguration>
     <configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
       <module name="xwiki" />
@@ -1089,26 +1212,6 @@
         <option name="Make" value="true" />
       </method>
     </configuration>
-    <configuration default="true" type="Remote" factoryName="Remote">
-      <option name="USE_SOCKET_TRANSPORT" value="true" />
-      <option name="SERVER_MODE" value="false" />
-      <option name="SHMEM_ADDRESS" value="javadebug" />
-      <option name="HOST" value="localhost" />
-      <option name="PORT" value="5005" />
-    </configuration>
-    <configuration default="true" type="#com.intellij.j2ee.web.jsr45.JSR45ConfigurationFactory" factoryName="Local">
-      <option name="WORKING_DIRECTORY" />
-      <option name="HOST" value="localhost" />
-      <option name="PORT" value="80" />
-      <option name="LOCAL" value="true" />
-      <option name="OPEN_IN_BROWSER" value="true" />
-      <option name="OPEN_IN_BROWSER_URL" value="/" />
-      <option name="COMMON_VM_ARGUMENTS" value="" />
-      <option name="JSP_PACKAGE" value="" />
-      <option name="VM_OPTS" value="" />
-      <option name="USE_WEBSPHERE51_LINEMAPPING_MODEL" value="false" />
-      <option name="LOCAL_PORT" value="80" />
-    </configuration>
     <configuration default="true" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local">
       <option name="WORKING_DIRECTORY" />
       <option name="HOST" value="localhost" />
@@ -1162,18 +1265,6 @@
         </SHUTDOWN>
       </ConfigurationWrapper>
     </configuration>
-    <configuration default="true" type="Applet" factoryName="Applet">
-      <module name="" />
-      <option name="MAIN_CLASS_NAME" />
-      <option name="HTML_FILE_NAME" />
-      <option name="HTML_USED" value="false" />
-      <option name="WIDTH" value="400" />
-      <option name="HEIGHT" value="300" />
-      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
-      <option name="VM_PARAMETERS" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" />
-    </configuration>
     <configuration default="true" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Remote">
       <option name="WORKING_DIRECTORY" />
       <option name="HOST" value="localhost" />
@@ -1194,6 +1285,31 @@
       <ConfigurationWrapper RunnerId="Debug" />
       <ConfigurationWrapper RunnerId="Run" />
     </configuration>
+    <configuration default="true" type="Applet" factoryName="Applet">
+      <module name="" />
+      <option name="MAIN_CLASS_NAME" />
+      <option name="HTML_FILE_NAME" />
+      <option name="HTML_USED" value="false" />
+      <option name="WIDTH" value="400" />
+      <option name="HEIGHT" value="300" />
+      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+      <option name="VM_PARAMETERS" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+    </configuration>
+    <configuration default="true" type="#com.intellij.j2ee.web.jsr45.JSR45ConfigurationFactory" factoryName="Local">
+      <option name="WORKING_DIRECTORY" />
+      <option name="HOST" value="localhost" />
+      <option name="PORT" value="80" />
+      <option name="LOCAL" value="true" />
+      <option name="OPEN_IN_BROWSER" value="true" />
+      <option name="OPEN_IN_BROWSER_URL" value="/" />
+      <option name="COMMON_VM_ARGUMENTS" value="" />
+      <option name="JSP_PACKAGE" value="" />
+      <option name="VM_OPTS" value="" />
+      <option name="USE_WEBSPHERE51_LINEMAPPING_MODEL" value="false" />
+      <option name="LOCAL_PORT" value="80" />
+    </configuration>
     <configuration default="true" type="WebLogic Instance" factoryName="Local">
       <option name="WORKING_DIRECTORY" />
       <option name="HOST" value="localhost" />
@@ -1210,6 +1326,13 @@
       <predefined_log_file id="WEBLOGIC_DOMAIN_LOG_FILE" enabled="true" />
       <predefined_log_file id="WEBLOGIC_SERVER_LOG_FILE" enabled="true" />
     </configuration>
+    <configuration default="true" type="Remote" factoryName="Remote">
+      <option name="USE_SOCKET_TRANSPORT" value="true" />
+      <option name="SERVER_MODE" value="false" />
+      <option name="SHMEM_ADDRESS" value="javadebug" />
+      <option name="HOST" value="localhost" />
+      <option name="PORT" value="5005" />
+    </configuration>
     <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
       <option name="MAIN_CLASS_NAME" />
       <option name="VM_PARAMETERS" />
@@ -1220,6 +1343,33 @@
       <option name="ENABLE_SWING_INSPECTOR" value="false" />
       <module name="" />
     </configuration>
+    <configuration default="false" name="Groovy Export" type="Application" factoryName="Application" enabled="false" merge="false">
+      <option name="MAIN_CLASS_NAME" value="groovy.lang.GroovyShell" />
+      <option name="VM_PARAMETERS" value="" />
+      <option name="PROGRAM_PARAMETERS" value="c:/dev/java/mforma/killerbee/tools/export.groovy" />
+      <option name="WORKING_DIRECTORY" value="file://c:/dev/java/mforma/killerbee/tools/" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ENABLE_SWING_INSPECTOR" value="false" />
+      <module name="xwikibase" />
+      <RunnerSettings RunnerId="Profile ">
+        <option name="myStartupWithAllocations" value="false" />
+        <option name="myCPUStartup" value="" />
+        <option name="myUsedMemoryThreshold" value="0" />
+        <option name="myDontLaunchUI" value="false" />
+        <option name="myCaptureMemoryOnExit" value="false" />
+        <option name="myCaptureCPUOnExit" value="false" />
+        <option name="mySnapshotsDir" value="" />
+        <option name="myForceJVMTI" value="false&qu