org.mycore.datamodel.classifications2.utils
Class MCRCategoryTransformer

java.lang.Object
  extended by org.mycore.datamodel.classifications2.utils.MCRCategoryTransformer

public class MCRCategoryTransformer
extends Object

Version:
$Revision: 15374 $ $Date: 2008-02-06 17:27:24 +0000 (Mi, 06 Feb 2008) $
Author:
Thomas Scheffler (yagee)

Constructor Summary
MCRCategoryTransformer()
           
 
Method Summary
static Element getEditorItems(MCRCategory cl, boolean sort, boolean emptyLeaves)
          transforms a Classification into a MCR Editor definition ( <items>).
static Element getEditorItems(MCRCategory cl, String labelFormat, boolean sort, boolean emptyLeaves)
          transforms a Classification into a MCR Editor definition (<items>).
static Document getMetaDataDocument(MCRCategory cl, boolean withCounter)
          transforms a MCRCategory into a JDOM Document.
static Element getMetaDataElement(MCRCategory category, boolean withCounter)
          transforms a MCRCategory into a JDOM Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRCategoryTransformer

public MCRCategoryTransformer()
Method Detail

getMetaDataDocument

public static Document getMetaDataDocument(MCRCategory cl,
                                           boolean withCounter)
transforms a MCRCategory into a JDOM Document. The Document will have a root tag with name "mycoreclass".

Parameters:
cl - Classification
Returns:

getMetaDataElement

public static Element getMetaDataElement(MCRCategory category,
                                         boolean withCounter)
transforms a MCRCategory into a JDOM Element. The element will have the tag name "category".

Parameters:
category - a category of a classification
Returns:

getEditorItems

public static Element getEditorItems(MCRCategory cl,
                                     boolean sort,
                                     boolean emptyLeaves)
transforms a Classification into a MCR Editor definition ( <items>).

Parameters:
cl - Classification
sort - if true, sort items
emptyLeaves - if true, also include empty leaves
Returns:

getEditorItems

public static Element getEditorItems(MCRCategory cl,
                                     String labelFormat,
                                     boolean sort,
                                     boolean emptyLeaves)
transforms a Classification into a MCR Editor definition (<items>). This method allows you to specify how the labels will look like. labelFormat is simply a String that is parsed for a few key words, that will be replaced by a dynamic value. The following keywords can be used at the moment:

Parameters:
cl - Classification
labelFormat - format String as specified above
sort - if true, sort items
emptyLeaves - if true, also include empty leaves
Returns: