org.dspace.app.xmlui.utils
Class HandleUtil

java.lang.Object
  extended by org.dspace.app.xmlui.utils.HandleUtil

public class HandleUtil
extends Object

Simple utility class for extracting handles.

Author:
Scott Phillips

Field Summary
protected static String DSPACE_OBJECT
           
protected static String HANDLE_PREFIX
          The URL prefix of all handles
 
Constructor Summary
HandleUtil()
           
 
Method Summary
static void buildHandleTrail(DSpaceObject dso, PageMeta pageMeta, String contextPath)
          Build a list of trail metadata starting with the owning collection and ending with the root level parent.
static void buildHandleTrail(DSpaceObject dso, PageMeta pageMeta, String contextPath, boolean linkOriginalObject)
          Build a list of trail metadata starting with the owning collection and ending with the root level parent.
static boolean inheritsFrom(DSpaceObject dso, String parent)
          Determine if the given DSO is an ancestor of the the parent handle.
static DSpaceObject obtainHandle(Map objectModel)
          Obtain the current DSpace handle for the specified request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANDLE_PREFIX

protected static final String HANDLE_PREFIX
The URL prefix of all handles

See Also:
Constant Field Values

DSPACE_OBJECT

protected static final String DSPACE_OBJECT
See Also:
Constant Field Values
Constructor Detail

HandleUtil

public HandleUtil()
Method Detail

obtainHandle

public static DSpaceObject obtainHandle(Map objectModel)
                                 throws SQLException
Obtain the current DSpace handle for the specified request.

Parameters:
objectModel - The cocoon model.
Returns:
A DSpace handle, or null if none found.
Throws:
SQLException

inheritsFrom

public static boolean inheritsFrom(DSpaceObject dso,
                                   String parent)
                            throws SQLException
Determine if the given DSO is an ancestor of the the parent handle.

Parameters:
dso - The child DSO object.
parent - The Handle to test against.
Returns:
The matched DSO object or null if none found.
Throws:
SQLException

buildHandleTrail

public static void buildHandleTrail(DSpaceObject dso,
                                    PageMeta pageMeta,
                                    String contextPath)
                             throws SQLException,
                                    WingException
Build a list of trail metadata starting with the owning collection and ending with the root level parent. If the Object is an item, a bundle, or a bitstream, then the object is not included, but its collection and community parents are. However, if the item is a community or collection then it is included along with all parents.

If the terminal object in the trail is the passed object, do not link to it, because that is (presumably) the page at which the user has arrived.

Parameters:
dso - the DSpace who's parents we wil add to the pageMeta
pageMeta - the object to which we link our trial
contextPath - The context path
Throws:
SQLException
WingException

buildHandleTrail

public static void buildHandleTrail(DSpaceObject dso,
                                    PageMeta pageMeta,
                                    String contextPath,
                                    boolean linkOriginalObject)
                             throws SQLException,
                                    WingException
Build a list of trail metadata starting with the owning collection and ending with the root level parent. If the Object is an item, a bundle, or a bitstream, then the object is not included, but its collection and community parents are. However, if the item is a community or collection then it is included along with all parents.

If the terminal object in the trail is the passed object, do not link to it, because that is (presumably) the page at which the user has arrived.

Parameters:
dso - the DSpace who's parents we wil add to the pageMeta
pageMeta - the object to which we link our trial
contextPath - The context path
linkOriginalObject - whether or not to make a link of the original object
Throws:
SQLException
WingException


Copyright © 2012 DuraSpace. All Rights Reserved.