Hi Peter,
I was afraid that I will need to modify the SQL query itself to fetch more than
just the bitstream-id.
Wasn’t aware of the existence of the Bitstream.find method. Thanks a lot for
the patch!
Debashree
From: Peter Dietz [mailto:pdiet...@gmail.com]
Sent: Wednesday, December 07, 2011 4:35 PM
To: Debashree Pati
Cc: dspace-tech@lists.sourceforge.net
Subject: Re: [Dspace-tech] checker-emailer report contains only bitstream-ids
Hi Debashree,
It looks like you'll want to look in the code for SimpleReporterImpl.java
https://github.com/DSpace/DSpace/blob/d0823ff649ebe0816d9d0a67a6a1f456f9cea6a2/dspace-api/src/main/java/org/dspace/checker/SimpleReporterImpl.java#L270
I haven't gotten any bitstreams returned in any checksum checker reports, so I
haven't encountered this problem. But I wrote a small patch you can look at to
see if that would help you provide more information in your report.
https://gist.github.com/1444758
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git
a/dspace-api/src/main/java/org/dspace/checker/SimpleReporterImpl.java
b/dspace-api/src/main/java/org/dspace/checker/SimpleReporterImpl.java
index 88ea08b..a176359 100644
--- a/dspace-api/src/main/java/org/dspace/checker/SimpleReporterImpl.java
+++ b/dspace-api/src/main/java/org/dspace/checker/SimpleReporterImpl.java
@@ -14,6 +14,10 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
+import org.dspace.content.Bitstream;
+import org.dspace.content.DSpaceObject;
+import org.dspace.content.Item;
+import org.dspace.core.Context;
import org.dspace.core.I18nUtil;
/**
@@ -289,6 +293,15 @@ public class SimpleReporterImpl implements SimpleReporter
buf.append("------------------------------------------------ \n");
buf.append(msg("bitstream-id")).append(" = ").append(
historyInfo.getBitstreamId()).append("\n");
+ try {
+ Context context = new Context();
+ Bitstream bitstream = Bitstream.find(context,
historyInfo.getBitstreamId());
+ DSpaceObject parentDSO = bitstream.getParentObject();
+ if(parentDSO instanceof Item) {
+ Item parentItem = (Item) parentDSO;
+
buf.append("parent-item-handle").append(parentItem.getHandle()).append("parent-item-name").append(parentItem.getName());
+ }
+ } catch (Exception e) { }
buf.append(msg("process-start-date")).append(" = ").append(
applyDateFormatLong(historyInfo.getProcessStartDate()))
.append("\n");
Peter Dietz
On Wed, Dec 7, 2011 at 2:45 PM, Debashree Pati
<dp...@ohiolink.edu<mailto:dp...@ohiolink.edu>> wrote:
Hi,
In our dspace installation , I have set up a cron job to run the checker
utility and then
email the checker-email report to an admin account. The checker report contains
all
the information but is ordered by bitstream_ids. Handle or names of items
aren’t listed.
The person getting the report does not have access to the database to relate the
bitstream_id to the item handle or name. Has anyone figured out a way how to
get the
handles/names into the report? Or is there any other workaround that can
provide the
recipient with better information?
Thanks,
Debashree
OhioLINK
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net<mailto:DSpace-tech@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/dspace-tech
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech