[ 
http://jira.dspace.org/jira/browse/DS-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jose Blanco updated DS-587:
---------------------------

    Attachment: tombstone.jsp
                embargo.jsp
                confirm-withdraw-item.jsp

I've included here the changes I made to make this tombstone work at our 
instance in the jspui webapp..

These are the files that were changed to make this work:


M jsp/WEB-INF/dspace-tags.tld

The '>' indicates what was added.
  <tag>
    <name>item</name>
    <tagclass>org.dspace.app.webui.jsptag.ItemTag</tagclass>
    <info>
      Tag for displaying an item.  "item" must always be an
      org.dspace.content.Item.  "style" should be "default" or "full", or can
      be omitted to use "default".  "collections" should be the array of
      collections the item is in, worked out beforehand to avoid the chance
      of an error occurring during display.  If collections is null, the
      collections the item is in aren't listed.
    </info>
    <attribute>
      <name>item</name>
      <required>true</required>
      <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
      <name>style</name>
      <required>false</required>
      <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
      <name>collections</name>
      <required>false</required>
      <rtexprvalue>true</rtexprvalue>
    </attribute>
>    <attribute>
>      <name>tombstone</name>
>      <required>false</required>
>      <rtexprvalue>true</rtexprvalue>
>    </attribute>
  </tag>


M jsp/local/tombstone.jsp
This file was changed completely it looks more like display-itme.jsp. So I have 
included it here in its 
entirity.



? jsp/local/embargo.jsp
This is a new file to display when an item is in embargo, rather than just 
withdrawn.



M src/org/dspace/app/webui/jsptag/ItemTag.java - all of these changes took 
place in 
listBitstream routine.  Two new routines where added, containing the tombstone 
status, 
they are - getTombstone, and setTombstone.  Because I have made so many 
customizations to 
this file I'm sending the snippets that pertain to this functionality.  The line
numbers will not make sense, but hopefully the comments can help in 
understanding where the 
code should go.

Index: ItemTag.java
===================================================================
RCS file: 
/l1/dspace/cvsroot/dspace/src/org/dspace/app/webui/jsptag/ItemTag.java,v
retrieving revision 1.10
diff -r1.10 ItemTag.java
150a151,153
>     /** The style to use - "default" or "full" */
>     private boolean tombstone;
> 
209a213,222
>     public boolean getTombstone()
>     {
>         return tombstone;
>     }
> 
>     public void setTombstone(boolean tombstoneIn)
>     {
>         tombstone = tombstoneIn;
>     }
> 
277a291,292
>         tombstone = false;   //this was added in the release routine
> 
622a638,651
>           if ( tombstone )
>           {
>               DCValue[] values = item.getDC("description", "provenance", 
> Item.ANY);
>               String latestProvenance = null;
>               if ( (values.length - 2) >= 0 )
>               {
>                   latestProvenance = values[values.length -2].value;
>               }
>               else
>               {
>                   latestProvenance = "Provenance not available";
>               }
>               out.println("<table cellspacing=\"1\" cellpadding=\"1\" 
> width=\"100%\" class=\"itemBundleTable\"><tr><th class=\"standard\">" + 
> latestProvenance + "</th></tr></table>");
>           }
661,672c690,710
<                 out
<                         .print("</td><td class=\"standard\"><a 
target=\"_blank\" href=\"");
<                 out.print(request.getContextPath());
<                 out.print("/html/");
<                 out.print(handle + "/");
<                 out
<                         .print(UIUtil.encodeBitstreamName(primaryBitstream
<                                 .getName(), Constants.DEFAULT_ENCODING));
<                 out.print("\">"
<                         + LocaleSupport.getLocalizedMessage(pageContext,
<                                 "org.dspace.app.webui.jsptag.ItemTag.view")
<                         + "</a></td></tr>");
---
> 
>               if ( tombstone )
>               {
>                   out.print("</td><td class=\"standard\">"         
>                   + "file is not available"
>                     + "</td></tr>");
>               }
>               else
>               {
>                   out.print("</td><td class=\"standard\"><a target=\"_blank\" 
> href=\"");
>                   out.print(request.getContextPath());
>                   out.print("/html/");
>                   out.print(handle + "/");
>                   out.print(UIUtil.encodeBitstreamName(primaryBitstream
>                                                        .getName(), 
> Constants.DEFAULT_ENCODING));
>                   out.print("\">"
>                             + LocaleSupport.getLocalizedMessage(pageContext,
>                               "org.dspace.app.webui.jsptag.ItemTag.view")
>                               + "</a></td></tr>");
>               }
> 
755,757c793,801
<                             out
<                                     .print(bsLink
<                                             + LocaleSupport
---
>                           if ( tombstone )
>                           {
>                               out.print("file is not available"
>                                         + "</a></td></tr>");
>                           }
>                           else
>                           {
>                             out.print(bsLink
>                                              + LocaleSupport
760,761c804,806
<                                                             
"org.dspace.app.webui.jsptag.ItemTag.view")
<                                             + "</a></td></tr>");
---
>                                                             
> "org.dspace.app.webui.jsptag.ItemTag.view"));
>                           }
> 


