Update of 
/var/cvs/applications/editwizard/src/org/mmbase/applications/editwizard
In directory 
james.mmbase.org:/tmp/cvs-serv30157/applications/editwizard/src/org/mmbase/applications/editwizard

Modified Files:
        WizardDatabaseConnector.java Wizard.java 
Log Message:
MMB-1594 Data loaded by included lists (add list item) are not saved when 
changed

Removed already-exists attribute


See also: 
http://cvs.mmbase.org/viewcvs/applications/editwizard/src/org/mmbase/applications/editwizard
See also: http://www.mmbase.org/jira/browse/MMB-1594


Index: WizardDatabaseConnector.java
===================================================================
RCS file: 
/var/cvs/applications/editwizard/src/org/mmbase/applications/editwizard/WizardDatabaseConnector.java,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- WizardDatabaseConnector.java        30 Dec 2008 12:07:07 -0000      1.59
+++ WizardDatabaseConnector.java        30 Dec 2008 12:48:03 -0000      1.60
@@ -31,7 +31,7 @@
  * @author Michiel Meeuwissen
  * @author Pierre van Rooden
  * @since MMBase-1.6
- * @version $Id: WizardDatabaseConnector.java,v 1.59 2008/12/30 12:07:07 
nklasens Exp $
+ * @version $Id: WizardDatabaseConnector.java,v 1.60 2008/12/30 12:48:03 
nklasens Exp $
  *
  */
 public class WizardDatabaseConnector implements java.io.Serializable {
@@ -535,7 +535,6 @@
                 try {
                     inside_object = 
getDataNode(targetParentNode.getOwnerDocument(), dnumber, null);
                     // but annotate that this one is loaded from mmbase. Not a 
new one
-                    Utils.setAttribute(inside_object, "already-exists", 
"true");
                     
loadedData.getDocumentElement().appendChild(loadedData.importNode(inside_object.cloneNode(true),
 true));
 
                     // grab the type
@@ -890,7 +889,10 @@
                 // this is a new relation or object. Remember that
                 // but, check first if the may-be-new object has a  
"already-exists" attribute. If so,
                 // we don't have a new object, no no, this is a later-loaded 
object which is not added to the
-                // original datanode (should be better in later versions, eg. 
by using a repository).
+                // original datanode. 
+                // This "already-exists" check is here to support custom 
extensions which might still use
+                // this attribute. Earlier versions of this class used this 
attribute, but it is replaced with
+                // the loadedData Document.
                 String already_exists = Utils.getAttribute(node, 
"already-exists", "false");
                 if (!already_exists.equals("true")) {
 


Index: Wizard.java
===================================================================
RCS file: 
/var/cvs/applications/editwizard/src/org/mmbase/applications/editwizard/Wizard.java,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -b -r1.175 -r1.176
--- Wizard.java 30 Dec 2008 12:07:07 -0000      1.175
+++ Wizard.java 30 Dec 2008 12:48:03 -0000      1.176
@@ -46,7 +46,7 @@
  * @author Pierre van Rooden
  * @author Hillebrand Gelderblom
  * @since MMBase-1.6
- * @version $Id: Wizard.java,v 1.175 2008/12/30 12:07:07 nklasens Exp $
+ * @version $Id: Wizard.java,v 1.176 2008/12/30 12:48:03 nklasens Exp $
  *
  */
 public class Wizard implements org.mmbase.util.SizeMeasurable, 
java.io.Serializable {
@@ -2520,22 +2520,7 @@
                     Iterator<Node> i = newSubRelations.iterator();
                     while (i.hasNext()) {
                         Node newSubRelation = (Node) i.next();
-                        Utils.setAttribute(newSubRelation, "already-exists", 
"true");
-                        NodeList newSubSubRelations = 
Utils.selectNodeList(newSubRelation, ".//relation");
-                        for (int k = 0; k < newSubSubRelations.getLength(); 
k++) {
-                            Node newSubSubRelation = 
newSubSubRelations.item(k);
-                            Utils.setAttribute(newSubSubRelation, 
"already-exists", "true");
-                        }
-                        NodeList newSubObjects = 
Utils.selectNodeList(newSubRelation, ".//object");
-                        for (int j = 0; j < newSubObjects.getLength(); j++) {
-                            Node newSubObject = newSubObjects.item(j);
-                            Utils.setAttribute(newSubObject, "already-exists", 
"true");
-                        }
-
                         
loadedData.getDocumentElement().appendChild(loadedData.importNode(newSubRelation.cloneNode(true),
 true));
-
-
-
                     }
 
                 } else {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to