Class MCRCategoryTransformer
java.lang.Object
org.mycore.datamodel.classifications2.utils.MCRCategoryTransformer
- Version:
- $Revision$ $Date: 2008-02-06 17:27:24 +0000 (Mi, 06 Feb 2008) $
- Author:
- Thomas Scheffler (yagee)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Element
getEditorItems
(MCRCategory cl, boolean sort, boolean emptyLeaves, boolean completeId) transforms aClassification
into a MCR Editor definition (<items>
).static Element
getEditorItems
(MCRCategory cl, String labelFormat, boolean sort, boolean emptyLeaves, boolean completeId) transforms aClassification
into a MCR Editor definition (<items>
).static Document
getMetaDataDocument
(MCRCategory cl, boolean withCounter) transforms aMCRCategory
into a JDOM Document.static Element
getMetaDataElement
(MCRCategory category, boolean withCounter) transforms aMCRCategory
into a JDOM Element.
-
Constructor Details
-
MCRCategoryTransformer
public MCRCategoryTransformer()
-
-
Method Details
-
getMetaDataDocument
transforms aMCRCategory
into a JDOM Document. The Document will have a root tag with name "mycoreclass".- Parameters:
cl
- Classification
-
getMetaDataElement
transforms aMCRCategory
into a JDOM Element. The element will have the tag name "category".- Parameters:
category
- a category of a classification
-
getEditorItems
public static Element getEditorItems(MCRCategory cl, boolean sort, boolean emptyLeaves, boolean completeId) transforms aClassification
into a MCR Editor definition (<items>
).- Parameters:
cl
- Classificationsort
- if true, sort itemsemptyLeaves
- if true, also include empty leavescompleteId
- if true, category ID is given in form {classID}':'{categID}
-
getEditorItems
public static Element getEditorItems(MCRCategory cl, String labelFormat, boolean sort, boolean emptyLeaves, boolean completeId) transforms aClassification
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:- {id}
- {text}
- {description}
- {count}
- Parameters:
cl
- ClassificationlabelFormat
- format String as specified abovesort
- if true, sort itemsemptyLeaves
- if true, also include empty leaves
-