Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Panel

Contents

Table of Contents
outlinetrue
stylenone

...

Overview

This is a write-up of a method of modifying DSpace to allow the embargoing of documents submitted to a repository. The The other method  on the DSpace wiki is written for an older version of DSpace and the instructions no longer (at least clearly) apply to 1.4.2.

...

Code Block
    {
        // Tombstone?
        if (item.isWithdrawn())
        {
            JSPManager.showJSP(request, response, "/tombstone.jsp");
 
            return;
        }

and insert the following code:

...

Code Block
        // Now that the item is archived.  See if you need to withdraw it,
        // because of restriction.
        // Begining. This code is new to handle restriction.
        DCValue[] restriction = item.getDC("date", "available", Item.ANY);
        //log.warn(LogManager.getHeader(c, "restriction",
        //                            "restriction" + restriction[0].value));

        int restrictionValue = -1;
        if (restriction[0].value.equals("WITHHELD_THREE_MONTHS"))
        {
            restrictionValue = 0;
        }
        else if (restriction[0].value.equals("WITHHELD_HALF_YEAR"))
        {
            restrictionValue = 1;
        }
        else if (restriction[0].value.equals("WITHHELD_ONE_YEAR"))
        {
            restrictionValue = 2;
        }

        //log.warn(LogManager.getHeader(c, "restrictionValue",
        //                                "restrictionValue" + restrictionValue));

        if (restrictionValue != -1)
        {            
            // apply the restrictions to the item
            Restrict.apply(c, item, restrictionValue);
        }
        //End of new code.

...

I hope this guide works for you. I've tried to remember all the small steps and issues I overcame in adding the embargo feature to our repository. Of course, thanks goes to Jose Blanco for sharing this in the first place, and Graeme Fox for helping me parse through everything.

Files

...