org.dspace.browse
Class BrowseItem

java.lang.Object
  extended by org.dspace.content.DSpaceObject
      extended by org.dspace.browse.BrowseItem

public class BrowseItem
extends DSpaceObject

Entity class to represent an item that is being used to generate Browse results. This behaves in many was similar to the Item object, but its metadata handling has been further optimised for performance in both reading and writing, and it does not deal with other objects related to items FIXME: this class violates some of the encapsulation of the Item, but there is unfortunately no way around this until DAOs and an interface are provided for the Item class.

Author:
Richard Jones

Constructor Summary
BrowseItem(Context context, int id, boolean in_archive, boolean withdrawn)
          Construct a new browse item with the given context and the database id
 
Method Summary
 String getHandle()
          Get the Handle of the object.
 int getID()
          get the database id of the item
 DCValue[] getMetadata(String schema, String element, String qualifier, String lang)
          Get String array of metadata values matching the given parameters
 String getName()
          Get a proper name for the object.
 Thumbnail getThumbnail()
          Get a thumbnail object out of the item.
 int getType()
          Get the type of object.
 int getType(boolean real)
          Deprecated.  
 boolean isArchived()
           
 boolean isWithdrawn()
           
 void setID(int id)
          Set the database id of the item
 
Methods inherited from class org.dspace.content.DSpaceObject
addDetails, clearDetails, find, getAdminObject, getDetails, getParentObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowseItem

public BrowseItem(Context context,
                  int id,
                  boolean in_archive,
                  boolean withdrawn)
Construct a new browse item with the given context and the database id

Parameters:
context - the DSpace context
id - the database id of the item
in_archive -
withdrawn -
Method Detail

getMetadata

public DCValue[] getMetadata(String schema,
                             String element,
                             String qualifier,
                             String lang)
                      throws SQLException
Get String array of metadata values matching the given parameters

Parameters:
schema - metadata schema
element - metadata element
qualifier - metadata qualifier
lang - metadata language
Returns:
array of matching values
Throws:
SQLException

getType

public int getType()
Get the type of object. This object masquerates as an Item, so this returns the value of Constants.ITEM

Specified by:
getType in class DSpaceObject
Returns:
Constants.ITEM

getType

public int getType(boolean real)
Deprecated. 

Parameters:
real -
Returns:

getID

public int getID()
get the database id of the item

Specified by:
getID in class DSpaceObject
Returns:
database id of item

setID

public void setID(int id)
Set the database id of the item

Parameters:
id - the database id of the item

getHandle

public String getHandle()
Description copied from class: DSpaceObject
Get the Handle of the object. This may return null

Specified by:
getHandle in class DSpaceObject
Returns:
Handle of the object, or null if it doesn't have one

getThumbnail

public Thumbnail getThumbnail()
                       throws SQLException
Get a thumbnail object out of the item. Warning: using this method actually instantiates an Item, which has a corresponding performance hit on the database during browse listing rendering. That's your own fault for wanting to put images on your browse page!

Returns:
Throws:
SQLException

getName

public String getName()
Description copied from class: DSpaceObject
Get a proper name for the object. This may return null. Name should be suitable for display in a user interface.

Specified by:
getName in class DSpaceObject
Returns:
Name for the object, or null if it doesn't have one

isArchived

public boolean isArchived()

isWithdrawn

public boolean isWithdrawn()


Copyright © 2010 DuraSpace. All Rights Reserved.