org.mmbase.richtext
Class Mmxf

java.lang.Object
  extended by org.mmbase.richtext.Mmxf

public class Mmxf
extends Object

Utilities related to the 'mmxf' rich field format of MMBase and bridge.

Since:
MMBase-1.8
Version:
$Id: Mmxf.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Michiel Meeuwissen
See Also:
XmlField

Field Summary
static String DOCUMENTTYPE_PUBLIC
           
static String DOCUMENTTYPE_SYSTEM
           
static String NAMESPACE
           
 
Constructor Summary
Mmxf()
           
 
Method Summary
static Document createMmxfDocument()
          Creates an (empty) Mmxf Document
static Node createTree(Node node, Node root, RelationManager relationManager, int depth, String titleField, String xmlField, Writer feedBack)
          Creates a a tree of Nodes from an mmxf DOM-Node.
static Node createTree(Node node, RelationManager relationManager, int depth, Writer buf)
          Defaulting version of createTree(org.w3c.dom.Node, org.mmbase.bridge.Node, RelationManager, int, String, String, Writer).
protected static void debug(Writer buf, String message)
           
protected static void exception(Writer buf, String message)
           
static void main(String[] argv)
          main for testing purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
See Also:
Constant Field Values

DOCUMENTTYPE_PUBLIC

public static final String DOCUMENTTYPE_PUBLIC
See Also:
Constant Field Values

DOCUMENTTYPE_SYSTEM

public static final String DOCUMENTTYPE_SYSTEM
See Also:
Constant Field Values
Constructor Detail

Mmxf

public Mmxf()
Method Detail

createTree

public static Node createTree(Node node,
                              RelationManager relationManager,
                              int depth,
                              Writer buf)
Defaulting version of createTree(org.w3c.dom.Node, org.mmbase.bridge.Node, RelationManager, int, String, String, Writer).


exception

protected static void exception(Writer buf,
                                String message)

debug

protected static void debug(Writer buf,
                            String message)

createTree

public static Node createTree(Node node,
                              Node root,
                              RelationManager relationManager,
                              int depth,
                              String titleField,
                              String xmlField,
                              Writer feedBack)
Creates a a tree of Nodes from an mmxf DOM-Node. The (mmxf) document can of course be stored in one MMXF field, but if it is large, you want to split it up in a tree of nodes. This can be necessary in an import, where you would e.g. receive a complete book (or chapter) in one XML document. You could e.g. (XSL) transform it to one huge MMXF and then feed it into this function. See also XmlField for creating MMXF from ASCII. If your MMXF is a Document, you must feed Document.getDocumentElement()

Parameters:
node - Source DOM-Node (it's node-name must be 'mmxf' or 'section').
root - Root node (to be used in index relations) Can be null in which case it will be set equal to the first node created.
relationManager - Describes the object model in which it must be dispatched. Source and Destination must be of the same type, the relation must have a field 'pos'.
depth - How far to dispatch. If -1 then it will be split up until no sections are remaining.
titleField - The h-tag of the sections are written to this field.
xmlField - A new mmxf-document is created for the test and written to this field.
feedBack - A string buffer for feedback (can be e.g. used for logging or presenting on import-jsp).

createMmxfDocument

public static Document createMmxfDocument()
Creates an (empty) Mmxf Document


main

public static void main(String[] argv)
main for testing purposes.



MMBase 2.0-SNAPSHOT - null