Thank you Richard, It now works. The problem was a combination of issues, but 
mainly I had two errors in dspace.cfg ar:

embargo.terms.days = None:,90 days:90,6 months:180,1 year,365,2 
years:730,Forever:forever

The 'None:' entry was obviously an error and the '1 year,365' entry was just a 
blatant typo, it was changed to '1 year:365' ...

Dspace.cfg to

embargo.terms.days = 90 days:90,6 months:180,1 year:365,2 
years:730,forever:forever

I fixed my embargo_terms <value-pairs> to the following in input-form.xml

<pair>
 <displayed-value></displayed-value>
 <stored-value></stored-value>
</pair>
<pair>
<displayed-value>90 days</displayed-value>
 <stored-value>90 days</stored-value>
 </pair>
<pair>
 <displayed-value>6 months</displayed-value>
 <stored-value>6 months</stored-value>
</pair>
<pair>
 <displayed-value>1 year</displayed-value>
 <stored-value>1 year</stored-value>
</pair>
<pair>
 <displayed-value>2 years</displayed-value>
 <stored-value>2 years</stored-value>
</pair>
<pair>
 <displayed-value>forever</displayed-value>
 <stored-value>forever</stored-value>
</pair>

Maybe this can be explained better in the documentation, especially how to 
configure DayTableEmbargoSetter for cases like none or forever. I figured it 
out with the help of Richard and some trial and error, but it could be more 
clearly explained in the docs.

-Phil

-------------------------
Philip Shafer
Web Developer
Rowan University
Library Services
Ph: 856-256-4418
E-mail: [email protected]
Philip Shafer
Web Developer
Rowan University
Library Services
Ph: 856-256-4418
E-mail: [email protected]

From: Richard Rodgers <[email protected]<mailto:[email protected]>>
Date: Tue, 1 Nov 2011 13:08:50 -0400
To: Philip Shafer <[email protected]<mailto:[email protected]>>
Cc: 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: [Dspace-tech] ArrayIndexOutOfBoundsException in Embargo 
DayTableEmbargoSetter

Hi Phil:

The error comes from not having a value after the 'None:' in the 
embargo.terms.days.property
The code requires that there be a number after the ':'  -  the 'forever' value 
is the only exception to that rule (which looks fine in your property).

Just a quick thought - why have the 'None' case at all? Since the field 
assignment is optional, one can simply skip assignment is no embargo is desired.

Thanks,

Richard



On Nov 1, 2011, at 12:41 PM, Shafer, Philip wrote:

I keep getting the following error when an item is submitted and attempted to 
be installed in the repository:


java.lang.ArrayIndexOutOfBoundsException: 1
        at 
org.dspace.embargo.DayTableEmbargoSetter.<init>(DayTableEmbargoSetter.java:48)


I'm wondering if someone could see if I have something set wrong.  I do need an 
option for no embargo and an indefinite/forever embargo.

Here are the properties I have set:


dspace.cfg

#### Embargo Settings ####
# DC metadata field to hold the user-supplied embargo terms
embargo.field.terms = dc.embargo.terms

# DC metadata field to hold computed "lift date" of embargo
embargo.field.lift = dc.embargo.lift

# string in terms field to indicate indefinite embargo
embargo.terms.open = forever

# embargo.terms.days defines a table of values for the embargo system
embargo.terms.days = None:,90 days:90,6 months:180,1 year,365,2 
years:730,Forever:forever

# implementation of embargo setter plugin - replace with local implementation 
if applicable
# plugin.single.org.dspace.embargo.EmbargoSetter = 
org.dspace.embargo.DefaultEmbargoSetter
plugin.single.org.dspace.embargo.EmbargoSetter = 
org.dspace.embargo.DayTableEmbargoSetter

# implementation of embargo lifter plugin - - replace with local implementation 
if applicable
plugin.single.org.dspace.embargo.EmbargoLifter = 
org.dspace.embargo.DefaultEmbargoLifter



input-forms.xml

 <field>
   <dc-schema>dc</dc-schema>
   <dc-element>embargo</dc-element>
   <dc-qualifier>terms</dc-qualifier>
   <repeatable>false</repeatable>
   <label>Embargo Item For</label>
   <input-type value-pairs-name="embargo_terms">dropdown</input-type>
   <hint>Select the length for the embargo, or select 'None' for no embargo.  
Select 'Forever' for an indefinate embargo.</hint>
   <required></required>
 </field>



<value-pairs value-pairs-name="embargo_terms" dc-term="embargo.terms">
   <pair>
    <displayed-value>None</displayed-value>
    <stored-value>None</stored-value>
  </pair>
  <pair>
    <displayed-value>90 days</displayed-value>
    <stored-value>90 days</stored-value>
  </pair>
  <pair>
    <displayed-value>6 months</displayed-value>
    <stored-value>6 months</stored-value>
  </pair>
  <pair>
    <displayed-value>1 year</displayed-value>
    <stored-value>1 year</stored-value>
  </pair>
  <pair>
    <displayed-value>2 years</displayed-value>
    <stored-value>2 years</stored-value>
  </pair>

  <pair>

    <displayed-value>Forever</displayed-value>
    <stored-value>Forever</stored-value>
  </pair>

</value-pairs>

-------------------------
Philip Shafer
Web Developer
Rowan University
Library Services
Ph: 856-256-4418
E-mail: [email protected]<mailto:[email protected]>
<ATT00001..c><ATT00002..c>

------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to