Update of /var/cvs/applications/dove/src/org/mmbase/applications/dove
In directory james.mmbase.org:/tmp/cvs-serv956
Modified Files:
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.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- AbstractDove.java 21 Jun 2007 15:50:25 -0000 1.22
+++ AbstractDove.java 3 Mar 2008 14:34:29 -0000 1.23
@@ -47,7 +47,7 @@
*
* @author Pierre van Rooden
* @since MMBase-1.5
- * @version $Id: AbstractDove.java,v 1.22 2007/06/21 15:50:25 nklasens Exp $
+ * @version $Id: AbstractDove.java,v 1.23 2008/03/03 14:34:29 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 = "searchtype";
public static final String ELM_STATUS = "status";
public static final String ELM_NAME = "name";
public static final String ELM_ROLE = "role";
Index: Dove.java
===================================================================
RCS file:
/var/cvs/applications/dove/src/org/mmbase/applications/dove/Dove.java,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- Dove.java 3 Feb 2008 17:33:57 -0000 1.90
+++ Dove.java 3 Mar 2008 14:34:29 -0000 1.91
@@ -55,7 +55,7 @@
*
* @author Pierre van Rooden
* @since MMBase-1.5
- * @version $Id: Dove.java,v 1.90 2008/02/03 17:33:57 nklasens Exp $
+ * @version $Id: Dove.java,v 1.91 2008/03/03 14:34:29 michiel Exp $
*/
public class Dove extends AbstractDove {
@@ -267,37 +267,37 @@
* @param nd the MMBase node that shoudl eb sued to query the relations
*/
protected void addRelationNodes(Element relation, Element out,
org.mmbase.bridge.Node nd) {
- int thisNumber=nd.getNumber();
- String role=relation.getAttribute(ELM_ROLE);
- if ("".equals(role)) role=null;
+ int thisNumber = nd.getNumber();
+ String role = relation.getAttribute(ELM_ROLE);
+ if ("".equals(role)) role = null;
String destinationType = relation.getAttribute(ELM_DESTINATIONTYPE);
if (("".equals(destinationType)) || (destinationType==null)) {
destinationType = relation.getAttribute(ELM_DESTINATION);
}
- if ("".equals(destinationType)) destinationType=null;
- int searchDir=0;
+ if ("".equals(destinationType)) destinationType = null;
+ 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) {
- if (thisNumber!=nrel.getIntValue("snumber")) continue;
+ if (searchDir == 1) {
+ if (thisNumber != nrel.getIntValue("snumber")) continue;
}
- if (searchDir==2) {
- if (thisNumber!=nrel.getIntValue("dnumber")) continue;
+ if (searchDir == 2) {
+ if (thisNumber != nrel.getIntValue("dnumber")) continue;
}
Element data=doc.createElement(RELATION);
if (role!=null) {
data.setAttribute(ELM_ROLE, role);
} else {
-
data.setAttribute(ELM_ROLE,nrel.getRelationManager().getForwardRole());
+ data.setAttribute(ELM_ROLE,
nrel.getRelationManager().getForwardRole());
}
data.setAttribute(ELM_SOURCE, "" +
nrel.getIntValue("snumber"));
data.setAttribute(ELM_DESTINATION, "" +
nrel.getIntValue("dnumber"));
@@ -310,12 +310,13 @@
}
data.setAttribute(ELM_NUMBER, ""+nrel.getNumber());
out.appendChild(data);
- getDataNode(relation,data,nrel);
- if (objectDef!=null) {
- Element nodeData=doc.createElement(OBJECT);
- nodeData.setAttribute(ELM_NUMBER, ""+otherNumber);
+ getDataNode(relation, data, nrel);
+ if (objectDef != null) {
+ Element nodeData = doc.createElement(OBJECT);
+ nodeData.setAttribute(ELM_NUMBER, "" + otherNumber);
data.appendChild(nodeData);
- getDataNode(objectDef,
nodeData,nd.getCloud().getNode(otherNumber));
+ getDataNode(objectDef, nodeData,
nd.getCloud().getNode(otherNumber));
+ nodeData.setAttribute(ELM_SEARCHTYPE, destinationType);
}
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs