Update of /var/cvs/applications/dove/src/org/mmbase/applications/dove
In directory james.mmbase.org:/tmp/cvs-serv887
Modified Files:
Tag: MMBase-1_8
AbstractDove.java Dove.java
Log Message:
MMB-1616
See also:
http://cvs.mmbase.org/viewcvs/applications/dove/src/org/mmbase/applications/dove
See also: http://www.mmbase.org/jira/browse/MMB-1616
Index: AbstractDove.java
===================================================================
RCS file:
/var/cvs/applications/dove/src/org/mmbase/applications/dove/AbstractDove.java,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -u -b -r1.20 -r1.20.2.1
--- AbstractDove.java 24 Apr 2006 12:06:07 -0000 1.20
+++ AbstractDove.java 3 Mar 2008 14:31:59 -0000 1.20.2.1
@@ -47,7 +47,7 @@
*
* @author Pierre van Rooden
* @since MMBase-1.5
- * @version $Id: AbstractDove.java,v 1.20 2006/04/24 12:06:07 michiel Exp $
+ * @version $Id: AbstractDove.java,v 1.20.2.1 2008/03/03 14:31:59 michiel Exp $
*/
public abstract class AbstractDove {
@@ -100,6 +100,7 @@
public static final String ELM_NUMBER = "number";
public static final String ELM_OLDNUMBER = "oldnumber";
public static final String ELM_TYPE = "type";
+ public static final String ELM_SEARCHTYPE = "type";
public static final String ELM_STATUS = "status";
public static final String ELM_NAME = "name";
public static final String ELM_ROLE = "role";
@@ -169,10 +170,10 @@
* @param out the element to which to add the new Element.
* @return the newly created element
*/
- protected Element addContentElement(String tagname,String content, Element
out) {
- Element el=doc.createElement(tagname);
- if (content==null) content="";
- Text tel=doc.createTextNode(content);
+ protected Element addContentElement(String tagname, String content,
Element out) {
+ Element el = doc.createElement(tagname);
+ if (content == null) content="";
+ Text tel = doc.createTextNode(content);
el.appendChild(tel);
out.appendChild(el);
return el;
Index: Dove.java
===================================================================
RCS file:
/var/cvs/applications/dove/src/org/mmbase/applications/dove/Dove.java,v
retrieving revision 1.78.2.5
retrieving revision 1.78.2.6
diff -u -b -r1.78.2.5 -r1.78.2.6
--- Dove.java 17 Jan 2008 16:49:15 -0000 1.78.2.5
+++ Dove.java 3 Mar 2008 14:31:59 -0000 1.78.2.6
@@ -54,7 +54,7 @@
*
* @author Pierre van Rooden
* @since MMBase-1.5
- * @version $Id: Dove.java,v 1.78.2.5 2008/01/17 16:49:15 michiel Exp $
+ * @version $Id: Dove.java,v 1.78.2.6 2008/03/03 14:31:59 michiel Exp $
*/
public class Dove extends AbstractDove {
@@ -283,16 +283,16 @@
int searchDir=0;
String searchDirs = relation.getAttribute(ELM_SEARCHDIR).toLowerCase();
if("destination".equals(searchDirs)) {
- searchDir=1;
+ searchDir = 1;
} else if("source".equals(searchDirs)) {
- searchDir=2;
+ searchDir = 2;
}
// determines whether to load the object (and possible restrictions)
- Element objectDef = getFirstElement(relation,OBJECT);
- for (RelationIterator i =
nd.getRelations(role,destinationType).relationIterator(); i.hasNext(); ) {
- Relation nrel=i.nextRelation();
- if (searchDir==1) {
+ Element objectDef = getFirstElement(relation, OBJECT);
+ for (RelationIterator i = nd.getRelations(role,
destinationType).relationIterator(); i.hasNext(); ) {
+ Relation nrel = i.nextRelation();
+ if (searchDir ==1) {
if (thisNumber!=nrel.getIntValue("snumber")) continue;
}
if (searchDir==2) {
@@ -315,12 +315,13 @@
}
data.setAttribute(ELM_NUMBER, ""+nrel.getNumber());
out.appendChild(data);
- getDataNode(relation,data,nrel);
+ getDataNode(relation, data, nrel);
if (objectDef!=null) {
- Element nodeData=doc.createElement(OBJECT);
+ Element nodeData = doc.createElement(OBJECT);
nodeData.setAttribute(ELM_NUMBER, ""+otherNumber);
data.appendChild(nodeData);
getDataNode(objectDef,
nodeData,nd.getCloud().getNode(otherNumber));
+ nodeData.setAttribute(ELM_SEARCHTYPE, destinationType);
}
}
}
@@ -345,7 +346,7 @@
NodeManager nm=nd.getNodeManager();
out.setAttribute(ELM_TYPE,nm.getName());
- Element relation=getFirstElement(in,RELATION);
+ Element relation=getFirstElement(in, RELATION);
if (relation==null) {
int thisNumber=nd.getNumber();
for (RelationIterator i=nd.getRelations().relationIterator();
i.hasNext(); ) {
@@ -361,7 +362,7 @@
data.setAttribute(ELM_DESTINATION,
""+nrel.getIntValue("snumber"));
}
out.appendChild(data);
- getDataNode(null,data,nrel);
+ getDataNode(null, data, nrel);
}
} else {
while (relation!=null) { // select all child tags, should be
'relation'
@@ -1092,7 +1093,7 @@
fillFields(alias,newnode,relationelement,values);
String context = (String) values.get("_context");
- if (context!=null) {
+ if (context != null) {
newnode.setContext(context);
}
newnode.commit();
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs