Author: ludovic
Date: 2007-09-06 15:20:17 +0200 (Thu, 06 Sep 2007)
New Revision: 4745
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/BaseCollection.java
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_en.properties
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_fr.properties
Log:
XWIKI-1710 Fixed exception in old diff template. Added class changes diff.
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/BaseCollection.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/BaseCollection.java
2007-09-06 13:15:04 UTC (rev 4744)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/BaseCollection.java
2007-09-06 13:20:17 UTC (rev 4745)
@@ -438,12 +438,14 @@
BaseProperty prop2 = (BaseProperty)
collection.getFields().get(name);
if (prop2==null) {
+ // this is the case property exist in object 1 and not in
object 2
if ((prop!=null)&&(!prop.toText().equals(""))) {
String dprop = (prop.getValue() instanceof String) ?
prop.toText() :
((PropertyClass)getxWikiClass(context).getField(name)).displayView(name,this,context);
difflist.add(new ObjectDiff(getClassName(), getNumber(),
"added",
name, dprop , ""));
}
} else if (!prop2.toText().equals(((prop==null) ? "" :
prop.toText()))) {
+ // this is the case property exists in both and is different
BaseClass bclass = getxWikiClass(context);
PropertyClass pclass = (PropertyClass) ((bclass==null) ? null
: bclass.getField(name));
if (pclass==null) {
@@ -465,6 +467,7 @@
BaseProperty prop2 =
(BaseProperty)collection.getFields().get(name);
if (prop==null) {
+ // this is the case property exists in object2 and not in
object1
if ((prop2!=null)&&(!prop2.toText().equals(""))) {
BaseClass bclass = getxWikiClass(context);
PropertyClass pclass = (PropertyClass) ((bclass==null) ?
null : bclass.getField(name));
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java
2007-09-06 13:15:04 UTC (rev 4744)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/BaseClass.java
2007-09-06 13:20:17 UTC (rev 4745)
@@ -24,7 +24,7 @@
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -42,12 +42,8 @@
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.XWikiException;
-import com.xpn.xwiki.objects.BaseCollection;
-import com.xpn.xwiki.objects.BaseObject;
-import com.xpn.xwiki.objects.BaseProperty;
-import com.xpn.xwiki.objects.ElementComparator;
-import com.xpn.xwiki.objects.PropertyInterface;
-import com.xpn.xwiki.plugin.query.OrderClause;
+import com.xpn.xwiki.objects.*;
+import com.xpn.xwiki.plugin.query.OrderClause;
import com.xpn.xwiki.plugin.query.XWikiCriteria;
import com.xpn.xwiki.plugin.query.XWikiQuery;
import com.xpn.xwiki.validation.XWikiValidationInterface;
@@ -221,9 +217,9 @@
el.addText((getValidationScript()==null) ? "" : getValidationScript());
cel.add(el);
- // Iterate over values sorted by field name so that the values are
- // exported to XML in a consistent order.
- Iterator it = getSortedIterator();
+ // Iterate over values sorted by field name so that the values are
+ // exported to XML in a consistent order.
+ Iterator it = getSortedIterator();
while (it.hasNext()) {
PropertyClass bprop = (PropertyClass)it.next();
cel.add(bprop.toXML());
@@ -769,4 +765,36 @@
}
}
+ public List getDiff(Object coll, XWikiContext context) {
+ ArrayList difflist = new ArrayList();
+ BaseClass bclass = (BaseClass) coll;
+ Iterator itfields = getFieldList().iterator();
+ while (itfields.hasNext()) {
+ PropertyClass prop = (PropertyClass) itfields.next();
+ String name = prop.getName();
+ PropertyClass prop2 = (PropertyClass) bclass.get(name);
+
+ if (prop2==null) {
+ difflist.add(new ObjectDiff(getClassName(), getNumber(),
"added",
+ name, "" , ""));
+ } else if (!prop2.equals(prop)) {
+ difflist.add(new ObjectDiff(getClassName(), getNumber(),
"changed",
+ name, "", ""));
+ }
+ }
+
+ itfields = bclass.getFieldList().iterator();
+ while (itfields.hasNext()) {
+ PropertyClass prop2 = (PropertyClass) itfields.next();
+ String name = prop2.getName();
+ PropertyClass prop = (PropertyClass) get(name);
+
+ if (prop==null) {
+ difflist.add(new ObjectDiff(getClassName(), getNumber(),
"removed",
+ name, "" , ""));
+ }
+ }
+
+ return difflist;
+ }
}
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties
2007-09-06 13:15:04 UTC (rev 4744)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties
2007-09-06 13:20:17 UTC (rev 4745)
@@ -857,3 +857,5 @@
changes.objectchanges=Object Changes
changes.ofclass=of class
changes.noobjectchanges=No Object Changes
+changes.classeschanges=Class Changes
+changes.noclasseschanges=No Class Changes
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_en.properties
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_en.properties
2007-09-06 13:15:04 UTC (rev 4744)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_en.properties
2007-09-06 13:20:17 UTC (rev 4745)
@@ -561,7 +561,7 @@
export_version=Version
export_addhistory=With history
export_backuppack=Backup Pack
-export_authorpreserved=Author preserved
+export_authorpreserved=Author preserved
import=Import
adminimport=Import
@@ -570,7 +570,7 @@
availablefilestoimport=Available files to import
availabledocumentstoimport=Available documents to import
uploadnewarchivetoimport=Upload a new archive to import
-selectdocumentstoimport=Click on the archive file you wish to import to get
the list of available documents
+selectdocumentstoimport=Click on the archive file you wish to import to get
the list of available documents
nodocstoimport=No documents found in the selected archive
importing=Importing
import_install_-1=Error while preparing importing
@@ -584,6 +584,18 @@
import_listofskippedfiles=List of skipped documents
import_listoferrorfiles=List of documents with errors
+registerwelcome=Welcome to the registration form. This will allow you to edit
pages, once the admin gives you appropriate rights
+email=e-Mail address
+passwordrepeat=Password (repeat)
+loginid=Login ID
+iregister=Register
+passwordmismatch=Passwords are different or password is empty
+useralreadyexists=User already exists
+invalidusername=Invalid username provided. Please use only letters from the
latin alphabet, numbers, and the underscore character.
+registerfailed=Registration has failed
+registerfailedcode=code
+registersuccessful=Registration successful
+
leftPanels=Left Panels
rightPanels=Right Panels
showLeftPanels=Show Left Panels
@@ -694,6 +706,10 @@
core.comment.deleteAttachmentComment=Deletion of attachment {0}
core.comment.deleteImageComment=Deletion of image {0}
+core.minoredit=Is minor edit
+core.minoredit.show=Show minor edits
+core.minoredit.hide=Hide minor edits
+
# top menu
core.menu.documentation=Documentation
core.menu.create=Create
@@ -731,6 +747,23 @@
core.delete.confirm=The deletion of a document is not reversible. Are you sure
you wish to continue?
core.delete.confirmWithInlinks=In addition, the deletion of a document is not
reversible. Are you sure you wish to continue?
+core.recyclebin.showlistmsg=There are following deleted documents in recycle
bin:
+core.recyclebin.deleter=Deleter
+core.recyclebin.actions=Actions
+core.recyclebin.deleteDate=Delete date
+core.recyclebin.delete=Delete
+core.recyclebin.restore=Restore
+core.recyclebin.confirm=Are you sure you wish to move document to recycle bin?
+core.recyclebin.confirmWithInlinks=Are you sure you wish to move document to
recycle bin?
+core.recyclebin.completelyDeleteConfirm=This action is not reversible. Are you
sure you wish to continue?
+
+core.versions.delete.single=Delete
+core.versions.delete.many=Delete versions
+core.versions.delete.confirm.single=This action is not reversible. Do you want
to delete version {0}?
+core.versions.delete.confirm.many=This action is not reversible. Are you sure
you wish to delete versions from {0} to {1} inclusive?
+core.versions.delete.needselect=You need select "from" and "to" versions to
delete
+core.versions.delete.goback=go back
+
core.tagedit.title=Tags:
panels.documentInformation.title=Document information
@@ -761,6 +794,24 @@
#tooltip for fullscreen editing
fullScreenTooltip=Edit in Full Screen
+# user registration
+core.register=Register
+core.register.title=Registration
+core.register.welcome=Welcome to the registration form. This will allow you to
edit pages, once the admin gives you appropriate rights.
+core.register.passwordMismatch=Passwords are different or password is empty.
+core.register.userAlreadyExists=User already exists.
+core.register.invalidUsername=Invalid username provided. Please use only
letters from the latin alphabet, numbers, and the underscore character.
+core.register.registerFailed=Registration has failed due to unknown reasons.
(Error code: {0})
+core.register.successful={0} ({1}): Registration successful.
+core.register.firstName=First name:
+core.register.lastName=Last name:
+core.register.username=Login ID:
+core.register.password=Password:
+core.register.passwordRepeat=Password (repeat):
+core.register.email=e-Mail address:
+core.register.submit=Register
+fullScreenTooltip=Edit in Full Screen
+
changes.changesofpage=Changes
changes.in=in
changes.space=space
@@ -805,4 +856,6 @@
changes.tag.tags=Tags
changes.objectchanges=Object Changes
changes.ofclass=of class
-changes.noobjectchanges=No Object Changes
\ No newline at end of file
+changes.noobjectchanges=No Object Changes
+changes.classeschanges=Class Changes
+changes.noclasseschanges=No Class Changes
Modified:
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_fr.properties
===================================================================
---
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_fr.properties
2007-09-06 13:15:04 UTC (rev 4744)
+++
xwiki-platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources_fr.properties
2007-09-06 13:20:17 UTC (rev 4745)
@@ -750,6 +750,38 @@
#tooltip for fullscreen editing
fullScreenTooltip=Editer en plein �cran
+# user registration
+core.register=Inscription
+core.register.title=Inscription
+core.register.welcome=Bienvenue sur le formulaire d'inscription. Ceci vous
permettra d'\u00e9diter les pages, si l'administrateur du wiki vous en donne
les droits
+core.register.passwordMismatch=Les mots de passe ne correspondent pas ou sont
vides
+core.register.userAlreadyExists=Cet utilisateur existe d\u00e9j\u00e0
+core.register.invalidUsername=Nom d'utilisateur invalide. N'utilisez que les
lettres de l'alphabet latin, les chiffres et le blanc soulign\u00e9.
+core.register.registerFailed=L'inscription \u00e0 \u00e9chou\u00e9e
+core.register.successful={0} ({1}): L'inscription \u00e0 r\u00e9ussie
+core.register.firstName=Pr\u00e9nom:
+core.register.lastName=Nom:
+core.register.username=Login:
+core.register.password=Mot de passe:
+core.register.passwordRepeat=Mot de passe (r\u00e9p\u00e9tition):
+core.register.email=e-Mail:
+core.register.submit=Inscription
+core.register=Inscription
+core.register.title=Inscription
+core.register.welcome=Bienvenue sur le formulaire d'inscription. Ceci vous
permettra d'\u00e9diter les pages, si l'administrateur du wiki vous en donne
les droits
+core.register.passwordMismatch=Les mots de passe ne correspondent pas ou sont
vides
+core.register.userAlreadyExists=Cet utilisateur existe d\u00e9j\u00e0
+core.register.invalidUsername=Nom d'utilisateur invalide. N'utilisez que les
lettres de l'alphabet latin, les chiffres et le blanc soulign\u00e9.
+core.register.registerFailed=L'inscription \u00e0 \u00e9chou\u00e9e
+core.register.successful={0} ({1}): L'inscription \u00e0 r\u00e9ussie
+core.register.firstName=Pr\u00e9nom:
+core.register.lastName=Nom:
+core.register.username=Login:
+core.register.password=Mot de passe:
+core.register.passwordRepeat=Mot de passe (r\u00e9p\u00e9tition):
+core.register.email=e-Mail:
+core.register.submit=Inscription
+
changes.changesofpage=Changements
changes.in=dans
changes.space=l'espace
@@ -795,20 +827,5 @@
changes.objectchanges=Ajout/Modifications d'objets
changes.ofclass=de la classe
changes.noobjectchanges=Il n'y a pas de changements
-
-# user registration
-core.register=Inscription
-core.register.title=Inscription
-core.register.welcome=Bienvenue sur le formulaire d'inscription. Ceci vous
permettra d'\u00e9diter les pages, si l'administrateur du wiki vous en donne
les droits
-core.register.passwordMismatch=Les mots de passe ne correspondent pas ou sont
vides
-core.register.userAlreadyExists=Cet utilisateur existe d\u00e9j\u00e0
-core.register.invalidUsername=Nom d'utilisateur invalide. N'utilisez que les
lettres de l'alphabet latin, les chiffres et le blanc soulign\u00e9.
-core.register.registerFailed=L'inscription \u00e0 \u00e9chou\u00e9e
-core.register.successful={0} ({1}): L'inscription \u00e0 r\u00e9ussie
-core.register.firstName=Pr\u00e9nom:
-core.register.lastName=Nom:
-core.register.username=Login:
-core.register.password=Mot de passe:
-core.register.passwordRepeat=Mot de passe (r\u00e9p\u00e9tition):
-core.register.email=e-Mail:
-core.register.submit=Inscription
+changes.classeschanges=Changements de d�finition de classe
+changes.noclasseschanges=Il n'y a pas de changements
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications