Update of /var/cvs/applications/richtext/src/org/mmbase/richtext/processors/xml
In directory james.mmbase.org:/tmp/cvs-serv17748

Modified Files:
        MmxfGetString.java 
Log Message:
it's pretty much essential that the freaking setIdAttribute works, I finally 
came up with an idea to get it working, and still be compiatible with mmbase 
1.8...


See also: 
http://cvs.mmbase.org/viewcvs/applications/richtext/src/org/mmbase/richtext/processors/xml


Index: MmxfGetString.java
===================================================================
RCS file: 
/var/cvs/applications/richtext/src/org/mmbase/richtext/processors/xml/MmxfGetString.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- MmxfGetString.java  16 Feb 2007 20:44:12 -0000      1.6
+++ MmxfGetString.java  8 Feb 2008 13:55:57 -0000       1.7
@@ -30,7 +30,7 @@
  * This class implements the `get' for `mmxf' fields.
  *
  * @author Michiel Meeuwissen
- * @version $Id: MmxfGetString.java,v 1.6 2007/02/16 20:44:12 michiel Exp $
+ * @version $Id: MmxfGetString.java,v 1.7 2008/02/08 13:55:57 michiel Exp $
  * @since MMBase-1.8
  */
 
@@ -52,13 +52,23 @@
             throw new RuntimeException(pce.getMessage(), pce);
         }
     }
+
+    static protected Generator getGenerator(final Cloud cloud) {
+        return new Generator(getDocumentBuilder(), cloud) {
+            @Override
+            protected void setIdAttribute(Element object, String name) {
+                object.setIdAttribute(name, true);
+            }
+
+        };
+    }
     /**
      * Returns a 'objects' Document containing the node with the mmxf field 
plus all idrelated objects
      */
     public static Document getDocument(final Node node, final Field field)  {
 
         log.debug("Getting document for node " + node.getNumber());
-        Generator generator = new Generator(getDocumentBuilder(), 
node.getCloud());
+        Generator generator = getGenerator(node.getCloud());
         generator.setNamespaceAware(true);
         generator.add(node, field);
         org.mmbase.bridge.NodeList relatedNodes = 
node.getRelatedNodes("object", "idrel", "destination");
@@ -110,7 +120,7 @@
                 return res.toString();
             }
             case Modes.FLAT: {
-                Generator generator = new Generator(getDocumentBuilder(), 
node.getCloud());
+                Generator generator = getGenerator(node.getCloud());
                 generator.setNamespaceAware(true);
                 generator.add(node, field);
                 Document xml = generator.getDocument();
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to