Class MCRCategoryTransformer

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

public class MCRCategoryTransformer extends Object
Version:
$Revision$ $Date: 2008-02-06 17:27:24 +0000 (Mi, 06 Feb 2008) $
Author:
Thomas Scheffler (yagee)
  • Constructor Details

    • MCRCategoryTransformer

      public MCRCategoryTransformer()
  • Method Details

    • 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
    • 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
    • getEditorItems

      public static Element getEditorItems(MCRCategory cl, boolean sort, boolean emptyLeaves, boolean completeId)
      transforms a Classification into a MCR Editor definition ( <items>).
      Parameters:
      cl - Classification
      sort - if true, sort items
      emptyLeaves - if true, also include empty leaves
      completeId - 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 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:
      • {id}
      • {text}
      • {description}
      • {count}
      Parameters:
      cl - Classification
      labelFormat - format String as specified above
      sort - if true, sort items
      emptyLeaves - if true, also include empty leaves