org.dspace.license
Class CreativeCommons.MdField

java.lang.Object
  extended by org.dspace.license.CreativeCommons.MdField
Enclosing class:
CreativeCommons

public static class CreativeCommons.MdField
extends Object

Helper class for using CC-related Metadata fields


Constructor Summary
CreativeCommons.MdField(String fieldName)
           
 
Method Summary
 void addItemValue(Item item, String value)
          Adds passed value to the set of values for the field in passed item.
 String ccItemValue(Item item)
          Returns first value that matches Creative Commons 'shibboleth', or null if no matching values.
 String keyedItemValue(Item item, String key)
          Returns the value that matches the value mapped to the passed key if any.
 void removeItemValue(Item item, String value)
          Removes the passed value from the set of values for the field in passed item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreativeCommons.MdField

public CreativeCommons.MdField(String fieldName)
Method Detail

ccItemValue

public String ccItemValue(Item item)
Returns first value that matches Creative Commons 'shibboleth', or null if no matching values. NB: this method will succeed only for metadata fields holding CC URIs

Parameters:
item - - the item to read
Returns:
value - the first CC-matched value, or null if no such value

keyedItemValue

public String keyedItemValue(Item item,
                             String key)
                      throws AuthorizeException,
                             IOException,
                             SQLException
Returns the value that matches the value mapped to the passed key if any. NB: this only delivers a license name (if present in field) given a license URI

Parameters:
item - - the item to read
key - - the key for desired value
Returns:
value - the value associated with key or null if no such value
Throws:
AuthorizeException
IOException
SQLException

removeItemValue

public void removeItemValue(Item item,
                            String value)
                     throws AuthorizeException,
                            IOException,
                            SQLException
Removes the passed value from the set of values for the field in passed item.

Parameters:
item - - the item to update
value - - the value to remove
Throws:
AuthorizeException
IOException
SQLException

addItemValue

public void addItemValue(Item item,
                         String value)
Adds passed value to the set of values for the field in passed item.

Parameters:
item - - the item to update
value - - the value to add in this field


Copyright © 2011 DuraSpace. All Rights Reserved.