M src/org/dspace/app/webui/servlet/HandleServlet.java - all these changes take 
place
in the routine displayItem.  IT determines if the items is an embargoed item, 
and if
it is it displays an embargo message, if tombstone don't care about auth, this 
was the
case before because the tombstone page was displayed 1st before the auth code 
was reached.


cvs diff HandleServlet.java
Index: HandleServlet.java
===================================================================
RCS file: 
/l1/dspace/cvsroot/dspace/src/org/dspace/app/webui/servlet/HandleServlet.java,v
retrieving revision 1.9
diff -r1.9 HandleServlet.java
0a1
> 
53a55
> import org.dspace.app.webui.util.Restrict;
258,264c260,271
<         // Tombstone?
<         if (item.isWithdrawn())
<         {
<             JSPManager.showJSP(request, response, "/tombstone.jsp");
< 
<             return;
<         }
---
>       Item[] embargoItems = Restrict.getRestricted ( context );
>       int item_id = item.getID();
>       for (int i = 0; i < embargoItems.length; i++)
>       {
>           if ( item_id == embargoItems[i].getID() )
>           {
>               // This item is in embargo, not withdrawn
>               JSPManager.showJSP(request, response, "/embargo.jsp");
>               return;
>           }     
>       }
>           
266,267c273,279
<         // Ensure the user has authorisation
<         AuthorizeManager.authorizeAction(context, item, Constants.READ);
---
>       //For withdrawn items don't care about auth, since just
>       //showing the metadata.
>         if (!item.isWithdrawn())
>         {
>           // Ensure the user has authorisation
>           AuthorizeManager.authorizeAction(context, item, Constants.READ);
>       }
358a371,378
> 
>         // Tombstone?
>         if (item.isWithdrawn())
>         {
>             JSPManager.showJSP(request, response, "/tombstone.jsp");
>             return;
>         }
> 

Changes to  tools/confirm-withdraw-item.jsp where numerous, so I'm including 
the entire file.



> add the capability to indicate a withdraw reason to an item ( tombstone )
> -------------------------------------------------------------------------
>
>                 Key: DS-587
>                 URL: http://jira.dspace.org/jira/browse/DS-587
>             Project: DSpace 1.x
>          Issue Type: New Feature
>          Components: JSPUI
>    Affects Versions: 1.6.0
>         Environment: This is a change to the base functionality of the jspui.
>            Reporter: Jose Blanco
>            Priority: Minor
>         Attachments: confirm-withdraw-item.jsp, embargo.jsp, tombstone.jsp
>
>   Original Estimate: 0 minutes
>  Remaining Estimate: 0 minutes
>
> I have already made the changes to our instance of dspace.  Here is an 
> explanation of what the tombstone functionality works at our instance.
>  When an item is withdrawn the user is presented with these options for 
> the reason of withdraw ( these reasons live in the file 
> tools/confirm-withdraw-item.jsp ):
> Removed from view by legal order.
> Removed from view by the University of Michigan.
> Removed from view at request of the author.
> The user makes his selection and the item is withdrawn.  When the item is 
> accessed the reason for the withdraw is 
> displayed in the box containing the bitstreams. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------

_______________________________________________
Dspace-devel mailing list
Dspace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to