org.dspace.app.webui.jsptag
Class ControlledVocabularyTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.dspace.app.webui.jsptag.ControlledVocabularyTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public class ControlledVocabularyTag
extends javax.servlet.jsp.tagext.TagSupport

A Tag to load and display controlled vocabularies

Version:
$Revision$
Author:
Miguel Ferreira
See Also:
Serialized Form

Field Summary
 Map<String,Document> controlledVocabularies
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ControlledVocabularyTag()
           
 
Method Summary
 int doEndTag()
          End processing tag
 int doStartTag()
          Process tag
 Document filterVocabulary(Document vocabulary, String vocabularyPrunningXSLT, String filter)
          Applies a filter to the provided vocabulary, i.e.
 String getFilter()
          Gets the filter provided as parameter to the tag
 String getVocabulary()
          Gets the name of the vocabulary to be displayed
 boolean isAllowMultipleSelection()
          Returns the value of the multiple selection parameter
 String renderVocabularyAsHTML(Document vocabulary, String controlledVocabulary2HtmlXSLT, boolean allowMultipleSelection, String contextPath)
          Renders a taxonomy as HTML by applying a stylesheet.
 void setAllowMultipleSelection(boolean allowMultipleSelection)
          Defines if we want to be able to select multiple terms of the taxonomy
 void setFilter(String filter)
          Sets the filter
 void setVocabulary(String vocabulary)
          Sets the name of the vocabulary to be displayed.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlledVocabularies

public Map<String,Document> controlledVocabularies
Constructor Detail

ControlledVocabularyTag

public ControlledVocabularyTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Process tag

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
End processing tag

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport

renderVocabularyAsHTML

public String renderVocabularyAsHTML(Document vocabulary,
                                     String controlledVocabulary2HtmlXSLT,
                                     boolean allowMultipleSelection,
                                     String contextPath)
Renders a taxonomy as HTML by applying a stylesheet.

Parameters:
vocabulary - The XML document representing a taxonomy
controlledVocabulary2HtmlXSLT - The filename of the stylesheet that converts the taxonomy to HTML
allowMultipleSelection - include checkboxes next to the taxonomy terms
contextPath - The context path
Returns:
the provided taxonomy as HTML.

filterVocabulary

public Document filterVocabulary(Document vocabulary,
                                 String vocabularyPrunningXSLT,
                                 String filter)
Applies a filter to the provided vocabulary, i.e. it prunes the tree by removing all the branches that do not contain the words in the filter.

Parameters:
vocabulary - The vocabulary to be trimmed
vocabularyPrunningXSLT - The filename of the stylesheet that trims the vocabulary
filter - The filter to be applied
Returns:
The trimmed vocabulary.

getFilter

public String getFilter()
Gets the filter provided as parameter to the tag

Returns:
the filter

setFilter

public void setFilter(String filter)
Sets the filter

Parameters:
filter - the filter

isAllowMultipleSelection

public boolean isAllowMultipleSelection()
Returns the value of the multiple selection parameter

Returns:
true if the multiple selection was selected

setAllowMultipleSelection

public void setAllowMultipleSelection(boolean allowMultipleSelection)
Defines if we want to be able to select multiple terms of the taxonomy

Parameters:
allowMultipleSelection - true if we want to be able to select more than on term

getVocabulary

public String getVocabulary()
Gets the name of the vocabulary to be displayed

Returns:
the name of the vocabulary

setVocabulary

public void setVocabulary(String vocabulary)
Sets the name of the vocabulary to be displayed. If no name is provided, all vocabularies loaded will be rendered to the output

Parameters:
vocabulary - the name of the vocabulary to be selected


Copyright © 2013 DuraSpace. All Rights Reserved.