org.dspace.content
Class LicenseUtils

java.lang.Object
  extended by org.dspace.content.LicenseUtils

public class LicenseUtils
extends Object

Utility class to manage generation and storing of the license text that the submitter has to grant/granted for archiving the item

Author:
bollini

Constructor Summary
LicenseUtils()
           
 
Method Summary
static String getLicenseText(Locale locale, Collection collection, Item item, EPerson eperson)
          Utility method if no additional arguments has need to be supplied to the license template.
static String getLicenseText(Locale locale, Collection collection, Item item, EPerson eperson, Map<String,Object> additionalInfo)
          Return the text of the license that the user has granted/must grant before for submit the item.
static void grantLicense(Context context, Item item, String licenseText)
          Store a copy of the license a user granted in the item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseUtils

public LicenseUtils()
Method Detail

getLicenseText

public static String getLicenseText(Locale locale,
                                    Collection collection,
                                    Item item,
                                    EPerson eperson,
                                    Map<String,Object> additionalInfo)
Return the text of the license that the user has granted/must grant before for submit the item. The license text is build using the template defined for the collection if any or the wide site configuration. In the license text the following substitution can be used. {0} the eperson firstname
{1} the eperson lastname
{2} the eperson email
{3} the current date
{4} the collection object that will be formatted using the appropriate LicenseArgumentFormatter plugin (if defined)
{5} the item object that will be formatted using the appropriate LicenseArgumentFormatter plugin (if defined)
{6} the eperson object that will be formatted using the appropriate LicenseArgumentFormatter plugin (if defined)
{x} any addittion argument supplied wrapped in the LicenseArgumentFormatter based on his type (map key)

Parameters:
locale -
collection -
item -
eperson -
additionalInfo -
Returns:
the license text obtained substituting the provided argument in the license template
See Also:
LicenseArgumentFormatter

getLicenseText

public static String getLicenseText(Locale locale,
                                    Collection collection,
                                    Item item,
                                    EPerson eperson)
Utility method if no additional arguments has need to be supplied to the license template. (i.e. call the full getLicenseText suppling null for the additionalInfo argument)

Parameters:
locale -
collection -
item -
eperson -
Returns:

grantLicense

public static void grantLicense(Context context,
                                Item item,
                                String licenseText)
                         throws SQLException,
                                IOException,
                                AuthorizeException
Store a copy of the license a user granted in the item.

Parameters:
context - the dspace context
item - the item object of the license
licenseText - the license the user granted
Throws:
SQLException
IOException
AuthorizeException


Copyright © 2010 DuraSpace. All Rights Reserved.