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

Modified Files:
        WizardDatabaseConnector.java 
Log Message:
MMB-1755 Add always the searchtype attribute when objects are created/loaded


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


Index: WizardDatabaseConnector.java
===================================================================
RCS file: 
/var/cvs/applications/editwizard/src/org/mmbase/applications/editwizard/WizardDatabaseConnector.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- WizardDatabaseConnector.java        11 Jul 2008 14:24:59 -0000      1.53
+++ WizardDatabaseConnector.java        18 Dec 2008 21:26:38 -0000      1.54
@@ -31,7 +31,7 @@
  * @author Michiel Meeuwissen
  * @author Pierre van Rooden
  * @since MMBase-1.6
- * @version $Id: WizardDatabaseConnector.java,v 1.53 2008/07/11 14:24:59 
michiel Exp $
+ * @version $Id: WizardDatabaseConnector.java,v 1.54 2008/12/18 21:26:38 
nklasens Exp $
  *
  */
 public class WizardDatabaseConnector implements java.io.Serializable {
@@ -567,11 +567,22 @@
                     inside_object=data.createElement("object");
                     ((Element)inside_object).setAttribute("number","");
                     
((Element)inside_object).setAttribute("type",Utils.getAttribute(relation, 
"destinationtype", ""));
+                    
((Element)inside_object).setAttribute("searchtype",Utils.getAttribute(relation, 
"destinationtype", ""));
                     ((Element)inside_object).setAttribute("disposable","true");
                 } else {
                     inside_object = createObject(data,relationNode, 
inside_objectdef, params, loadedData);
                     dnumber = Utils.getAttribute(inside_object, "number");
                     
((Element)relationNode).setAttribute("destination",dnumber);
+                    if (inside_object instanceof Element) {
+                       String destinationType = Utils.getAttribute(relation, 
"destinationtype", "");
+                       
((Element)inside_object).setAttribute(Dove.ELM_SEARCHTYPE, destinationType);
+                    }
+                }
+            }
+            else {
+               if (inside_object instanceof Element) {
+                  String destinationType = Utils.getAttribute(relation, 
"destinationtype", "");
+                  ((Element)inside_object).setAttribute(Dove.ELM_SEARCHTYPE, 
destinationType);
                 }
             }
             relationNode.appendChild(inside_object);
@@ -817,8 +828,7 @@
             String nodename = node.getNodeName();
 
             String did = Utils.getAttribute(node, "did", "");
-            Node orignode = Utils.selectSingleNode(reqorig, 
".//*...@did='"+did+"' and not(@already-exists)]");
-
+            Node orignode = Utils.selectSingleNode(reqorig, 
".//*...@did='"+did+"']");
             if (orignode!=null) {
                 // we found the original relation. Check to see if destination 
has changed.
                 if (nodename.equals("relation")) {
@@ -894,6 +904,9 @@
                             
fields.item(j).getParentNode().removeChild(fields.item(j));
                             }
                     }
+                } else {
+                   // remove it from the list.
+                   node.getParentNode().removeChild(node);
                }
             }
         }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to