org.dspace.app.webui.jsptag
Class ItemTag

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

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

JSP tag for displaying an item.

The fields that are displayed can be configured in dspace.cfg using the webui.itemdisplay.(style) property. The form is

 
 <schema prefix>.<element>[.<qualifier>|.*][(date)|(link)], ...
 
 

For example:

 
 dc.title = Dublin Core element 'title' (unqualified)
 dc.title.alternative = DC element 'title', qualifier 'alternative'
 dc.title.* = All fields with Dublin Core element 'title' (any or no qualifier)
 dc.identifier.uri(link) = DC identifier.uri, render as a link
 dc.date.issued(date) = DC date.issued, render as a date
 dc.identifier.doi(doi) = DC identifier.doi, render as link to http://dx.doi.org
 dc.identifier.hdl(handle) = DC identifier.hanlde, render as link to http://hdl.handle.net
 dc.relation.isPartOf(resolver) = DC relation.isPartOf, render as link to the base url of the resolver 
                                  according to the specified urn in the metadata value (doi:xxxx, hdl:xxxxx, 
                                  urn:issn:xxxx, etc.)
 
 

When using "resolver" in webui.itemdisplay to render identifiers as resolvable links, the base URL is taken from webui.resolver..baseurl where webui.resolver..urn matches the urn specified in the metadata value. The value is appended to the "baseurl" as is, so the baseurl need to end with slash almost in any case. If no urn is specified in the value it will be displayed as simple text.

 
 webui.resolver.1.urn = doi
 webui.resolver.1.baseurl = http://dx.doi.org/
 webui.resolver.2.urn = hdl
 webui.resolver.2.baseurl = http://hdl.handle.net/
 
 
For the doi and hdl urn defaults values are provided, respectively http://dx.doi.org/ and http://hdl.handle.net/ are used.
If a metadata value with style: "doi", "handle" or "resolver" matches a URL already, it is simply rendered as a link with no other manipulation.

 
 

If an item has no value for a particular field, it won't be displayed. The name of the field for display will be drawn from the current UI dictionary, using the key:

 
 "metadata.<style.>.<field>"
 
 e.g. "metadata.thesis.dc.title" "metadata.thesis.dc.contributor.*"
 "metadata.thesis.dc.date.issued"
 
 
 if this key is not found will be used the more general one
 
 "metadata.<field>"
 
 e.g. "metadata.dc.title" "metadata.dc.contributor.*"
 "metadata.dc.date.issued"
 
 

You need to specify which strategy use for select the style for an item.

 
 plugin.single.org.dspace.app.webui.util.StyleSelection = \
                      org.dspace.app.webui.util.CollectionStyleSelection
                      #org.dspace.app.webui.util.MetadataStyleSelection
 
 

With the Collection strategy you can also specify which collections use which views.

 
 webui.itemdisplay.<style>.collections = <collection handle>, ...
 
 

FIXME: This should be more database-driven

 
 webui.itemdisplay.thesis.collections = 123456789/24, 123456789/35
 
 

With the Metadata strategy you MUST specify which metadata use as name of the style.

 
 webui.itemdisplay.metadata-style = schema.element[.qualifier|.*]
 
 e.g. "dc.type"
 
 

Version:
$Revision$
Author:
Robert Tansley
See Also:
Serialized Form

Field Summary
 
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
ItemTag()
           
 
Method Summary
 int doStartTag()
           
 Collection[] getCollections()
          Get the collections this item is in
 Item getItem()
          Get the item this tag should display
 String getStyle()
          Get the style this tag should display
 void release()
           
 void setCollections(Collection[] collectionsIn)
          Set the collections this item is in
 void setItem(Item itemIn)
          Set the item this tag should display
 void setStyle(String styleIn)
          Set the style this tag should display
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemTag

public ItemTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

getItem

public Item getItem()
Get the item this tag should display

Returns:
the item

setItem

public void setItem(Item itemIn)
Set the item this tag should display

Parameters:
itemIn - the item to display

getCollections

public Collection[] getCollections()
Get the collections this item is in

Returns:
the collections

setCollections

public void setCollections(Collection[] collectionsIn)
Set the collections this item is in

Parameters:
collectionsIn - the collections

getStyle

public String getStyle()
Get the style this tag should display

Returns:
the style

setStyle

public void setStyle(String styleIn)
Set the style this tag should display

Parameters:
styleIn - the Style to display

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport


Copyright © 2013 DuraSpace. All Rights Reserved.