mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 11:33:11 +00:00
[DS-2728] Remove the BundleBitstream object & replace by JPA mapping
This commit is contained in:
@@ -367,12 +367,11 @@ public class ItemExportServiceImpl implements ItemExportService
|
|||||||
|
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
// bundles can have multiple bitstreams now...
|
// bundles can have multiple bitstreams now...
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
String bundleName = bundle.getName();
|
String bundleName = bundle.getName();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
String myName = bitstream.getName();
|
String myName = bitstream.getName();
|
||||||
String oldName = myName;
|
String oldName = myName;
|
||||||
|
|
||||||
@@ -563,11 +562,11 @@ public class ItemExportServiceImpl implements ItemExportService
|
|||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// get all the bitstreams in each bundle
|
// get all the bitstreams in each bundle
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
// add up the size
|
// add up the size
|
||||||
size += bundleBitstream.getBitstream().getSize();
|
size += bitstream.getSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
items.add(item.getID());
|
items.add(item.getID());
|
||||||
@@ -599,11 +598,11 @@ public class ItemExportServiceImpl implements ItemExportService
|
|||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// get all the bitstreams in the bundle
|
// get all the bitstreams in the bundle
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
// add up the size
|
// add up the size
|
||||||
size += bundleBitstream.getBitstream().getSize();
|
size += bitstream.getSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
items.add(item.getID());
|
items.add(item.getID());
|
||||||
@@ -625,11 +624,11 @@ public class ItemExportServiceImpl implements ItemExportService
|
|||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// get all the bitstreams in the bundle
|
// get all the bitstreams in the bundle
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
// add up the size
|
// add up the size
|
||||||
size += bundleBitstream.getBitstream().getSize();
|
size += bitstream.getSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ArrayList<UUID> items = new ArrayList<>();
|
ArrayList<UUID> items = new ArrayList<>();
|
||||||
|
@@ -14,7 +14,6 @@ import java.util.List;
|
|||||||
import org.dspace.app.util.Util;
|
import org.dspace.app.util.Util;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
@@ -60,8 +59,7 @@ public class ItemMarkingAvailabilityBitstreamStrategy implements ItemMarkingExtr
|
|||||||
return markInfo;
|
return markInfo;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BundleBitstream bundleBitstream = originalBundle.getBitstreams().get(0);
|
Bitstream bitstream = originalBundle.getBitstreams().get(0);
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
|
|
||||||
ItemMarkingInfo signInfo = new ItemMarkingInfo();
|
ItemMarkingInfo signInfo = new ItemMarkingInfo();
|
||||||
signInfo.setImageName(availableImageName);
|
signInfo.setImageName(availableImageName);
|
||||||
|
@@ -159,10 +159,9 @@ public class AddBitstreamsAction extends UpdateBitstreamsAction {
|
|||||||
//verify bundle + name are not duplicates
|
//verify bundle + name are not duplicates
|
||||||
for (Bundle b : bundles)
|
for (Bundle b : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = b.getBitstreams();
|
List<Bitstream> bitstreams = b.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bsm : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bsm = bundleBitstream.getBitstream();
|
|
||||||
if (bsm.getName().equals(ce.filename))
|
if (bsm.getName().equals(ce.filename))
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Duplicate bundle + filename cannot be added: "
|
throw new IllegalArgumentException("Duplicate bundle + filename cannot be added: "
|
||||||
|
@@ -12,7 +12,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BitstreamFilter implementation to filter by bundle name
|
* BitstreamFilter implementation to filter by bundle name
|
||||||
@@ -50,10 +49,9 @@ public class BitstreamFilterByBundleName extends BitstreamFilter {
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundles)
|
for (Bundle b : bundles)
|
||||||
{
|
{
|
||||||
Bundle b = bundleBitstream.getBundle();
|
|
||||||
if (b.getName().equals(bundleName))
|
if (b.getName().equals(bundleName))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@@ -70,10 +70,9 @@ public class DeleteBitstreamsAction extends UpdateBitstreamsAction
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundles = bs.getBundles();
|
List<Bundle> bundles = bs.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundles)
|
for (Bundle b : bundles)
|
||||||
{
|
{
|
||||||
Bundle b = bundleBitstream.getBundle();
|
|
||||||
if (isTest)
|
if (isTest)
|
||||||
{
|
{
|
||||||
ItemUpdate.pr("Delete bitstream with id = " + id);
|
ItemUpdate.pr("Delete bitstream with id = " + id);
|
||||||
@@ -91,7 +90,7 @@ public class DeleteBitstreamsAction extends UpdateBitstreamsAction
|
|||||||
DtoMetadata dtom = DtoMetadata.create("dc.description.provenance", "en", "");
|
DtoMetadata dtom = DtoMetadata.create("dc.description.provenance", "en", "");
|
||||||
|
|
||||||
String append = "Bitstream " + bs.getName() + " deleted on " + DCDate.getCurrent() + "; ";
|
String append = "Bitstream " + bs.getName() + " deleted on " + DCDate.getCurrent() + "; ";
|
||||||
Item item = bundles.iterator().next().getBundle().getItems().iterator().next();
|
Item item = bundles.iterator().next().getItems().iterator().next();
|
||||||
ItemUpdate.pr("Append provenance with: " + append);
|
ItemUpdate.pr("Append provenance with: " + append);
|
||||||
|
|
||||||
if (!isTest)
|
if (!isTest)
|
||||||
|
@@ -77,12 +77,11 @@ public class DeleteBitstreamsByFilterAction extends UpdateBitstreamsAction {
|
|||||||
|
|
||||||
for (Bundle b : bundles)
|
for (Bundle b : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bitstreams = b.getBitstreams();
|
List<Bitstream> bitstreams = b.getBitstreams();
|
||||||
String bundleName = b.getName();
|
String bundleName = b.getName();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bs : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
if (filter.accept(bs))
|
if (filter.accept(bs))
|
||||||
{
|
{
|
||||||
if (isTest)
|
if (isTest)
|
||||||
|
@@ -12,7 +12,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter all bitstreams in the ORIGINAL bundle
|
* Filter all bitstreams in the ORIGINAL bundle
|
||||||
@@ -39,10 +38,9 @@ public class OriginalBitstreamFilter extends BitstreamFilterByBundleName
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
Bundle bundle = bundleBitstream.getBundle();
|
|
||||||
if (bundle.getName().equals("ORIGINAL"))
|
if (bundle.getName().equals("ORIGINAL"))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@@ -12,7 +12,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter all bitstreams in the ORIGINAL bundle
|
* Filter all bitstreams in the ORIGINAL bundle
|
||||||
@@ -41,10 +40,9 @@ public class OriginalWithDerivativesBitstreamFilter extends BitstreamFilter
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundles)
|
for (Bundle b : bundles)
|
||||||
{
|
{
|
||||||
Bitstream b = bundleBitstream.getBitstream();
|
|
||||||
for (String bn : bundlesToEmpty)
|
for (String bn : bundlesToEmpty)
|
||||||
{
|
{
|
||||||
if (b.getName().equals(bn))
|
if (b.getName().equals(bn))
|
||||||
|
@@ -18,7 +18,6 @@ import javax.imageio.ImageIO;
|
|||||||
|
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
@@ -157,8 +156,7 @@ public abstract class ImageMagickThumbnailFilter extends MediaFilter implements
|
|||||||
{
|
{
|
||||||
String nsrc = source.getName();
|
String nsrc = source.getName();
|
||||||
for(Bundle b: itemService.getBundles(item, "THUMBNAIL")) {
|
for(Bundle b: itemService.getBundles(item, "THUMBNAIL")) {
|
||||||
for(BundleBitstream bundleBitstream: b.getBitstreams()) {
|
for(Bitstream bit: b.getBitstreams()) {
|
||||||
Bitstream bit = bundleBitstream.getBitstream();
|
|
||||||
String n = bit.getName();
|
String n = bit.getName();
|
||||||
if (n != null) {
|
if (n != null) {
|
||||||
if (nsrc != null) {
|
if (nsrc != null) {
|
||||||
|
@@ -168,10 +168,10 @@ public class MediaFilterServiceImpl implements MediaFilterService, InitializingB
|
|||||||
boolean done = false;
|
boolean done = false;
|
||||||
for (Bundle myBundle : myBundles) {
|
for (Bundle myBundle : myBundles) {
|
||||||
// now look at all of the bitstreams
|
// now look at all of the bitstreams
|
||||||
List<BundleBitstream> myBitstreams = myBundle.getBitstreams();
|
List<Bitstream> myBitstreams = myBundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream myBitstream : myBitstreams) {
|
for (Bitstream myBitstream : myBitstreams) {
|
||||||
done |= filterBitstream(context, myItem, myBitstream.getBitstream());
|
done |= filterBitstream(context, myItem, myBitstream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -215,7 +215,7 @@ public class MediaFilterServiceImpl implements MediaFilterService, InitializingB
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String handle = myItem.getHandle();
|
String handle = myItem.getHandle();
|
||||||
List<BundleBitstream> bundles = myBitstream.getBundles();
|
List<Bundle> bundles = myBitstream.getBundles();
|
||||||
long size = myBitstream.getSize();
|
long size = myBitstream.getSize();
|
||||||
String checksum = myBitstream.getChecksum() + " (" + myBitstream.getChecksumAlgorithm() + ")";
|
String checksum = myBitstream.getChecksum() + " (" + myBitstream.getChecksumAlgorithm() + ")";
|
||||||
int assetstore = myBitstream.getStoreNumber();
|
int assetstore = myBitstream.getStoreNumber();
|
||||||
@@ -223,8 +223,8 @@ public class MediaFilterServiceImpl implements MediaFilterService, InitializingB
|
|||||||
// Printout helpful information to find the errored bitstream.
|
// Printout helpful information to find the errored bitstream.
|
||||||
System.out.println("ERROR filtering, skipping bitstream:\n");
|
System.out.println("ERROR filtering, skipping bitstream:\n");
|
||||||
System.out.println("\tItem Handle: " + handle);
|
System.out.println("\tItem Handle: " + handle);
|
||||||
for (BundleBitstream bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
System.out.println("\tBundle Name: " + bundle.getBundle().getName());
|
System.out.println("\tBundle Name: " + bundle.getName());
|
||||||
}
|
}
|
||||||
System.out.println("\tFile Size: " + size);
|
System.out.println("\tFile Size: " + size);
|
||||||
System.out.println("\tChecksum: " + checksum);
|
System.out.println("\tChecksum: " + checksum);
|
||||||
@@ -318,12 +318,12 @@ public class MediaFilterServiceImpl implements MediaFilterService, InitializingB
|
|||||||
{
|
{
|
||||||
// only finds the last match (FIXME?)
|
// only finds the last match (FIXME?)
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
if (bundleBitstream.getBitstream().getName().equals(newName)) {
|
if (bitstream.getName().equals(newName)) {
|
||||||
targetBundle = bundle;
|
targetBundle = bundle;
|
||||||
existingBitstream = bundleBitstream.getBitstream();
|
existingBitstream = bitstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,8 +52,8 @@ public class AuthorizeUtil
|
|||||||
public static void authorizeManageBitstreamPolicy(Context context,
|
public static void authorizeManageBitstreamPolicy(Context context,
|
||||||
Bitstream bitstream) throws AuthorizeException, SQLException
|
Bitstream bitstream) throws AuthorizeException, SQLException
|
||||||
{
|
{
|
||||||
BundleBitstream bundleBitstream = bitstream.getBundles().get(0);
|
Bundle bundle = bitstream.getBundles().get(0);
|
||||||
authorizeManageBundlePolicy(context, bundleBitstream.getBundle());
|
authorizeManageBundlePolicy(context, bundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1055,9 +1055,8 @@ public class GoogleMetadata
|
|||||||
int bitstreamCount = 0;
|
int bitstreamCount = 0;
|
||||||
List<Bundle> contentBundles = itemService.getBundles(item, "ORIGINAL");
|
List<Bundle> contentBundles = itemService.getBundles(item, "ORIGINAL");
|
||||||
for (Bundle bundle : contentBundles) {
|
for (Bundle bundle : contentBundles) {
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream candidate : bitstreams) {
|
||||||
Bitstream candidate = bundleBitstream.getBitstream();
|
|
||||||
if (candidate.equals(bundle.getPrimaryBitstream())) { // is primary -> use this one
|
if (candidate.equals(bundle.getPrimaryBitstream())) { // is primary -> use this one
|
||||||
if (isPublic(candidate)) {
|
if (isPublic(candidate)) {
|
||||||
return candidate;
|
return candidate;
|
||||||
|
@@ -371,9 +371,8 @@ public class SyndicationFeed
|
|||||||
try {
|
try {
|
||||||
List<Bundle> bunds = itemService.getBundles(item, "ORIGINAL");
|
List<Bundle> bunds = itemService.getBundles(item, "ORIGINAL");
|
||||||
if (bunds.get(0) != null) {
|
if (bunds.get(0) != null) {
|
||||||
List<BundleBitstream> bits = bunds.get(0).getBitstreams();
|
List<Bitstream> bits = bunds.get(0).getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bits) {
|
for (Bitstream bit : bits) {
|
||||||
Bitstream bit = bundleBitstream.getBitstream();
|
|
||||||
String mime = bit.getFormat(context).getMIMEType();
|
String mime = bit.getFormat(context).getMIMEType();
|
||||||
if (podcastableMIMETypes.contains(mime)) {
|
if (podcastableMIMETypes.contains(mime)) {
|
||||||
SyndEnclosure enc = new SyndEnclosureImpl();
|
SyndEnclosure enc = new SyndEnclosureImpl();
|
||||||
|
@@ -282,7 +282,7 @@ public class AuthorizeServiceImpl implements AuthorizeService
|
|||||||
}
|
}
|
||||||
if (o instanceof Bundle)
|
if (o instanceof Bundle)
|
||||||
{
|
{
|
||||||
ignoreCustomPolicies = !isAnyItemInstalled(c, ((Bundle) o).getBitstreams());
|
ignoreCustomPolicies = !isAnyItemInstalled(c, Arrays.asList(((Bundle) o)));
|
||||||
}
|
}
|
||||||
if (o instanceof Item)
|
if (o instanceof Item)
|
||||||
{
|
{
|
||||||
@@ -327,12 +327,12 @@ public class AuthorizeServiceImpl implements AuthorizeService
|
|||||||
|
|
||||||
// check whether any bundle belongs to any item that passed submission
|
// check whether any bundle belongs to any item that passed submission
|
||||||
// and workflow process
|
// and workflow process
|
||||||
protected boolean isAnyItemInstalled(Context ctx, List<BundleBitstream> bundles)
|
protected boolean isAnyItemInstalled(Context ctx, List<Bundle> bundles)
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
for (BundleBitstream bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
for (Item item : bundle.getBundle().getItems())
|
for (Item item : bundle.getItems())
|
||||||
{
|
{
|
||||||
if (workspaceItemService.findByItem(ctx, item) == null
|
if (workspaceItemService.findByItem(ctx, item) == null
|
||||||
&& workflowItemService.findByItem(ctx, item) == null)
|
&& workflowItemService.findByItem(ctx, item) == null)
|
||||||
|
@@ -317,10 +317,9 @@ public class PolicySet
|
|||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
System.out.println("Bundle " + bundle.getID());
|
System.out.println("Bundle " + bundle.getID());
|
||||||
|
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (filter == null ||
|
if (filter == null ||
|
||||||
bitstream.getName().indexOf(filter) != -1) {
|
bitstream.getName().indexOf(filter) != -1) {
|
||||||
// is this a replace? delete policies first
|
// is this a replace? delete policies first
|
||||||
|
@@ -61,9 +61,8 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
|
|||||||
@JoinColumn(name = "bitstream_format_id")
|
@JoinColumn(name = "bitstream_format_id")
|
||||||
private BitstreamFormat bitstreamFormat;
|
private BitstreamFormat bitstreamFormat;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "bitstream", fetch = FetchType.LAZY)
|
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "bitstreams")
|
||||||
@OrderBy("bitstreamOrder asc")
|
private List<Bundle> bundles = new ArrayList<>();
|
||||||
private List<BundleBitstream> bundles = new ArrayList<>();
|
|
||||||
|
|
||||||
@OneToOne(fetch = FetchType.LAZY, mappedBy="logo")
|
@OneToOne(fetch = FetchType.LAZY, mappedBy="logo")
|
||||||
private Community community;
|
private Community community;
|
||||||
@@ -278,12 +277,12 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
|
|||||||
* @return array of <code>Bundle</code> s this bitstream appears in
|
* @return array of <code>Bundle</code> s this bitstream appears in
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
public List<BundleBitstream> getBundles() throws SQLException
|
public List<Bundle> getBundles() throws SQLException
|
||||||
{
|
{
|
||||||
return bundles;
|
return bundles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setBundles(List<BundleBitstream> bundles) {
|
void setBundles(List<Bundle> bundles) {
|
||||||
this.bundles = bundles;
|
this.bundles = bundles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,6 @@ import org.apache.log4j.Logger;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
import org.dspace.content.dao.BitstreamDAO;
|
import org.dspace.content.dao.BitstreamDAO;
|
||||||
import org.dspace.content.dao.BundleBitstreamDAO;
|
|
||||||
import org.dspace.content.service.BitstreamFormatService;
|
import org.dspace.content.service.BitstreamFormatService;
|
||||||
import org.dspace.content.service.BitstreamService;
|
import org.dspace.content.service.BitstreamService;
|
||||||
import org.dspace.content.service.BundleService;
|
import org.dspace.content.service.BundleService;
|
||||||
@@ -48,8 +47,6 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
protected BitstreamDAO bitstreamDAO;
|
protected BitstreamDAO bitstreamDAO;
|
||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
protected BundleBitstreamDAO bundleBitstreamDAO;
|
|
||||||
@Autowired(required = true)
|
|
||||||
protected ItemService itemService;
|
protected ItemService itemService;
|
||||||
|
|
||||||
|
|
||||||
@@ -246,16 +243,7 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
context.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, bitstream.getID(),
|
context.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, bitstream.getID(),
|
||||||
String.valueOf(bitstream.getSequenceID()), getIdentifiers(context, bitstream)));
|
String.valueOf(bitstream.getSequenceID()), getIdentifiers(context, bitstream)));
|
||||||
|
|
||||||
Iterator<BundleBitstream> bundleBits = bitstream.getBundles().iterator();
|
bitstream.getBundles().clear();
|
||||||
while(bundleBits.hasNext())
|
|
||||||
{
|
|
||||||
BundleBitstream bundleBitstream = bundleBits.next();
|
|
||||||
if(bundleBitstream.getBitstream().getID().equals(bitstream.getID()))
|
|
||||||
{
|
|
||||||
bundleBits.remove();
|
|
||||||
bundleBitstreamDAO.delete(context, bundleBitstream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Remove policies
|
// Remove policies
|
||||||
@@ -288,11 +276,11 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DSpaceObject getParentObject(Context context, Bitstream bitstream) throws SQLException {
|
public DSpaceObject getParentObject(Context context, Bitstream bitstream) throws SQLException {
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
if (CollectionUtils.isNotEmpty(bundles))
|
if (CollectionUtils.isNotEmpty(bundles))
|
||||||
{
|
{
|
||||||
// the ADMIN action is not allowed on Bundle object so skip to the item
|
// the ADMIN action is not allowed on Bundle object so skip to the item
|
||||||
Item item = (Item) bundleService.getParentObject(context, bundles.iterator().next().getBundle());
|
Item item = (Item) bundleService.getParentObject(context, bundles.iterator().next());
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
return item;
|
return item;
|
||||||
@@ -367,12 +355,12 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
List<Bundle> bundles = itemService.getBundles(item, bundleName);
|
List<Bundle> bundles = itemService.getBundles(item, bundleName);
|
||||||
for (int i = 0; i < bundles.size(); i++) {
|
for (int i = 0; i < bundles.size(); i++) {
|
||||||
Bundle bundle = bundles.get(i);
|
Bundle bundle = bundles.get(i);
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (int j = 0; j < bitstreams.size(); j++) {
|
for (int j = 0; j < bitstreams.size(); j++) {
|
||||||
BundleBitstream bundleBitstream = bitstreams.get(j);
|
Bitstream bitstream = bitstreams.get(j);
|
||||||
if(StringUtils.equals(bundleBitstream.getBitstream().getName(), bitstreamName))
|
if(StringUtils.equals(bitstream.getName(), bitstreamName))
|
||||||
{
|
{
|
||||||
return bundleBitstream.getBitstream();
|
return bitstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -384,10 +372,10 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
List<Bundle> bundles = itemService.getBundles(item, bundleName);
|
List<Bundle> bundles = itemService.getBundles(item, bundleName);
|
||||||
if(CollectionUtils.isNotEmpty(bundles))
|
if(CollectionUtils.isNotEmpty(bundles))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bitstreams = bundles.get(0).getBitstreams();
|
List<Bitstream> bitstreams = bundles.get(0).getBitstreams();
|
||||||
if(CollectionUtils.isNotEmpty(bitstreams))
|
if(CollectionUtils.isNotEmpty(bitstreams))
|
||||||
{
|
{
|
||||||
return bitstreams.get(0).getBitstream();
|
return bitstreams.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@@ -40,9 +40,14 @@ public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport
|
|||||||
@JoinColumn(name = "primary_bitstream_id")
|
@JoinColumn(name = "primary_bitstream_id")
|
||||||
private Bitstream primaryBitstream;
|
private Bitstream primaryBitstream;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY)
|
@ManyToMany(fetch = FetchType.LAZY)
|
||||||
@OrderBy("bitstreamOrder asc")
|
@JoinTable(
|
||||||
private List<BundleBitstream> bitstreams = new ArrayList<>();
|
name="bundle2bitstream",
|
||||||
|
joinColumns={@JoinColumn(name="bundle_id") },
|
||||||
|
inverseJoinColumns={@JoinColumn(name="bitstream_id") }
|
||||||
|
)
|
||||||
|
@OrderColumn(name="bitstream_order")
|
||||||
|
private List<Bitstream> bitstreams = new ArrayList<>();
|
||||||
|
|
||||||
@ManyToMany(fetch = FetchType.LAZY)
|
@ManyToMany(fetch = FetchType.LAZY)
|
||||||
@JoinTable(
|
@JoinTable(
|
||||||
@@ -122,11 +127,11 @@ public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport
|
|||||||
*
|
*
|
||||||
* @return the bitstreams
|
* @return the bitstreams
|
||||||
*/
|
*/
|
||||||
public List<BundleBitstream> getBitstreams() {
|
public List<Bitstream> getBitstreams() {
|
||||||
return bitstreams;
|
return bitstreams;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addBitstream(BundleBitstream bitstream){
|
void addBitstream(Bitstream bitstream){
|
||||||
bitstreams.add(bitstream);
|
bitstreams.add(bitstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,87 +0,0 @@
|
|||||||
/**
|
|
||||||
* The contents of this file are subject to the license and copyright
|
|
||||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
|
||||||
* tree and available online at
|
|
||||||
*
|
|
||||||
* http://www.dspace.org/license/
|
|
||||||
*/
|
|
||||||
package org.dspace.content;
|
|
||||||
|
|
||||||
import org.hibernate.proxy.HibernateProxyHelper;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Database entity representation of the bundle2bitstream table
|
|
||||||
*
|
|
||||||
* @author kevinvandevelde at atmire.com
|
|
||||||
*/
|
|
||||||
@Entity
|
|
||||||
@Table(name="bundle2bitstream")
|
|
||||||
public class BundleBitstream implements Serializable {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@ManyToOne
|
|
||||||
@JoinColumn(name="bundle_id", nullable = false, referencedColumnName = "uuid")
|
|
||||||
private Bundle bundle;
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@ManyToOne
|
|
||||||
@JoinColumn(name="bitstream_id", nullable = false, referencedColumnName = "uuid")
|
|
||||||
private Bitstream bitstream;
|
|
||||||
|
|
||||||
|
|
||||||
@Column(name="bitstream_order")
|
|
||||||
private int bitstreamOrder = -1;
|
|
||||||
|
|
||||||
protected BundleBitstream() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (obj == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj);
|
|
||||||
if (getClass() != objClass)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final BundleBitstream other = (BundleBitstream) obj;
|
|
||||||
if(!other.getBundle().equals(bundle))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(!other.getBitstream().equals(bitstream))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Bundle getBundle() {
|
|
||||||
return bundle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Bitstream getBitstream() {
|
|
||||||
return bitstream;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBitstreamOrder() {
|
|
||||||
return bitstreamOrder;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBundle(Bundle bundle) {
|
|
||||||
this.bundle = bundle;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBitstream(Bitstream bitstream) {
|
|
||||||
this.bitstream = bitstream;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setBitstreamOrder(int bitstreamOrder) {
|
|
||||||
this.bitstreamOrder = bitstreamOrder;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -15,7 +15,6 @@ import org.dspace.authorize.AuthorizeException;
|
|||||||
import org.dspace.authorize.ResourcePolicy;
|
import org.dspace.authorize.ResourcePolicy;
|
||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
import org.dspace.authorize.service.ResourcePolicyService;
|
import org.dspace.authorize.service.ResourcePolicyService;
|
||||||
import org.dspace.content.dao.BundleBitstreamDAO;
|
|
||||||
import org.dspace.content.dao.BundleDAO;
|
import org.dspace.content.dao.BundleDAO;
|
||||||
import org.dspace.content.service.BitstreamService;
|
import org.dspace.content.service.BitstreamService;
|
||||||
import org.dspace.content.service.BundleService;
|
import org.dspace.content.service.BundleService;
|
||||||
@@ -44,9 +43,6 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
|
|
||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
protected BundleDAO bundleDAO;
|
protected BundleDAO bundleDAO;
|
||||||
@Autowired(required = true)
|
|
||||||
protected BundleBitstreamDAO bundleBitstreamDAO;
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
protected BitstreamService bitstreamService;
|
protected BitstreamService bitstreamService;
|
||||||
@@ -118,8 +114,7 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
public Bitstream getBitstreamByName(Bundle bundle, String name) {
|
public Bitstream getBitstreamByName(Bundle bundle, String name) {
|
||||||
Bitstream target = null;
|
Bitstream target = null;
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundle.getBitstreams()) {
|
for (Bitstream bitstream : bundle.getBitstreams()) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (name.equals(bitstream.getName())) {
|
if (name.equals(bitstream.getName())) {
|
||||||
target = bitstream;
|
target = bitstream;
|
||||||
break;
|
break;
|
||||||
@@ -138,28 +133,18 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
+ bundle.getID() + ",bitstream_id=" + bitstream.getID()));
|
+ bundle.getID() + ",bitstream_id=" + bitstream.getID()));
|
||||||
|
|
||||||
// First check that the bitstream isn't already in the list
|
// First check that the bitstream isn't already in the list
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
int topOrder = 0;
|
int topOrder = 0;
|
||||||
// First check that the bitstream isn't already in the list
|
// First check that the bitstream isn't already in the list
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream bs : bitstreams) {
|
||||||
if (bitstream.getID().equals(bundleBitstream.getBitstream().getID())) {
|
if (bitstream.getID().equals(bs.getID())) {
|
||||||
// Bitstream is already there; no change
|
// Bitstream is already there; no change
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//The last file we encounter will have the highest order
|
|
||||||
topOrder = bundleBitstream.getBitstreamOrder();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the bitstream object
|
bundle.addBitstream(bitstream);
|
||||||
BundleBitstream bundleBitstream = new BundleBitstream();
|
bitstream.getBundles().add(bundle);
|
||||||
bundleBitstream.setBitstream(bitstream);
|
|
||||||
bundleBitstream.setBundle(bundle);
|
|
||||||
|
|
||||||
bundleBitstream = bundleBitstreamDAO.create(context, bundleBitstream);
|
|
||||||
bundleBitstream.setBitstreamOrder(topOrder++);
|
|
||||||
bundleBitstreamDAO.save(context, bundleBitstream);
|
|
||||||
bundle.addBitstream(bundleBitstream);
|
|
||||||
bitstream.getBundles().add(bundleBitstream);
|
|
||||||
|
|
||||||
|
|
||||||
context.addEvent(new Event(Event.ADD, Constants.BUNDLE, bundle.getID(),
|
context.addEvent(new Event(Event.ADD, Constants.BUNDLE, bundle.getID(),
|
||||||
@@ -180,21 +165,8 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
log.info(LogManager.getHeader(context, "remove_bitstream",
|
log.info(LogManager.getHeader(context, "remove_bitstream",
|
||||||
"bundle_id=" + bundle.getID() + ",bitstream_id=" + bitstream.getID()));
|
"bundle_id=" + bundle.getID() + ",bitstream_id=" + bitstream.getID()));
|
||||||
|
|
||||||
// Remove from internal list of bitstreams
|
bundle.getBitstreams().remove(bitstream);
|
||||||
Iterator<BundleBitstream> li = bundle.getBitstreams().iterator();
|
bitstream.getBundles().remove(bundle);
|
||||||
while (li.hasNext())
|
|
||||||
{
|
|
||||||
BundleBitstream bundleBitstream = li.next();
|
|
||||||
|
|
||||||
if (bitstream.getID().equals(bundleBitstream.getBitstream().getID()))
|
|
||||||
{
|
|
||||||
// We've found the bitstream to remove
|
|
||||||
li.remove();
|
|
||||||
bitstream.getBundles().remove(bundleBitstream);
|
|
||||||
bundle.getBitstreams().remove(bundleBitstream);
|
|
||||||
bundleBitstreamDAO.delete(context, bundleBitstream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
context.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, bundle.getID(),
|
context.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, bundle.getID(),
|
||||||
Constants.BITSTREAM, bitstream.getID(), String.valueOf(bitstream.getSequenceID()),
|
Constants.BITSTREAM, bitstream.getID(), String.valueOf(bitstream.getSequenceID()),
|
||||||
@@ -247,12 +219,11 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void replaceAllBitstreamPolicies(Context context, Bundle bundle, List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException {
|
public void replaceAllBitstreamPolicies(Context context, Bundle bundle, List<ResourcePolicy> newpolicies) throws SQLException, AuthorizeException {
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
if (CollectionUtils.isNotEmpty(bundleBitstreams))
|
if (CollectionUtils.isNotEmpty(bitstreams))
|
||||||
{
|
{
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bs : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
// change bitstream policies
|
// change bitstream policies
|
||||||
authorizeService.removeAllPolicies(context, bs);
|
authorizeService.removeAllPolicies(context, bs);
|
||||||
authorizeService.addPolicies(context, newpolicies, bs);
|
authorizeService.addPolicies(context, newpolicies, bs);
|
||||||
@@ -266,12 +237,12 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
@Override
|
@Override
|
||||||
public List<ResourcePolicy> getBitstreamPolicies(Context context, Bundle bundle) throws SQLException {
|
public List<ResourcePolicy> getBitstreamPolicies(Context context, Bundle bundle) throws SQLException {
|
||||||
List<ResourcePolicy> list = new ArrayList<ResourcePolicy>();
|
List<ResourcePolicy> list = new ArrayList<ResourcePolicy>();
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
if (CollectionUtils.isNotEmpty(bitstreams))
|
if (CollectionUtils.isNotEmpty(bitstreams))
|
||||||
{
|
{
|
||||||
for (BundleBitstream bs : bitstreams)
|
for (Bitstream bs : bitstreams)
|
||||||
{
|
{
|
||||||
list.addAll(authorizeService.getPolicies(context, bs.getBitstream()));
|
list.addAll(authorizeService.getPolicies(context, bs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
@@ -286,6 +257,7 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
public void setOrder(Context context, Bundle bundle, UUID[] bitstreamIds) throws AuthorizeException, SQLException {
|
public void setOrder(Context context, Bundle bundle, UUID[] bitstreamIds) throws AuthorizeException, SQLException {
|
||||||
authorizeService.authorizeAction(context, bundle, Constants.WRITE);
|
authorizeService.authorizeAction(context, bundle, Constants.WRITE);
|
||||||
|
|
||||||
|
bundle.getBitstreams().clear();
|
||||||
for (int i = 0; i < bitstreamIds.length; i++) {
|
for (int i = 0; i < bitstreamIds.length; i++) {
|
||||||
UUID bitstreamId = bitstreamIds[i];
|
UUID bitstreamId = bitstreamIds[i];
|
||||||
Bitstream bitstream = bitstreamService.find(context, bitstreamId);
|
Bitstream bitstream = bitstreamService.find(context, bitstreamId);
|
||||||
@@ -294,13 +266,10 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
log.warn(LogManager.getHeader(context, "Invalid bitstream id while changing bitstream order", "Bundle: " + bundle.getID() + ", bitstream id: " + bitstreamId));
|
log.warn(LogManager.getHeader(context, "Invalid bitstream id while changing bitstream order", "Bundle: " + bundle.getID() + ", bitstream id: " + bitstreamId));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
bitstream.getBundles().remove(bundle);
|
||||||
|
bundle.getBitstreams().add(bitstream);
|
||||||
|
bitstream.getBundles().add(bundle);
|
||||||
|
|
||||||
List<BundleBitstream> bitstreamBundles = bitstream.getBundles();
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreamBundles) {
|
|
||||||
bundleBitstream.setBitstreamOrder(i);
|
|
||||||
bundleBitstreamDAO.save(context, bundleBitstream);
|
|
||||||
|
|
||||||
}
|
|
||||||
bitstreamService.update(context, bitstream);
|
bitstreamService.update(context, bitstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,12 +384,11 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
|||||||
bundle.getName(), getIdentifiers(context, bundle)));
|
bundle.getName(), getIdentifiers(context, bundle)));
|
||||||
|
|
||||||
// Remove bitstreams
|
// Remove bitstreams
|
||||||
Iterator<BundleBitstream> bundleBitstreams = bundle.getBitstreams().iterator();
|
Iterator<Bitstream> bitstreams = bundle.getBitstreams().iterator();
|
||||||
while (bundleBitstreams.hasNext()) {
|
while (bitstreams.hasNext()) {
|
||||||
BundleBitstream bundleBitstream = bundleBitstreams.next();
|
Bitstream bitstream = bitstreams.next();
|
||||||
bundleBitstreams.remove();
|
bitstreams.remove();
|
||||||
removeBitstream(context, bundle, bundleBitstream.getBitstream());
|
removeBitstream(context, bundle, bitstream);
|
||||||
bundleBitstreamDAO.delete(context, bundleBitstream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<Item> items = bundle.getItems().iterator();
|
Iterator<Item> items = bundle.getItems().iterator();
|
||||||
|
@@ -330,10 +330,9 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
List<Bundle> bunds = item.getBundles();
|
List<Bundle> bunds = item.getBundles();
|
||||||
|
|
||||||
for (Bundle bund : bunds) {
|
for (Bundle bund : bunds) {
|
||||||
List<BundleBitstream> bitstreams = bund.getBitstreams();
|
List<Bitstream> bitstreams = bund.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (!bitstream.getFormat(context).isInternal()) {
|
if (!bitstream.getFormat(context).isInternal()) {
|
||||||
// Bitstream is not of an internal format
|
// Bitstream is not of an internal format
|
||||||
bitstreamList.add(bitstream);
|
bitstreamList.add(bitstream);
|
||||||
@@ -389,10 +388,10 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
for (Bundle bund : bunds) {
|
for (Bundle bund : bunds) {
|
||||||
boolean removethisbundle = false;
|
boolean removethisbundle = false;
|
||||||
|
|
||||||
List<BundleBitstream> bits = bund.getBitstreams();
|
List<Bitstream> bits = bund.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bit : bits) {
|
for (Bitstream bit : bits) {
|
||||||
BitstreamFormat bft = bit.getBitstream().getFormat(context);
|
BitstreamFormat bft = bit.getFormat(context);
|
||||||
|
|
||||||
if (bft.getID() == licensetype) {
|
if (bft.getID() == licensetype) {
|
||||||
removethisbundle = true;
|
removethisbundle = true;
|
||||||
@@ -426,10 +425,9 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
|
|
||||||
// find the highest current sequence number
|
// find the highest current sequence number
|
||||||
for (Bundle bund : bunds) {
|
for (Bundle bund : bunds) {
|
||||||
List<BundleBitstream> streams = bund.getBitstreams();
|
List<Bitstream> streams = bund.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : streams) {
|
for (Bitstream bitstream : streams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (bitstream.getSequenceID() > sequence) {
|
if (bitstream.getSequenceID() > sequence) {
|
||||||
sequence = bitstream.getSequenceID();
|
sequence = bitstream.getSequenceID();
|
||||||
}
|
}
|
||||||
@@ -441,10 +439,9 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
|
|
||||||
|
|
||||||
for (Bundle bund : bunds) {
|
for (Bundle bund : bunds) {
|
||||||
List<BundleBitstream> streams = bund.getBitstreams();
|
List<Bitstream> streams = bund.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : streams) {
|
for (Bitstream stream : streams) {
|
||||||
Bitstream stream = bundleBitstream.getBitstream();
|
|
||||||
if (stream.getSequenceID() < 0) {
|
if (stream.getSequenceID() < 0) {
|
||||||
stream.setSequenceID(sequence);
|
stream.setSequenceID(sequence);
|
||||||
sequence++;
|
sequence++;
|
||||||
@@ -687,10 +684,9 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
List<Bundle> bunds = item.getBundles();
|
List<Bundle> bunds = item.getBundles();
|
||||||
|
|
||||||
for (Bundle mybundle : bunds) {
|
for (Bundle mybundle : bunds) {
|
||||||
List<BundleBitstream> bs = mybundle.getBitstreams();
|
List<Bitstream> bs = mybundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream b : bs) {
|
for (Bitstream bitstream : bs) {
|
||||||
Bitstream bitstream = b.getBitstream();
|
|
||||||
// remove bitstream policies
|
// remove bitstream policies
|
||||||
authorizeService.removeGroupPolicies(context, bitstream, group);
|
authorizeService.removeGroupPolicies(context, bitstream, group);
|
||||||
}
|
}
|
||||||
@@ -731,9 +727,8 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
List<ResourcePolicy> policiesBundleToAdd = filterPoliciesToAdd(context, defaultCollectionPolicies, mybundle);
|
List<ResourcePolicy> policiesBundleToAdd = filterPoliciesToAdd(context, defaultCollectionPolicies, mybundle);
|
||||||
authorizeService.addPolicies(context, policiesBundleToAdd, mybundle);
|
authorizeService.addPolicies(context, policiesBundleToAdd, mybundle);
|
||||||
|
|
||||||
for(BundleBitstream bundleBitstream : mybundle.getBitstreams())
|
for(Bitstream bitstream : mybundle.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
// if come from InstallItem: remove all submission/workflow policies
|
// if come from InstallItem: remove all submission/workflow policies
|
||||||
authorizeService.removeAllPoliciesByDSOAndType(context, bitstream, ResourcePolicy.TYPE_SUBMISSION);
|
authorizeService.removeAllPoliciesByDSOAndType(context, bitstream, ResourcePolicy.TYPE_SUBMISSION);
|
||||||
authorizeService.removeAllPoliciesByDSOAndType(context, bitstream, ResourcePolicy.TYPE_WORKFLOW);
|
authorizeService.removeAllPoliciesByDSOAndType(context, bitstream, ResourcePolicy.TYPE_WORKFLOW);
|
||||||
|
@@ -216,7 +216,7 @@ public class OREDisseminationCrosswalk
|
|||||||
|
|
||||||
// Add a link and an oreatom metadata entry for each bitstream in the item
|
// Add a link and an oreatom metadata entry for each bitstream in the item
|
||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
List<BundleBitstream> bitstreams;
|
List<Bitstream> bitstreams;
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// Omit the special "ORE" bitstream
|
// Omit the special "ORE" bitstream
|
||||||
@@ -226,9 +226,8 @@ public class OREDisseminationCrosswalk
|
|||||||
}
|
}
|
||||||
|
|
||||||
bitstreams = bundle.getBitstreams();
|
bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bs : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
arLink = new Element("link",ATOM_NS);
|
arLink = new Element("link",ATOM_NS);
|
||||||
arLink.setAttribute("rel", ORE_NS.getURI()+"aggregates");
|
arLink.setAttribute("rel", ORE_NS.getURI()+"aggregates");
|
||||||
arLink.setAttribute("href",dsUrl + "/bitstream/handle/" + item.getHandle() + "/" + encodeForURL(bs.getName()) + "?sequence=" + bs.getSequenceID());
|
arLink.setAttribute("href",dsUrl + "/bitstream/handle/" + item.getHandle() + "/" + encodeForURL(bs.getName()) + "?sequence=" + bs.getSequenceID());
|
||||||
|
@@ -244,10 +244,10 @@ public class PREMISCrosswalk
|
|||||||
String baseUrl = ConfigurationManager.getProperty("dspace.url");
|
String baseUrl = ConfigurationManager.getProperty("dspace.url");
|
||||||
String handle = null;
|
String handle = null;
|
||||||
// get handle of parent Item of this bitstream, if there is one:
|
// get handle of parent Item of this bitstream, if there is one:
|
||||||
List<BundleBitstream> bn = bitstream.getBundles();
|
List<Bundle> bn = bitstream.getBundles();
|
||||||
if (bn.size() > 0)
|
if (bn.size() > 0)
|
||||||
{
|
{
|
||||||
List<Item> bi = bn.get(0).getBundle().getItems();
|
List<Item> bi = bn.get(0).getItems();
|
||||||
if (bi.size() > 0)
|
if (bi.size() > 0)
|
||||||
{
|
{
|
||||||
handle = bi.get(0).getHandle();
|
handle = bi.get(0).getHandle();
|
||||||
|
@@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* The contents of this file are subject to the license and copyright
|
|
||||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
|
||||||
* tree and available online at
|
|
||||||
*
|
|
||||||
* http://www.dspace.org/license/
|
|
||||||
*/
|
|
||||||
package org.dspace.content.dao;
|
|
||||||
|
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.core.GenericDAO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Database Access Object interface class for the BundleBitstream object.
|
|
||||||
* The implementation of this class is responsible for all database calls for the BundleBitstream object and is autowired by spring
|
|
||||||
* This class should only be accessed from a single service & should never be exposed outside of the API
|
|
||||||
*
|
|
||||||
* @author kevinvandevelde at atmire.com
|
|
||||||
*/
|
|
||||||
public interface BundleBitstreamDAO extends GenericDAO<BundleBitstream> {
|
|
||||||
}
|
|
@@ -1,23 +0,0 @@
|
|||||||
/**
|
|
||||||
* The contents of this file are subject to the license and copyright
|
|
||||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
|
||||||
* tree and available online at
|
|
||||||
*
|
|
||||||
* http://www.dspace.org/license/
|
|
||||||
*/
|
|
||||||
package org.dspace.content.dao.impl;
|
|
||||||
|
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.dao.BundleBitstreamDAO;
|
|
||||||
import org.dspace.core.AbstractHibernateDAO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hibernate implementation of the Database Access Object interface class for the BundleBitstream object.
|
|
||||||
* This class is responsible for all database calls for the BundleBitstream object and is autowired by spring
|
|
||||||
* This class should never be accessed directly.
|
|
||||||
*
|
|
||||||
* @author kevinvandevelde at atmire.com
|
|
||||||
*/
|
|
||||||
public class BundleBitstreamDAOImpl extends AbstractHibernateDAO<BundleBitstream> implements BundleBitstreamDAO {
|
|
||||||
|
|
||||||
}
|
|
@@ -438,9 +438,8 @@ public abstract class AbstractMETSDisseminator
|
|||||||
throw new AuthorizeException("Not authorized to read Bundle named \"" + bundle.getName() + "\"");
|
throw new AuthorizeException("Not authorized to read Bundle named \"" + bundle.getName() + "\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
boolean auth = authorizeService.authorizeActionBoolean(context,
|
boolean auth = authorizeService.authorizeActionBoolean(context,
|
||||||
bitstream, Constants.READ);
|
bitstream, Constants.READ);
|
||||||
if (auth ||
|
if (auth ||
|
||||||
@@ -885,7 +884,7 @@ public abstract class AbstractMETSDisseminator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
// Create a fileGrp, USE = permuted Bundle name
|
// Create a fileGrp, USE = permuted Bundle name
|
||||||
FileGrp fileGrp = new FileGrp();
|
FileGrp fileGrp = new FileGrp();
|
||||||
@@ -909,9 +908,8 @@ public abstract class AbstractMETSDisseminator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For each bitstream, add to METS manifest
|
// For each bitstream, add to METS manifest
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
// Check for authorization. Handle unauthorized
|
// Check for authorization. Handle unauthorized
|
||||||
// bitstreams to match the logic in disseminate(),
|
// bitstreams to match the logic in disseminate(),
|
||||||
// i.e. "unauth=zero" means include a 0-length bitstream,
|
// i.e. "unauth=zero" means include a 0-length bitstream,
|
||||||
@@ -1274,11 +1272,10 @@ public abstract class AbstractMETSDisseminator
|
|||||||
if ((bundle.getName() != null)
|
if ((bundle.getName() != null)
|
||||||
&& bundle.getName().equals("ORIGINAL")) {
|
&& bundle.getName().equals("ORIGINAL")) {
|
||||||
// Now find the corresponding bitstream
|
// Now find the corresponding bitstream
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (bitstream.getName().equals(originalFilename)) {
|
if (bitstream.getName().equals(originalFilename)) {
|
||||||
return bitstream;
|
return bitstream;
|
||||||
}
|
}
|
||||||
@@ -1487,10 +1484,10 @@ public abstract class AbstractMETSDisseminator
|
|||||||
{
|
{
|
||||||
// get handle of parent Item of this bitstream, if there is one:
|
// get handle of parent Item of this bitstream, if there is one:
|
||||||
String handle = null;
|
String handle = null;
|
||||||
List<BundleBitstream> bn = bitstream.getBundles();
|
List<Bundle> bn = bitstream.getBundles();
|
||||||
if (bn.size() > 0)
|
if (bn.size() > 0)
|
||||||
{
|
{
|
||||||
List<Item> bi = bn.get(0).getBundle().getItems();
|
List<Item> bi = bn.get(0).getItems();
|
||||||
if (bi.size() > 0)
|
if (bi.size() > 0)
|
||||||
{
|
{
|
||||||
handle = bi.get(0).getHandle();
|
handle = bi.get(0).getHandle();
|
||||||
|
@@ -222,11 +222,10 @@ public class PackageUtils
|
|||||||
}
|
}
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (bsName.equals(bitstream.getName())) {
|
if (bsName.equals(bitstream.getName())) {
|
||||||
return bitstream;
|
return bitstream;
|
||||||
}
|
}
|
||||||
@@ -259,10 +258,9 @@ public class PackageUtils
|
|||||||
bundles = itemService.getBundles(item, bnName);
|
bundles = itemService.getBundles(item, bnName);
|
||||||
}
|
}
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (bitstream.getFormat(context).getID() == fid) {
|
if (bitstream.getFormat(context).getID() == fid) {
|
||||||
return bitstream;
|
return bitstream;
|
||||||
}
|
}
|
||||||
@@ -401,12 +399,11 @@ public class PackageUtils
|
|||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// Assume license will be in its own bundle
|
// Assume license will be in its own bundle
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
// The License should have a file format of "License"
|
// The License should have a file format of "License"
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (bitstream.getFormat(context).getID() == licenseFormatId) {
|
if (bitstream.getFormat(context).getID() == licenseFormatId) {
|
||||||
//found a bitstream with format "License" -- return it
|
//found a bitstream with format "License" -- return it
|
||||||
return bitstream;
|
return bitstream;
|
||||||
@@ -416,8 +413,8 @@ public class PackageUtils
|
|||||||
// If we couldn't find a bitstream with format = "License",
|
// If we couldn't find a bitstream with format = "License",
|
||||||
// we will just assume the first bitstream is the deposit license
|
// we will just assume the first bitstream is the deposit license
|
||||||
// (usually a safe assumption as it is in the LICENSE bundle)
|
// (usually a safe assumption as it is in the LICENSE bundle)
|
||||||
if (bundleBitstreams.size() > 0) {
|
if (bitstreams.size() > 0) {
|
||||||
return bundleBitstreams.get(0).getBitstream();
|
return bitstreams.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,15 +57,15 @@ public class BitstreamsIntoMetadata extends AbstractCurationTask
|
|||||||
itemService.clearMetadata(Curator.curationContext(), item, "dc", "format", Item.ANY, Item.ANY);
|
itemService.clearMetadata(Curator.curationContext(), item, "dc", "format", Item.ANY, Item.ANY);
|
||||||
for (Bundle bundle : item.getBundles()) {
|
for (Bundle bundle : item.getBundles()) {
|
||||||
if ("ORIGINAL".equals(bundle.getName())) {
|
if ("ORIGINAL".equals(bundle.getName())) {
|
||||||
for (BundleBitstream bundleBitstream : bundle.getBitstreams()) {
|
for (Bitstream bitstream : bundle.getBitstreams()) {
|
||||||
// Add the metadata and update the item
|
// Add the metadata and update the item
|
||||||
addMetadata(item, bundleBitstream.getBitstream(), "original");
|
addMetadata(item, bitstream, "original");
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
} else if ("THUMBNAIL".equals(bundle.getName())) {
|
} else if ("THUMBNAIL".equals(bundle.getName())) {
|
||||||
for (BundleBitstream bundleBitstream : bundle.getBitstreams()) {
|
for (Bitstream bitstream : bundle.getBitstreams()) {
|
||||||
// Add the metadata and update the item
|
// Add the metadata and update the item
|
||||||
addMetadata(item, bundleBitstream.getBitstream(), "thumbnail");
|
addMetadata(item, bitstream, "thumbnail");
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -106,9 +106,8 @@ public class ClamScan extends AbstractCurationTask
|
|||||||
{
|
{
|
||||||
Bundle bundle = itemService.getBundles(item, "ORIGINAL").get(0);
|
Bundle bundle = itemService.getBundles(item, "ORIGINAL").get(0);
|
||||||
results = new ArrayList<String>();
|
results = new ArrayList<String>();
|
||||||
for (BundleBitstream bundleBitstream : bundle.getBitstreams())
|
for (Bitstream bitstream : bundle.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
InputStream inputstream = bitstreamService.retrieve(Curator.curationContext(), bitstream);
|
InputStream inputstream = bitstreamService.retrieve(Curator.curationContext(), bitstream);
|
||||||
logDebugMessage("Scanning " + bitstream.getName() + " . . . ");
|
logDebugMessage("Scanning " + bitstream.getName() + " . . . ");
|
||||||
int bstatus = scan(bitstream, inputstream, getItemHandle(item));
|
int bstatus = scan(bitstream, inputstream, getItemHandle(item));
|
||||||
|
@@ -52,9 +52,8 @@ public class ProfileFormats extends AbstractCurationTask
|
|||||||
{
|
{
|
||||||
for (Bundle bundle : item.getBundles())
|
for (Bundle bundle : item.getBundles())
|
||||||
{
|
{
|
||||||
for (BundleBitstream bundleBitstream : bundle.getBitstreams())
|
for (Bitstream bs : bundle.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
String fmt = bs.getFormat(Curator.curationContext()).getShortDescription();
|
String fmt = bs.getFormat(Curator.curationContext()).getShortDescription();
|
||||||
Integer count = fmtTable.get(fmt);
|
Integer count = fmtTable.get(fmt);
|
||||||
if (count == null)
|
if (count == null)
|
||||||
|
@@ -108,8 +108,7 @@ public class CitationPage extends AbstractCurationTask {
|
|||||||
//Create a map of the bitstreams in the displayBundle. This is used to
|
//Create a map of the bitstreams in the displayBundle. This is used to
|
||||||
//check if the bundle being cited is already in the display bundle.
|
//check if the bundle being cited is already in the display bundle.
|
||||||
Map<String,Bitstream> displayMap = new HashMap<String,Bitstream>();
|
Map<String,Bitstream> displayMap = new HashMap<String,Bitstream>();
|
||||||
for (BundleBitstream bundleBitstream : dBundle.getBitstreams()) {
|
for (Bitstream bs : dBundle.getBitstreams()) {
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
displayMap.put(bs.getName(), bs);
|
displayMap.put(bs.getName(), bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,12 +135,11 @@ public class CitationPage extends AbstractCurationTask {
|
|||||||
//Start looping through our bundles. Anything that is citable in these
|
//Start looping through our bundles. Anything that is citable in these
|
||||||
//bundles will be cited.
|
//bundles will be cited.
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
// Loop through each file and generate a cover page for documents
|
// Loop through each file and generate a cover page for documents
|
||||||
// that are PDFs.
|
// that are PDFs.
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
BitstreamFormat format = bitstream.getFormat(Curator.curationContext());
|
BitstreamFormat format = bitstream.getFormat(Curator.curationContext());
|
||||||
|
|
||||||
//If bitstream is a PDF document then it is citable.
|
//If bitstream is a PDF document then it is citable.
|
||||||
@@ -211,8 +209,8 @@ public class CitationPage extends AbstractCurationTask {
|
|||||||
if (bundle.getID() != pBundle.getID()) {
|
if (bundle.getID() != pBundle.getID()) {
|
||||||
bundleService.addBitstream(context, pBundle, bitstream);
|
bundleService.addBitstream(context, pBundle, bitstream);
|
||||||
bundleService.removeBitstream(context, bundle, bitstream);
|
bundleService.removeBitstream(context, bundle, bitstream);
|
||||||
List<BundleBitstream> originalBits = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
if (originalBits == null || originalBits.size() == 0) {
|
if (bitstreams == null || bitstreams.size() == 0) {
|
||||||
itemService.removeBundle(context, item, bundle);
|
itemService.removeBundle(context, item, bundle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1349,11 +1349,10 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
&& myBundle.getName().equals("TEXT"))
|
&& myBundle.getName().equals("TEXT"))
|
||||||
{
|
{
|
||||||
// a-ha! grab the text out of the bitstreams
|
// a-ha! grab the text out of the bitstreams
|
||||||
List<BundleBitstream> bundleBitstreams = myBundle.getBitstreams();
|
List<Bitstream> bitstreams = myBundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream myBitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream myBitstream = bundleBitstream.getBitstream();
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
streams.add(new BitstreamContentStream(context, myBitstream));
|
streams.add(new BitstreamContentStream(context, myBitstream));
|
||||||
|
@@ -99,9 +99,8 @@ public class DefaultEmbargoSetter implements EmbargoSetter
|
|||||||
{
|
{
|
||||||
//AuthorizeManager.removePoliciesActionFilter(context, bn, Constants.READ);
|
//AuthorizeManager.removePoliciesActionFilter(context, bn, Constants.READ);
|
||||||
generatePolicies(context, liftDate.toDate(), null, bn, item.getOwningCollection());
|
generatePolicies(context, liftDate.toDate(), null, bn, item.getOwningCollection());
|
||||||
for (BundleBitstream bundleBitstream : bn.getBitstreams())
|
for (Bitstream bs : bn.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
//AuthorizeManager.removePoliciesActionFilter(context, bs, Constants.READ);
|
//AuthorizeManager.removePoliciesActionFilter(context, bs, Constants.READ);
|
||||||
generatePolicies(context, liftDate.toDate(), null, bs, item.getOwningCollection());
|
generatePolicies(context, liftDate.toDate(), null, bs, item.getOwningCollection());
|
||||||
}
|
}
|
||||||
@@ -176,9 +175,8 @@ public class DefaultEmbargoSetter implements EmbargoSetter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bn.getBitstreams())
|
for (Bitstream bs : bn.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
for (ResourcePolicy rp : getAuthorizeService().getPoliciesActionFilter(context, bs, Constants.READ))
|
for (ResourcePolicy rp : getAuthorizeService().getPoliciesActionFilter(context, bs, Constants.READ))
|
||||||
{
|
{
|
||||||
System.out.println("CHECK WARNING: Item "+item.getHandle()+", Bitstream "+bs.getName()+" (in Bundle "+bn.getName()+") allows READ by "+
|
System.out.println("CHECK WARNING: Item "+item.getHandle()+", Bitstream "+bs.getName()+" (in Bundle "+bn.getName()+") allows READ by "+
|
||||||
|
@@ -112,10 +112,9 @@ public class RDFConsumer implements Consumer
|
|||||||
+ "and we'll cover it by a REMOVE event on its bundle.");
|
+ "and we'll cover it by a REMOVE event on its bundle.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<BundleBitstream> bundleBitstreams = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bundle b : bundles)
|
||||||
{
|
{
|
||||||
Bundle b = bundleBitstream.getBundle();
|
|
||||||
List<Item> items = b.getItems();
|
List<Item> items = b.getItems();
|
||||||
for (Item i : items)
|
for (Item i : items)
|
||||||
{
|
{
|
||||||
|
@@ -527,9 +527,8 @@ implements ConverterPlugin
|
|||||||
// be configurable).
|
// be configurable).
|
||||||
if (bundle.getName().equals("ORIGINAL"))
|
if (bundle.getName().equals("ORIGINAL"))
|
||||||
{
|
{
|
||||||
for (BundleBitstream bundleBitstream : bundle.getBitstreams())
|
for (Bitstream bs : bundle.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream bs = bundleBitstream.getBitstream();
|
|
||||||
if (RDFUtil.isPublicBoolean(context, bs))
|
if (RDFUtil.isPublicBoolean(context, bs))
|
||||||
{
|
{
|
||||||
String url = bitstreamURI(context, bs);
|
String url = bitstreamURI(context, bs);
|
||||||
|
@@ -1232,11 +1232,11 @@ public class DSIndexer
|
|||||||
if ((myBundle.getName() != null)
|
if ((myBundle.getName() != null)
|
||||||
&& myBundle.getName().equals("TEXT")) {
|
&& myBundle.getName().equals("TEXT")) {
|
||||||
// a-ha! grab the text out of the bitstreams
|
// a-ha! grab the text out of the bitstreams
|
||||||
List<BundleBitstream> bundleBitstreams = myBundle.getBitstreams();
|
List<Bitstream> bitstreams = myBundle.getBitstreams();
|
||||||
|
|
||||||
for (j = 0; j < bundleBitstreams.size(); j++)
|
for (j = 0; j < bitstreams.size(); j++)
|
||||||
try {
|
try {
|
||||||
Bitstream bitstream = bundleBitstreams.get(j).getBitstream();
|
Bitstream bitstream = bitstreams.get(j);
|
||||||
// Add each InputStream to the Indexed Document (Acts like an Append)
|
// Add each InputStream to the Indexed Document (Acts like an Append)
|
||||||
doc.add(new Field("default", new BufferedReader(new InputStreamReader(bitstreamService.retrieve(context, bitstream)))));
|
doc.add(new Field("default", new BufferedReader(new InputStreamReader(bitstreamService.retrieve(context, bitstream)))));
|
||||||
|
|
||||||
|
@@ -268,10 +268,10 @@ public class ElasticSearchLoggerServiceImpl implements ElasticSearchLoggerServic
|
|||||||
|
|
||||||
if (dspaceObject instanceof Bitstream) {
|
if (dspaceObject instanceof Bitstream) {
|
||||||
Bitstream bit = (Bitstream) dspaceObject;
|
Bitstream bit = (Bitstream) dspaceObject;
|
||||||
List<BundleBitstream> bundles = bit.getBundles();
|
List<Bundle> bundles = bit.getBundles();
|
||||||
docBuilder.field("bundleName").startArray();
|
docBuilder.field("bundleName").startArray();
|
||||||
for (BundleBitstream bundleBitstream : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
docBuilder.value(bundleBitstream.getBundle().getName());
|
docBuilder.value(bundle.getName());
|
||||||
}
|
}
|
||||||
docBuilder.endArray();
|
docBuilder.endArray();
|
||||||
}
|
}
|
||||||
@@ -386,10 +386,10 @@ public class ElasticSearchLoggerServiceImpl implements ElasticSearchLoggerServic
|
|||||||
|
|
||||||
if (dspaceObject instanceof Bitstream) {
|
if (dspaceObject instanceof Bitstream) {
|
||||||
Bitstream bit = (Bitstream) dspaceObject;
|
Bitstream bit = (Bitstream) dspaceObject;
|
||||||
List<BundleBitstream> bundles = bit.getBundles();
|
List<Bundle> bundles = bit.getBundles();
|
||||||
docBuilder.field("bundleName").startArray();
|
docBuilder.field("bundleName").startArray();
|
||||||
for (BundleBitstream bundleBitstream : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
docBuilder.value(bundleBitstream.getBundle().getName());
|
docBuilder.value(bundle.getName());
|
||||||
}
|
}
|
||||||
docBuilder.endArray();
|
docBuilder.endArray();
|
||||||
}
|
}
|
||||||
@@ -493,8 +493,8 @@ public class ElasticSearchLoggerServiceImpl implements ElasticSearchLoggerServic
|
|||||||
} else if (dso instanceof Bitstream) {
|
} else if (dso instanceof Bitstream) {
|
||||||
Bitstream bitstream = (Bitstream) dso;
|
Bitstream bitstream = (Bitstream) dso;
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstream.getBundles()) {
|
for (Bundle bundle : bitstream.getBundles()) {
|
||||||
for (Item item : bundleBitstream.getBundle().getItems()) {
|
for (Item item : bundle.getItems()) {
|
||||||
|
|
||||||
parents.get("owningItem").add(item.getID().toString());
|
parents.get("owningItem").add(item.getID().toString());
|
||||||
buildParents(item, parents);
|
buildParents(item, parents);
|
||||||
|
@@ -215,9 +215,9 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
if(dspaceObject instanceof Bitstream)
|
if(dspaceObject instanceof Bitstream)
|
||||||
{
|
{
|
||||||
Bitstream bit = (Bitstream) dspaceObject;
|
Bitstream bit = (Bitstream) dspaceObject;
|
||||||
List<BundleBitstream> bundleBitstreams = bit.getBundles();
|
List<Bundle> bundles = bit.getBundles();
|
||||||
for (BundleBitstream bundle : bundleBitstreams) {
|
for (Bundle bundle : bundles) {
|
||||||
doc1.addField("bundleName", bundle.getBundle().getName());
|
doc1.addField("bundleName", bundle.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,9 +253,9 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
return;
|
return;
|
||||||
if (dspaceObject instanceof Bitstream) {
|
if (dspaceObject instanceof Bitstream) {
|
||||||
Bitstream bit = (Bitstream) dspaceObject;
|
Bitstream bit = (Bitstream) dspaceObject;
|
||||||
List<BundleBitstream> bundles = bit.getBundles();
|
List<Bundle> bundles = bit.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
doc1.addField("bundleName", bundleBitstream.getBundle().getName());
|
doc1.addField("bundleName", bundle.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -600,9 +600,9 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
else if (dso instanceof Bitstream)
|
else if (dso instanceof Bitstream)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = (Bitstream) dso;
|
Bitstream bitstream = (Bitstream) dso;
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
List<Item> items = bundleBitstream.getBundle().getItems();
|
List<Item> items = bundle.getItems();
|
||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
doc1.addField("owningItem", item.getID());
|
doc1.addField("owningItem", item.getID());
|
||||||
storeParents(doc1, item);
|
storeParents(doc1, item);
|
||||||
@@ -1376,9 +1376,9 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea
|
|||||||
Bitstream bitstream = bitstreamService.findByIdOrLegacyId(context, bitstreamId);
|
Bitstream bitstream = bitstreamService.findByIdOrLegacyId(context, bitstreamId);
|
||||||
//Attempt to retrieve our bitstream !
|
//Attempt to retrieve our bitstream !
|
||||||
if (bitstream != null){
|
if (bitstream != null){
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
if(bundles != null && 0 < bundles.size()){
|
if(bundles != null && 0 < bundles.size()){
|
||||||
Bundle bundle = bundles.get(0).getBundle();
|
Bundle bundle = bundles.get(0);
|
||||||
bundleName = bundle.getName();
|
bundleName = bundle.getName();
|
||||||
}else{
|
}else{
|
||||||
//No bundle found, we are either a collection or a community logo, check for it !
|
//No bundle found, we are either a collection or a community logo, check for it !
|
||||||
|
@@ -407,7 +407,7 @@ public class StatisticsDataVisits extends StatisticsData
|
|||||||
for (int j = 0; j < item.getBundles().size(); j++) {
|
for (int j = 0; j < item.getBundles().size(); j++) {
|
||||||
Bundle bundle = item.getBundles().get(j);
|
Bundle bundle = item.getBundles().get(j);
|
||||||
for (int k = 0; k < bundle.getBitstreams().size(); k++) {
|
for (int k = 0; k < bundle.getBitstreams().size(); k++) {
|
||||||
Bitstream bitstream = bundle.getBitstreams().get(k).getBitstream();
|
Bitstream bitstream = bundle.getBitstreams().get(k);
|
||||||
if(!bitstream.getFormat(context).isInternal()){
|
if(!bitstream.getFormat(context).isInternal()){
|
||||||
// Add a separate query for each bitstream
|
// Add a separate query for each bitstream
|
||||||
query.setDso(bitstream, bitstream.getType(), dsoLength);
|
query.setDso(bitstream, bitstream.getType(), dsoLength);
|
||||||
@@ -607,10 +607,10 @@ public class StatisticsDataVisits extends StatisticsData
|
|||||||
|
|
||||||
//Get our owning item
|
//Get our owning item
|
||||||
Item owningItem = null;
|
Item owningItem = null;
|
||||||
List<BundleBitstream> bunds = bit.getBundles();
|
List<Bundle> bunds = bit.getBundles();
|
||||||
if(0 < bunds.size() && 0 < bunds.get(0).getBundle().getItems().size())
|
if(0 < bunds.size() && 0 < bunds.get(0).getItems().size())
|
||||||
{
|
{
|
||||||
owningItem = bunds.get(0).getBundle().getItems().get(0);
|
owningItem = bunds.get(0).getItems().get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If possible reference this bitstream via a handle, however this may
|
// If possible reference this bitstream via a handle, however this may
|
||||||
|
@@ -13,7 +13,7 @@ import org.apache.commons.cli.*;
|
|||||||
import org.apache.commons.lang.time.DateFormatUtils;
|
import org.apache.commons.lang.time.DateFormatUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.BundleBitstream;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.DSpaceObjectLegacySupportService;
|
import org.dspace.content.service.DSpaceObjectLegacySupportService;
|
||||||
@@ -273,10 +273,10 @@ public class StatisticsImporterElasticSearch {
|
|||||||
|
|
||||||
if (dso instanceof Bitstream) {
|
if (dso instanceof Bitstream) {
|
||||||
Bitstream bit = (Bitstream) dso;
|
Bitstream bit = (Bitstream) dso;
|
||||||
List<BundleBitstream> bundles = bit.getBundles();
|
List<Bundle> bundles = bit.getBundles();
|
||||||
postBuilder = postBuilder.field("bundleName").startArray();
|
postBuilder = postBuilder.field("bundleName").startArray();
|
||||||
for (BundleBitstream bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
postBuilder = postBuilder.value(bundle.getBundle().getName());
|
postBuilder = postBuilder.value(bundle.getName());
|
||||||
}
|
}
|
||||||
postBuilder = postBuilder.endArray();
|
postBuilder = postBuilder.endArray();
|
||||||
}
|
}
|
||||||
|
@@ -187,7 +187,7 @@ public class InitialQuestionsStep extends AbstractProcessingStep
|
|||||||
|
|
||||||
if (bundles.size() > 0)
|
if (bundles.size() > 0)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bitstreams = bundles.get(0).getBitstreams();
|
List<Bitstream> bitstreams = bundles.get(0).getBitstreams();
|
||||||
|
|
||||||
willRemoveFiles = bitstreams.size() > 1;
|
willRemoveFiles = bitstreams.size() > 1;
|
||||||
}
|
}
|
||||||
@@ -318,18 +318,18 @@ public class InitialQuestionsStep extends AbstractProcessingStep
|
|||||||
|
|
||||||
if (bundles.size() > 0)
|
if (bundles.size() > 0)
|
||||||
{
|
{
|
||||||
Iterator<BundleBitstream> bundleBitstreams = bundles.get(0).getBitstreams().iterator();
|
Iterator<Bitstream> bitstreams = bundles.get(0).getBitstreams().iterator();
|
||||||
//Do NOT remove the first one
|
//Do NOT remove the first one
|
||||||
if(bundleBitstreams.hasNext())
|
if(bitstreams.hasNext())
|
||||||
{
|
{
|
||||||
bundleBitstreams.next();
|
bitstreams.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (bundleBitstreams.hasNext())
|
while (bitstreams.hasNext())
|
||||||
{
|
{
|
||||||
//TODO: HIBERNATE, write unit test for this
|
//TODO: HIBERNATE, write unit test for this
|
||||||
BundleBitstream bundleBitstream = bundleBitstreams.next();
|
Bitstream bitstream = bitstreams.next();
|
||||||
bundleService.removeBitstream(context, bundles.get(0), bundleBitstream.getBitstream());
|
bundleService.removeBitstream(context, bundles.get(0), bitstream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -405,16 +405,16 @@ public class UploadStep extends AbstractProcessingStep
|
|||||||
|
|
||||||
// remove bitstream from bundle..
|
// remove bitstream from bundle..
|
||||||
// delete bundle if it's now empty
|
// delete bundle if it's now empty
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
|
|
||||||
bundleService.removeBitstream(context, bundles.get(0).getBundle(), bitstream);
|
bundleService.removeBitstream(context, bundles.get(0), bitstream);
|
||||||
|
|
||||||
List<BundleBitstream> bitstreams = bundles.get(0).getBundle().getBitstreams();
|
List<Bitstream> bitstreams = bundles.get(0).getBitstreams();
|
||||||
|
|
||||||
// remove bundle if it's now empty
|
// remove bundle if it's now empty
|
||||||
if (bitstreams.size() < 1)
|
if (bitstreams.size() < 1)
|
||||||
{
|
{
|
||||||
itemService.removeBundle(context, item, bundles.get(0).getBundle());
|
itemService.removeBundle(context, item, bundles.get(0));
|
||||||
itemService.update(context, item);
|
itemService.update(context, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -591,16 +591,16 @@ public class UploadStep extends AbstractProcessingStep
|
|||||||
{
|
{
|
||||||
// remove bitstream from bundle..
|
// remove bitstream from bundle..
|
||||||
// delete bundle if it's now empty
|
// delete bundle if it's now empty
|
||||||
List<BundleBitstream> bundleBitstreams = b.getBundles();
|
List<Bundle> bundles = b.getBundles();
|
||||||
|
|
||||||
bundleService.removeBitstream(context, bundleBitstreams.get(0).getBundle(), b);
|
bundleService.removeBitstream(context, bundles.get(0), b);
|
||||||
|
|
||||||
List<BundleBitstream> bitstreams = bundleBitstreams.get(0).getBundle().getBitstreams();
|
List<Bitstream> bitstreams = bundles.get(0).getBitstreams();
|
||||||
|
|
||||||
// remove bundle if it's now empty
|
// remove bundle if it's now empty
|
||||||
if (bitstreams.size() < 1)
|
if (bitstreams.size() < 1)
|
||||||
{
|
{
|
||||||
itemService.removeBundle(context, item, bundleBitstreams.get(0).getBundle());
|
itemService.removeBundle(context, item, bundles.get(0));
|
||||||
itemService.update(context, item);
|
itemService.update(context, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -76,9 +76,8 @@ public abstract class AbstractVersionProvider {
|
|||||||
authorizeService.findPoliciesByDSOAndType(c, nativeBundle, ResourcePolicy.TYPE_CUSTOM);
|
authorizeService.findPoliciesByDSOAndType(c, nativeBundle, ResourcePolicy.TYPE_CUSTOM);
|
||||||
authorizeService.addPolicies(c, bundlePolicies, bundleNew);
|
authorizeService.addPolicies(c, bundlePolicies, bundleNew);
|
||||||
|
|
||||||
for(BundleBitstream nativeBundleBitstream : nativeBundle.getBitstreams())
|
for(Bitstream nativeBitstream : nativeBundle.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream nativeBitstream = nativeBundleBitstream.getBitstream();
|
|
||||||
Bitstream bitstreamNew = createBitstream(c, nativeBitstream);
|
Bitstream bitstreamNew = createBitstream(c, nativeBitstream);
|
||||||
|
|
||||||
bundleService.addBitstream(c, bundleNew, bitstreamNew);
|
bundleService.addBitstream(c, bundleNew, bitstreamNew);
|
||||||
|
@@ -682,9 +682,9 @@ public class XmlWorkflowServiceImpl implements XmlWorkflowService {
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
authorizeService.addPolicy(context, bundle, type, epa);
|
authorizeService.addPolicy(context, bundle, type, epa);
|
||||||
List<BundleBitstream> bits = bundle.getBitstreams();
|
List<Bitstream> bits = bundle.getBitstreams();
|
||||||
for (BundleBitstream bit : bits) {
|
for (Bitstream bit : bits) {
|
||||||
authorizeService.addPolicy(context, bit.getBitstream(), type, epa);
|
authorizeService.addPolicy(context, bit, type, epa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -695,9 +695,9 @@ public class XmlWorkflowServiceImpl implements XmlWorkflowService {
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
authorizeService.addPolicy(context, bundle, type, group);
|
authorizeService.addPolicy(context, bundle, type, group);
|
||||||
List<BundleBitstream> bits = bundle.getBitstreams();
|
List<Bitstream> bits = bundle.getBitstreams();
|
||||||
for (BundleBitstream bit : bits) {
|
for (Bitstream bit : bits) {
|
||||||
authorizeService.addPolicy(context, bit.getBitstream(), type, group);
|
authorizeService.addPolicy(context, bit, type, group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -711,9 +711,9 @@ public class XmlWorkflowServiceImpl implements XmlWorkflowService {
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
authorizeService.removeEPersonPolicies(context, bundle, e);
|
authorizeService.removeEPersonPolicies(context, bundle, e);
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
authorizeService.removeEPersonPolicies(context, bitstream.getBitstream(), e);
|
authorizeService.removeEPersonPolicies(context, bitstream, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ensure that the submitter always retains his resource policies
|
// Ensure that the submitter always retains his resource policies
|
||||||
@@ -732,9 +732,9 @@ public class XmlWorkflowServiceImpl implements XmlWorkflowService {
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
authorizeService.removeGroupPolicies(context, bundle, e);
|
authorizeService.removeGroupPolicies(context, bundle, e);
|
||||||
List<BundleBitstream> bitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bitstream : bitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
authorizeService.removeGroupPolicies(context, bitstream.getBitstream(), e);
|
authorizeService.removeGroupPolicies(context, bitstream, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -196,7 +196,7 @@ ALTER TABLE bundle2bitstream ALTER COLUMN bitstream_id SET NOT NULL;
|
|||||||
ALTER TABLE bundle2bitstream DROP COLUMN bundle_legacy_id;
|
ALTER TABLE bundle2bitstream DROP COLUMN bundle_legacy_id;
|
||||||
ALTER TABLE bundle2bitstream DROP COLUMN bitstream_legacy_id;
|
ALTER TABLE bundle2bitstream DROP COLUMN bitstream_legacy_id;
|
||||||
ALTER TABLE bundle2bitstream DROP COLUMN id;
|
ALTER TABLE bundle2bitstream DROP COLUMN id;
|
||||||
ALTER TABLE bundle2bitstream add primary key (bitstream_id,bundle_id);
|
ALTER TABLE bundle2bitstream add primary key (bitstream_id,bundle_id,bitstream_order);
|
||||||
|
|
||||||
|
|
||||||
-- Migrate item
|
-- Migrate item
|
||||||
|
@@ -30,8 +30,8 @@ CREATE SEQUENCE cwf_in_progress_user_seq;
|
|||||||
CREATE TABLE cwf_workflowitem
|
CREATE TABLE cwf_workflowitem
|
||||||
(
|
(
|
||||||
workflowitem_id integer DEFAULT nextval('cwf_workflowitem_seq') PRIMARY KEY,
|
workflowitem_id integer DEFAULT nextval('cwf_workflowitem_seq') PRIMARY KEY,
|
||||||
item_id INTEGER REFERENCES item(item_id) UNIQUE,
|
item_id UUID REFERENCES item(uuid) UNIQUE,
|
||||||
collection_id INTEGER REFERENCES collection(collection_id),
|
collection_id UUID REFERENCES collection(uuid),
|
||||||
|
|
||||||
-- Answers to questions on first page of submit UI
|
-- Answers to questions on first page of submit UI
|
||||||
multiple_titles BOOL,
|
multiple_titles BOOL,
|
||||||
@@ -42,8 +42,8 @@ CREATE TABLE cwf_workflowitem
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX cwf_workflowitem_item_fk_idx ON cwf_workflowitem(item_id);
|
CREATE INDEX cwf_workflowitem_item_fk_idx ON cwf_workflowitem(uuid);
|
||||||
CREATE INDEX cwf_workflowitem_coll_fk_idx ON cwf_workflowitem(collection_id);
|
CREATE INDEX cwf_workflowitem_coll_fk_idx ON cwf_workflowitem(uuid);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE cwf_collectionrole (
|
CREATE TABLE cwf_collectionrole (
|
||||||
@@ -63,8 +63,8 @@ CREATE TABLE cwf_workflowitemrole (
|
|||||||
workflowitemrole_id integer DEFAULT nextval('cwf_workflowitemrole_seq') PRIMARY KEY,
|
workflowitemrole_id integer DEFAULT nextval('cwf_workflowitemrole_seq') PRIMARY KEY,
|
||||||
role_id Text,
|
role_id Text,
|
||||||
workflowitem_id integer REFERENCES cwf_workflowitem(workflowitem_id),
|
workflowitem_id integer REFERENCES cwf_workflowitem(workflowitem_id),
|
||||||
eperson_id integer REFERENCES eperson(eperson_id),
|
eperson_id UUID REFERENCES eperson(uuid),
|
||||||
group_id integer REFERENCES epersongroup(eperson_group_id)
|
group_id UUID REFERENCES epersongroup(eperson_group_id)
|
||||||
);
|
);
|
||||||
ALTER TABLE ONLY cwf_workflowitemrole
|
ALTER TABLE ONLY cwf_workflowitemrole
|
||||||
ADD CONSTRAINT cwf_workflowitemrole_unique UNIQUE (role_id, workflowitem_id, eperson_id);
|
ADD CONSTRAINT cwf_workflowitemrole_unique UNIQUE (role_id, workflowitem_id, eperson_id);
|
||||||
@@ -79,11 +79,11 @@ CREATE TABLE cwf_pooltask (
|
|||||||
workflow_id TEXT,
|
workflow_id TEXT,
|
||||||
step_id TEXT,
|
step_id TEXT,
|
||||||
action_id TEXT,
|
action_id TEXT,
|
||||||
eperson_id INTEGER REFERENCES EPerson(eperson_id),
|
eperson_id UUID REFERENCES EPerson(uuid),
|
||||||
group_id INTEGER REFERENCES epersongroup(eperson_group_id)
|
group_id UUID REFERENCES epersongroup(uuid)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX cwf_pooltask_eperson_fk_idx ON cwf_pooltask(eperson_id);
|
CREATE INDEX cwf_pooltask_eperson_fk_idx ON cwf_pooltask(uuid);
|
||||||
CREATE INDEX cwf_pooltask_workflow_fk_idx ON cwf_pooltask(workflowitem_id);
|
CREATE INDEX cwf_pooltask_workflow_fk_idx ON cwf_pooltask(workflowitem_id);
|
||||||
CREATE INDEX cwf_pooltask_workflow_eperson_fk_idx ON cwf_pooltask(eperson_id,workflowitem_id);
|
CREATE INDEX cwf_pooltask_workflow_eperson_fk_idx ON cwf_pooltask(eperson_id,workflowitem_id);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ CREATE TABLE cwf_claimtask (
|
|||||||
workflow_id Text,
|
workflow_id Text,
|
||||||
step_id Text,
|
step_id Text,
|
||||||
action_id Text,
|
action_id Text,
|
||||||
owner_id integer REFERENCES eperson(eperson_id)
|
owner_id UUID REFERENCES eperson(uuid)
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE ONLY cwf_claimtask
|
ALTER TABLE ONLY cwf_claimtask
|
||||||
@@ -112,7 +112,7 @@ CREATE INDEX cwf_claimtask_workflow_step_action_eperson_fk_idx ON cwf_claimtask(
|
|||||||
CREATE TABLE cwf_in_progress_user (
|
CREATE TABLE cwf_in_progress_user (
|
||||||
in_progress_user_id integer DEFAULT nextval('cwf_in_progress_user_seq') PRIMARY KEY,
|
in_progress_user_id integer DEFAULT nextval('cwf_in_progress_user_seq') PRIMARY KEY,
|
||||||
workflowitem_id integer REFERENCES cwf_workflowitem(workflowitem_id),
|
workflowitem_id integer REFERENCES cwf_workflowitem(workflowitem_id),
|
||||||
user_id integer REFERENCES eperson(eperson_id),
|
user_id UUID REFERENCES eperson(uuid),
|
||||||
finished BOOL
|
finished BOOL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -340,7 +340,7 @@ public class BundleTest extends AbstractDSpaceObjectTest
|
|||||||
bundleService.addBitstream(context, b, bs);
|
bundleService.addBitstream(context, b, bs);
|
||||||
assertThat("testGetBitstreams 2", b.getBitstreams(), notNullValue());
|
assertThat("testGetBitstreams 2", b.getBitstreams(), notNullValue());
|
||||||
assertThat("testGetBitstreams 3", b.getBitstreams().size(), equalTo(1));
|
assertThat("testGetBitstreams 3", b.getBitstreams().size(), equalTo(1));
|
||||||
assertThat("testGetBitstreams 4", b.getBitstreams().get(0).getBitstream().getName(), equalTo(name));
|
assertThat("testGetBitstreams 4", b.getBitstreams().get(0).getName(), equalTo(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -236,7 +236,7 @@ public class LicenseUtilsTest extends AbstractUnitTest
|
|||||||
LicenseUtils.grantLicense(context, item, defaultLicense);
|
LicenseUtils.grantLicense(context, item, defaultLicense);
|
||||||
|
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
IOUtils.copy(bitstreamService.retrieve(context, itemService.getBundles(item, "LICENSE").get(0).getBitstreams().get(0).getBitstream()), writer);
|
IOUtils.copy(bitstreamService.retrieve(context, itemService.getBundles(item, "LICENSE").get(0).getBitstreams().get(0)), writer);
|
||||||
String license = writer.toString();
|
String license = writer.toString();
|
||||||
|
|
||||||
assertThat("testGrantLicense 0",license, equalTo(defaultLicense));
|
assertThat("testGrantLicense 0",license, equalTo(defaultLicense));
|
||||||
|
@@ -641,12 +641,12 @@ public class DSpaceAIPIntegrationTest extends AbstractUnitTest
|
|||||||
List<Bundle> bundles = itemService.getBundles(testItem, Constants.CONTENT_BUNDLE_NAME);
|
List<Bundle> bundles = itemService.getBundles(testItem, Constants.CONTENT_BUNDLE_NAME);
|
||||||
if(bundles.size()>0)
|
if(bundles.size()>0)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bitstreams = bundles.get(0).getBitstreams();
|
List<Bitstream> bitstreams = bundles.get(0).getBitstreams();
|
||||||
bitstreamCount = bitstreams.size();
|
bitstreamCount = bitstreams.size();
|
||||||
if(bitstreamCount>0)
|
if(bitstreamCount>0)
|
||||||
{
|
{
|
||||||
bitstreamName = bitstreams.get(0).getBitstream().getName();
|
bitstreamName = bitstreams.get(0).getName();
|
||||||
bitstreamCheckSum = bitstreams.get(0).getBitstream().getChecksum();
|
bitstreamCheckSum = bitstreams.get(0).getChecksum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -44,7 +44,6 @@
|
|||||||
<mapping class="org.dspace.content.Bitstream"/>
|
<mapping class="org.dspace.content.Bitstream"/>
|
||||||
<mapping class="org.dspace.content.BitstreamFormat"/>
|
<mapping class="org.dspace.content.BitstreamFormat"/>
|
||||||
<mapping class="org.dspace.content.Bundle"/>
|
<mapping class="org.dspace.content.Bundle"/>
|
||||||
<mapping class="org.dspace.content.BundleBitstream"/>
|
|
||||||
<mapping class="org.dspace.content.Collection"/>
|
<mapping class="org.dspace.content.Collection"/>
|
||||||
<mapping class="org.dspace.content.Community"/>
|
<mapping class="org.dspace.content.Community"/>
|
||||||
<mapping class="org.dspace.content.Item"/>
|
<mapping class="org.dspace.content.Item"/>
|
||||||
|
@@ -198,14 +198,14 @@ public class BitstreamEntryGenerator extends DSpaceATOMEntry
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// work our way up to the item
|
// work our way up to the item
|
||||||
List<BundleBitstream> bundle2bitstreams = this.bitstream
|
List<Bundle> bundle2bitstreams = this.bitstream
|
||||||
.getBundles();
|
.getBundles();
|
||||||
if (bundle2bitstreams.isEmpty())
|
if (bundle2bitstreams.isEmpty())
|
||||||
{
|
{
|
||||||
log.error("Found orphaned bitstream: " + bitstream.getID());
|
log.error("Found orphaned bitstream: " + bitstream.getID());
|
||||||
throw new DSpaceSWORDException("Orphaned bitstream discovered");
|
throw new DSpaceSWORDException("Orphaned bitstream discovered");
|
||||||
}
|
}
|
||||||
Bundle bundle = bundle2bitstreams.get(0).getBundle();
|
Bundle bundle = bundle2bitstreams.get(0);
|
||||||
List<Item> items = bundle.getItems();
|
List<Item> items = bundle.getItems();
|
||||||
if (items.isEmpty())
|
if (items.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -225,10 +225,9 @@ public class BitstreamEntryGenerator extends DSpaceATOMEntry
|
|||||||
// skip non-license bundles
|
// skip non-license bundles
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<BundleBitstream> bss = lbundle.getBitstreams();
|
List<Bitstream> bss = lbundle.getBitstreams();
|
||||||
for (BundleBitstream b2b : bss)
|
for (Bitstream bs : bss)
|
||||||
{
|
{
|
||||||
Bitstream bs = b2b.getBitstream();
|
|
||||||
String url = urlManager.getBitstreamUrl(bs);
|
String url = urlManager.getBitstreamUrl(bs);
|
||||||
rightsString.append(url).append(" ");
|
rightsString.append(url).append(" ");
|
||||||
}
|
}
|
||||||
|
@@ -204,12 +204,11 @@ public class ItemDepositor extends Depositor
|
|||||||
// from them. This will ensure that the bitstream is physically
|
// from them. This will ensure that the bitstream is physically
|
||||||
// removed from the disk.
|
// removed from the disk.
|
||||||
Bitstream bs = result.getBitstream();
|
Bitstream bs = result.getBitstream();
|
||||||
Iterator<BundleBitstream> b2bs = bs.getBundles().iterator();
|
Iterator<Bundle> bundles = bs.getBundles().iterator();
|
||||||
while (b2bs.hasNext())
|
while (bundles.hasNext())
|
||||||
{
|
{
|
||||||
BundleBitstream bundleBitstream = b2bs.next();
|
Bundle bundle = bundles.next();
|
||||||
b2bs.remove();
|
bundles.remove();
|
||||||
Bundle bundle = bundleBitstream.getBundle();
|
|
||||||
bundleService.removeBitstream(sc.getContext(), bundle, bs);
|
bundleService.removeBitstream(sc.getContext(), bundle, bs);
|
||||||
bundleService.update(sc.getContext(), bundle);
|
bundleService.update(sc.getContext(), bundle);
|
||||||
}
|
}
|
||||||
|
@@ -103,11 +103,11 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
{
|
{
|
||||||
if (swordBundle.equals(bundle.getName()))
|
if (swordBundle.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bss = bundle
|
List<Bitstream> bss = bundle
|
||||||
.getBitstreams();
|
.getBitstreams();
|
||||||
for (BundleBitstream bs : bss)
|
for (Bitstream bs : bss)
|
||||||
{
|
{
|
||||||
BitstreamFormat bf = bs.getBitstream()
|
BitstreamFormat bf = bs
|
||||||
.getFormat(
|
.getFormat(
|
||||||
swordService.getContext());
|
swordService.getContext());
|
||||||
String format = "application/octet-stream";
|
String format = "application/octet-stream";
|
||||||
@@ -119,7 +119,7 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
|
|
||||||
// calculate the bitstream link.
|
// calculate the bitstream link.
|
||||||
String bsLink = urlManager
|
String bsLink = urlManager
|
||||||
.getBitstreamUrl(bs.getBitstream());
|
.getBitstreamUrl(bs);
|
||||||
con.setSource(bsLink);
|
con.setSource(bsLink);
|
||||||
|
|
||||||
entry.setContent(con);
|
entry.setContent(con);
|
||||||
@@ -213,16 +213,16 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
{
|
{
|
||||||
if (Constants.CONTENT_BUNDLE_NAME.equals(bundle.getName()))
|
if (Constants.CONTENT_BUNDLE_NAME.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bss = bundle.getBitstreams();
|
List<Bitstream> bss = bundle.getBitstreams();
|
||||||
for (BundleBitstream bs : bss)
|
for (Bitstream bs : bss)
|
||||||
{
|
{
|
||||||
Link link = new Link();
|
Link link = new Link();
|
||||||
String url = urlManager
|
String url = urlManager
|
||||||
.getBitstreamUrl(bs.getBitstream());
|
.getBitstreamUrl(bs);
|
||||||
link.setHref(url);
|
link.setHref(url);
|
||||||
link.setRel("part");
|
link.setRel("part");
|
||||||
|
|
||||||
BitstreamFormat bsf = bs.getBitstream()
|
BitstreamFormat bsf = bs
|
||||||
.getFormat(swordService.getContext());
|
.getFormat(swordService.getContext());
|
||||||
if (bsf != null)
|
if (bsf != null)
|
||||||
{
|
{
|
||||||
@@ -294,10 +294,10 @@ public class ItemEntryGenerator extends DSpaceATOMEntry
|
|||||||
{
|
{
|
||||||
if (Constants.LICENSE_BUNDLE_NAME.equals(bundle.getName()))
|
if (Constants.LICENSE_BUNDLE_NAME.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bss = bundle.getBitstreams();
|
List<Bitstream> bss = bundle.getBitstreams();
|
||||||
for (BundleBitstream bs : bss)
|
for (Bitstream bs : bss)
|
||||||
{
|
{
|
||||||
String url = urlManager.getBitstreamUrl(bs.getBitstream());
|
String url = urlManager.getBitstreamUrl(bs);
|
||||||
rightsString.append(url).append(" ");
|
rightsString.append(url).append(" ");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -437,11 +437,11 @@ public class SWORDUrlManager
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
Bundle parent = null;
|
Bundle parent = null;
|
||||||
if (!bundles.isEmpty())
|
if (!bundles.isEmpty())
|
||||||
{
|
{
|
||||||
parent = bundles.get(0).getBundle();
|
parent = bundles.get(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -549,11 +549,11 @@ public class SWORDUrlManager
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
Bundle parent = null;
|
Bundle parent = null;
|
||||||
if (!bundles.isEmpty())
|
if (!bundles.isEmpty())
|
||||||
{
|
{
|
||||||
parent = bundles.get(0).getBundle();
|
parent = bundles.get(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -44,13 +44,13 @@ public class FeedContentDisseminator extends AbstractSimpleDC
|
|||||||
{
|
{
|
||||||
if (Constants.CONTENT_BUNDLE_NAME.equals(bundle.getName()))
|
if (Constants.CONTENT_BUNDLE_NAME.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle
|
List<Bitstream> bitstreams = bundle
|
||||||
.getBitstreams();
|
.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Entry entry = feed.addEntry();
|
Entry entry = feed.addEntry();
|
||||||
this.populateEntry(context, entry,
|
this.populateEntry(context, entry,
|
||||||
bundleBitstream.getBitstream());
|
bitstream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,6 @@ package org.dspace.sword2;
|
|||||||
|
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -76,15 +75,15 @@ public abstract class GenericStatementDisseminator
|
|||||||
{
|
{
|
||||||
if (swordBundle.equals(bundle.getName()))
|
if (swordBundle.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle
|
List<Bitstream> bitstreams = bundle
|
||||||
.getBitstreams();
|
.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
// note that original deposits don't have actionable urls
|
// note that original deposits don't have actionable urls
|
||||||
OriginalDeposit deposit = new OriginalDeposit(
|
OriginalDeposit deposit = new OriginalDeposit(
|
||||||
this.urlManager.getBitstreamUrl(
|
this.urlManager.getBitstreamUrl(
|
||||||
bundleBitstream.getBitstream()));
|
bitstream));
|
||||||
deposit.setMediaType(bundleBitstream.getBitstream()
|
deposit.setMediaType(bitstream
|
||||||
.getFormat(context).getMIMEType());
|
.getFormat(context).getMIMEType());
|
||||||
originalDeposits.add(deposit);
|
originalDeposits.add(deposit);
|
||||||
}
|
}
|
||||||
@@ -147,15 +146,15 @@ public abstract class GenericStatementDisseminator
|
|||||||
{
|
{
|
||||||
if (bundleName.equals(bundle.getName()))
|
if (bundleName.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle
|
List<Bitstream> bitstreams = bundle
|
||||||
.getBitstreams();
|
.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
// note that individual bitstreams have actionable urls
|
// note that individual bitstreams have actionable urls
|
||||||
ResourcePart part = new ResourcePart(this.urlManager
|
ResourcePart part = new ResourcePart(this.urlManager
|
||||||
.getActionableBitstreamUrl(
|
.getActionableBitstreamUrl(
|
||||||
bundleBitstream.getBitstream()));
|
bitstream));
|
||||||
part.setMediaType(bundleBitstream.getBitstream()
|
part.setMediaType(bitstream
|
||||||
.getFormat(context).getMIMEType());
|
.getFormat(context).getMIMEType());
|
||||||
resources.add(part);
|
resources.add(part);
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,6 @@ import org.dspace.authorize.factory.AuthorizeServiceFactory;
|
|||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.BitstreamService;
|
import org.dspace.content.service.BitstreamService;
|
||||||
@@ -260,10 +259,10 @@ public class MediaResourceManagerDSpace extends DSpaceSwordAPI
|
|||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
Date lm = null;
|
Date lm = null;
|
||||||
List<BundleBitstream> bundleBitstreams = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<Item> items = bundleBitstream.getBundle().getItems();
|
List<Item> items = bundle.getItems();
|
||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
{
|
{
|
||||||
Date possible = item.getLastModified();
|
Date possible = item.getLastModified();
|
||||||
@@ -325,10 +324,10 @@ public class MediaResourceManagerDSpace extends DSpaceSwordAPI
|
|||||||
|
|
||||||
// check that we can submit to ALL the items this bitstream is in
|
// check that we can submit to ALL the items this bitstream is in
|
||||||
List<Item> items = new ArrayList<>();
|
List<Item> items = new ArrayList<>();
|
||||||
List<BundleBitstream> bundleBitstreams = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<Item> bundleItems = bundleBitstream.getBundle()
|
List<Item> bundleItems = bundle
|
||||||
.getItems();
|
.getItems();
|
||||||
for (Item item : bundleItems)
|
for (Item item : bundleItems)
|
||||||
{
|
{
|
||||||
@@ -529,9 +528,9 @@ public class MediaResourceManagerDSpace extends DSpaceSwordAPI
|
|||||||
|
|
||||||
// check that we can submit to ALL the items this bitstream is in
|
// check that we can submit to ALL the items this bitstream is in
|
||||||
List<Item> items = new ArrayList<>();
|
List<Item> items = new ArrayList<>();
|
||||||
for (BundleBitstream bundleBitstream : bitstream.getBundles())
|
for (Bundle bundle : bitstream.getBundles())
|
||||||
{
|
{
|
||||||
List<Item> bundleItems = bundleBitstream.getBundle()
|
List<Item> bundleItems = bundle
|
||||||
.getItems();
|
.getItems();
|
||||||
for (Item item : bundleItems)
|
for (Item item : bundleItems)
|
||||||
{
|
{
|
||||||
|
@@ -157,10 +157,10 @@ public class ReceiptGenerator
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<BundleBitstream> bss = bundle.getBitstreams();
|
List<Bitstream> bss = bundle.getBitstreams();
|
||||||
for (BundleBitstream bs : bss)
|
for (Bitstream bs : bss)
|
||||||
{
|
{
|
||||||
String url = urlManager.getBitstreamUrl(bs.getBitstream());
|
String url = urlManager.getBitstreamUrl(bs);
|
||||||
rightsString.append(url).append(" ");
|
rightsString.append(url).append(" ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,10 +218,10 @@ public class ReceiptGenerator
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<BundleBitstream> bss = bundle.getBitstreams();
|
List<Bitstream> bss = bundle.getBitstreams();
|
||||||
for (BundleBitstream bs : bss)
|
for (Bitstream bs : bss)
|
||||||
{
|
{
|
||||||
String url = urlManager.getBitstreamUrl(bs.getBitstream());
|
String url = urlManager.getBitstreamUrl(bs);
|
||||||
rightsString.append(url).append(" ");
|
rightsString.append(url).append(" ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,6 @@ package org.dspace.sword2;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.BitstreamService;
|
import org.dspace.content.service.BitstreamService;
|
||||||
@@ -57,10 +56,9 @@ public class SimpleZipContentDisseminator implements SwordContentDisseminator
|
|||||||
{
|
{
|
||||||
if (Constants.CONTENT_BUNDLE_NAME.equals(bundle.getName()))
|
if (Constants.CONTENT_BUNDLE_NAME.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bss = bundle.getBitstreams();
|
List<Bitstream> bss = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bss)
|
for (Bitstream bitstream : bss)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
ZipEntry ze = new ZipEntry(bitstream.getName());
|
ZipEntry ze = new ZipEntry(bitstream.getName());
|
||||||
zip.putNextEntry(ze);
|
zip.putNextEntry(ze);
|
||||||
InputStream is = bitstreamService
|
InputStream is = bitstreamService
|
||||||
|
@@ -441,11 +441,11 @@ public class SwordUrlManager
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
Bundle parent = null;
|
Bundle parent = null;
|
||||||
if (!bundles.isEmpty())
|
if (!bundles.isEmpty())
|
||||||
{
|
{
|
||||||
parent = bundles.get(0).getBundle();
|
parent = bundles.get(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -10,7 +10,6 @@ package org.dspace.sword2;
|
|||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.BitstreamService;
|
import org.dspace.content.service.BitstreamService;
|
||||||
@@ -73,14 +72,14 @@ public class VersionManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// remove all the bitstreams from the bundle
|
// remove all the bitstreams from the bundle
|
||||||
Iterator<BundleBitstream> bundleBitstreams = source.getBitstreams()
|
Iterator<Bitstream> bitstreams = source.getBitstreams()
|
||||||
.iterator();
|
.iterator();
|
||||||
while (bundleBitstreams.hasNext())
|
while (bitstreams.hasNext())
|
||||||
{
|
{
|
||||||
BundleBitstream bundleBitstream = bundleBitstreams.next();
|
Bitstream bitstream = bitstreams.next();
|
||||||
bundleBitstreams.remove();
|
bitstreams.remove();
|
||||||
bundleService.removeBitstream(context, source,
|
bundleService.removeBitstream(context, source,
|
||||||
bundleBitstream.getBitstream());
|
bitstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the bundle itself
|
// delete the bundle itself
|
||||||
@@ -105,17 +104,17 @@ public class VersionManager
|
|||||||
exempt = this.archiveBitstream(context, item, bitstream);
|
exempt = this.archiveBitstream(context, item, bitstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<BundleBitstream> bundleBitstreams = bitstream.getBundles()
|
Iterator<Bundle> bundles = bitstream.getBundles()
|
||||||
.iterator();
|
.iterator();
|
||||||
while (bundleBitstreams.hasNext())
|
while (bundles.hasNext())
|
||||||
{
|
{
|
||||||
BundleBitstream bundleBitstream = bundleBitstreams.next();
|
Bundle bundle = bundles.next();
|
||||||
if (exempt != null &&
|
if (exempt != null &&
|
||||||
bundleBitstream.getBundle().getID() != exempt.getID())
|
bundle.getID() != exempt.getID())
|
||||||
{
|
{
|
||||||
bundleBitstreams.remove();
|
bundles.remove();
|
||||||
bundleService
|
bundleService
|
||||||
.removeBitstream(context, bundleBitstream.getBundle(),
|
.removeBitstream(context, bundle,
|
||||||
bitstream);
|
bitstream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,11 +177,11 @@ public class VersionManager
|
|||||||
oldName = this.getNumberedName(item, oldName, 0);
|
oldName = this.getNumberedName(item, oldName, 0);
|
||||||
|
|
||||||
Bundle old = bundleService.create(context, item, oldName);
|
Bundle old = bundleService.create(context, item, oldName);
|
||||||
List<BundleBitstream> bundleBitstreams = source.getBitstreams();
|
List<Bitstream> bitstreams = source.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
bundleService
|
bundleService
|
||||||
.addBitstream(context, old, bundleBitstream.getBitstream());
|
.addBitstream(context, old, bitstream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -124,18 +124,18 @@ public class WorkflowManagerDefault implements WorkflowManager
|
|||||||
// this is equivalent to asking whether the media resource in the item can be deleted
|
// this is equivalent to asking whether the media resource in the item can be deleted
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
||||||
if (!Constants.CONTENT_BUNDLE_NAME
|
if (!Constants.CONTENT_BUNDLE_NAME
|
||||||
.equals(bundleBitstream.getBundle().getName()))
|
.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
||||||
"The file is not in a bundle which can be modified");
|
"The file is not in a bundle which can be modified");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Item> items = bundleBitstream.getBundle().getItems();
|
List<Item> items = bundle.getItems();
|
||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
{
|
{
|
||||||
this.deleteMediaResource(context, item);
|
this.deleteMediaResource(context, item);
|
||||||
@@ -166,18 +166,18 @@ public class WorkflowManagerDefault implements WorkflowManager
|
|||||||
// this is equivalent to asking whether the media resource in the item can be deleted
|
// this is equivalent to asking whether the media resource in the item can be deleted
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
||||||
if (!Constants.CONTENT_BUNDLE_NAME
|
if (!Constants.CONTENT_BUNDLE_NAME
|
||||||
.equals(bundleBitstream.getBundle().getName()))
|
.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
||||||
"The file is not in a bundle which can be modified");
|
"The file is not in a bundle which can be modified");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Item item : bundleBitstream.getBundle().getItems())
|
for (Item item : bundle.getItems())
|
||||||
{
|
{
|
||||||
this.replaceResourceContent(context, item);
|
this.replaceResourceContent(context, item);
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
package org.dspace.sword2;
|
package org.dspace.sword2;
|
||||||
|
|
||||||
import org.dspace.content.*;
|
import org.dspace.content.*;
|
||||||
import org.dspace.core.ConfigurationManager;
|
|
||||||
import org.dspace.core.Constants;
|
import org.dspace.core.Constants;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.swordapp.server.Deposit;
|
import org.swordapp.server.Deposit;
|
||||||
@@ -82,18 +81,18 @@ public class WorkflowManagerUnrestricted implements WorkflowManager
|
|||||||
// this is equivalent to asking whether the media resource in the item can be deleted
|
// this is equivalent to asking whether the media resource in the item can be deleted
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
||||||
if (!Constants.CONTENT_BUNDLE_NAME
|
if (!Constants.CONTENT_BUNDLE_NAME
|
||||||
.equals(bundleBitstream.getBundle().getName()))
|
.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
||||||
"The file is not in a bundle which can be modified");
|
"The file is not in a bundle which can be modified");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Item> items = bundleBitstream.getBundle().getItems();
|
List<Item> items = bundle.getItems();
|
||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
{
|
{
|
||||||
this.deleteMediaResource(context, item);
|
this.deleteMediaResource(context, item);
|
||||||
@@ -112,18 +111,18 @@ public class WorkflowManagerUnrestricted implements WorkflowManager
|
|||||||
// this is equivalent to asking whether the media resource in the item can be deleted
|
// this is equivalent to asking whether the media resource in the item can be deleted
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
// is the bitstream in the ORIGINAL bundle? If not, it can't be worked on
|
||||||
if (!Constants.CONTENT_BUNDLE_NAME
|
if (!Constants.CONTENT_BUNDLE_NAME
|
||||||
.equals(bundleBitstream.getBundle().getName()))
|
.equals(bundle.getName()))
|
||||||
{
|
{
|
||||||
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
throw new SwordError(UriRegistry.ERROR_METHOD_NOT_ALLOWED,
|
||||||
"The file is not in a bundle which can be modified");
|
"The file is not in a bundle which can be modified");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Item> items = bundleBitstream.getBundle().getItems();
|
List<Item> items = bundle.getItems();
|
||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
{
|
{
|
||||||
this.replaceResourceContent(context, item);
|
this.replaceResourceContent(context, item);
|
||||||
|
@@ -522,7 +522,7 @@ public class FlowItemUtils
|
|||||||
Collection owningCollection = item.getOwningCollection();
|
Collection owningCollection = item.getOwningCollection();
|
||||||
if (owningCollection != null)
|
if (owningCollection != null)
|
||||||
{
|
{
|
||||||
Bundle bnd = bitstream.getBundles().get(0).getBundle();
|
Bundle bnd = bitstream.getBundles().get(0);
|
||||||
bundleService.inheritCollectionDefaultPolicies(context, bnd, owningCollection);
|
bundleService.inheritCollectionDefaultPolicies(context, bnd, owningCollection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -624,10 +624,10 @@ public class FlowItemUtils
|
|||||||
|
|
||||||
//Step 2:
|
//Step 2:
|
||||||
// Check if the primary bitstream status has changed
|
// Check if the primary bitstream status has changed
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
if (bundles != null && bundles.size() > 0)
|
if (bundles != null && bundles.size() > 0)
|
||||||
{
|
{
|
||||||
Bundle bundle = bundles.get(0).getBundle();
|
Bundle bundle = bundles.get(0);
|
||||||
if (bundle.getPrimaryBitstream() != null && bundle.getPrimaryBitstream().toString().equals(String.valueOf(bitstreamID)))
|
if (bundle.getPrimaryBitstream() != null && bundle.getPrimaryBitstream().toString().equals(String.valueOf(bitstreamID)))
|
||||||
{
|
{
|
||||||
// currently the bitstream is primary
|
// currently the bitstream is primary
|
||||||
@@ -745,12 +745,11 @@ public class FlowItemUtils
|
|||||||
|
|
||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
UUID[] newBitstreamOrder = new UUID[bundleBitstreams.size()];
|
UUID[] newBitstreamOrder = new UUID[bitstreams.size()];
|
||||||
if (submitButton.equals("submit_update_order")) {
|
if (submitButton.equals("submit_update_order")) {
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
//The order is determined by javascript
|
//The order is determined by javascript
|
||||||
//For each of our bitstream retrieve the order value
|
//For each of our bitstream retrieve the order value
|
||||||
int order = Util.getIntParameter(request, "order_" + bitstream.getID());
|
int order = Util.getIntParameter(request, "order_" + bitstream.getID());
|
||||||
|
@@ -31,7 +31,6 @@ import org.dspace.authorize.service.AuthorizeService;
|
|||||||
import org.dspace.authorize.service.ResourcePolicyService;
|
import org.dspace.authorize.service.ResourcePolicyService;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
@@ -123,8 +122,7 @@ public class EditItemPolicies extends AbstractDSpaceTransformer
|
|||||||
/* First, set up our various data structures */
|
/* First, set up our various data structures */
|
||||||
Item item = itemService.find(context, itemID);
|
Item item = itemService.find(context, itemID);
|
||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
Bitstream[] bitstreams;
|
|
||||||
|
|
||||||
ArrayList<ResourcePolicy> itemPolicies = (ArrayList<ResourcePolicy>) authorizeService.getPolicies(context, item);
|
ArrayList<ResourcePolicy> itemPolicies = (ArrayList<ResourcePolicy>) authorizeService.getPolicies(context, item);
|
||||||
|
|
||||||
// DIVISION: main
|
// DIVISION: main
|
||||||
@@ -162,9 +160,8 @@ public class EditItemPolicies extends AbstractDSpaceTransformer
|
|||||||
this.rowBuilder(baseURL, table, bundlePolicies, bundle.getID(), Constants.BUNDLE, highlightID);
|
this.rowBuilder(baseURL, table, bundlePolicies, bundle.getID(), Constants.BUNDLE, highlightID);
|
||||||
|
|
||||||
// And eventually to the bundle's bitstreams
|
// And eventually to the bundle's bitstreams
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
subheader = table.addRow(null,Row.ROLE_HEADER,"subheader");
|
subheader = table.addRow(null,Row.ROLE_HEADER,"subheader");
|
||||||
subheader.addCell(null, null, 1, 7, "doubleIndent").addContent(T_subhead_bitstream.parameterize(bitstream.getName(),bitstream.getID()));
|
subheader.addCell(null, null, 1, 7, "doubleIndent").addContent(T_subhead_bitstream.parameterize(bitstream.getName(),bitstream.getID()));
|
||||||
subheader.addCell().addXref(baseURL + "&submit_add_bitstream_" + bitstream.getID(), T_add_bitstreamPolicy_link);
|
subheader.addCell().addXref(baseURL + "&submit_add_bitstream_" + bitstream.getID(), T_add_bitstreamPolicy_link);
|
||||||
|
@@ -29,7 +29,6 @@ import org.dspace.authorize.service.AuthorizeService;
|
|||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.BitstreamFormat;
|
import org.dspace.content.BitstreamFormat;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.BitstreamFormatService;
|
import org.dspace.content.service.BitstreamFormatService;
|
||||||
import org.dspace.content.service.BitstreamService;
|
import org.dspace.content.service.BitstreamService;
|
||||||
@@ -103,10 +102,10 @@ public class EditBitstreamForm extends AbstractDSpaceTransformer
|
|||||||
bitstreamFormatService.findNonInternal(context);
|
bitstreamFormatService.findNonInternal(context);
|
||||||
|
|
||||||
boolean primaryBitstream = false;
|
boolean primaryBitstream = false;
|
||||||
java.util.List<BundleBitstream> bundles = bitstream.getBundles();
|
java.util.List<Bundle> bundles = bitstream.getBundles();
|
||||||
if (bundles != null && bundles.size() > 0)
|
if (bundles != null && bundles.size() > 0)
|
||||||
{
|
{
|
||||||
if (bitstream.equals(bundles.get(0).getBundle().getPrimaryBitstream()))
|
if (bitstream.equals(bundles.get(0).getPrimaryBitstream()))
|
||||||
{
|
{
|
||||||
primaryBitstream = true;
|
primaryBitstream = true;
|
||||||
}
|
}
|
||||||
|
@@ -127,14 +127,14 @@ public class EditItemBitstreamsForm extends AbstractDSpaceTransformer {
|
|||||||
Cell bundleCell = files.addRow("bundle_head_" + bundle.getID(), Row.ROLE_DATA, "").addCell(1, 5);
|
Cell bundleCell = files.addRow("bundle_head_" + bundle.getID(), Row.ROLE_DATA, "").addCell(1, 5);
|
||||||
bundleCell.addContent(T_bundle_label.parameterize(bundle.getName()));
|
bundleCell.addContent(T_bundle_label.parameterize(bundle.getName()));
|
||||||
|
|
||||||
java.util.List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
java.util.List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
ArrayList<UUID> bitstreamIdOrder = new ArrayList<>();
|
ArrayList<UUID> bitstreamIdOrder = new ArrayList<>();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
bitstreamIdOrder.add(bundleBitstream.getBitstream().getID());
|
bitstreamIdOrder.add(bitstream.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int bitstreamIndex = 0; bitstreamIndex < bundleBitstreams.size(); bitstreamIndex++) {
|
for (int bitstreamIndex = 0; bitstreamIndex < bitstreams.size(); bitstreamIndex++) {
|
||||||
Bitstream bitstream = bundleBitstreams.get(bitstreamIndex).getBitstream();
|
Bitstream bitstream = bitstreams.get(bitstreamIndex);
|
||||||
boolean primary = (bitstream.equals(bundle.getPrimaryBitstream()));
|
boolean primary = (bitstream.equals(bundle.getPrimaryBitstream()));
|
||||||
String name = bitstream.getName();
|
String name = bitstream.getName();
|
||||||
|
|
||||||
@@ -202,8 +202,8 @@ public class EditItemBitstreamsForm extends AbstractDSpaceTransformer {
|
|||||||
}
|
}
|
||||||
upButton.setValue(T_order_up);
|
upButton.setValue(T_order_up);
|
||||||
upButton.setHelp(T_order_up);
|
upButton.setHelp(T_order_up);
|
||||||
Button downButton = cell.addButton("submit_order_" + bundle.getID() + "_" + bitstream.getID() + "_down", (bitstreamIndex == (bundleBitstreams.size() - 1) ? "disabled" : "") + " icon-button arrowDown ");
|
Button downButton = cell.addButton("submit_order_" + bundle.getID() + "_" + bitstream.getID() + "_down", (bitstreamIndex == (bitstreams.size() - 1) ? "disabled" : "") + " icon-button arrowDown ");
|
||||||
if(bitstreamIndex == (bundleBitstreams.size() - 1)){
|
if(bitstreamIndex == (bitstreams.size() - 1)){
|
||||||
downButton.setDisabled();
|
downButton.setDisabled();
|
||||||
}
|
}
|
||||||
downButton.setValue(T_order_down);
|
downButton.setValue(T_order_down);
|
||||||
|
@@ -23,7 +23,6 @@ import org.dspace.app.requestitem.service.RequestItemService;
|
|||||||
import org.dspace.app.xmlui.utils.ContextUtil;
|
import org.dspace.app.xmlui.utils.ContextUtil;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.BundleBitstream;
|
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
@@ -199,9 +198,8 @@ public class ItemRequestResponseAction extends AbstractAction
|
|||||||
if (requestItem.isAllfiles()){
|
if (requestItem.isAllfiles()){
|
||||||
List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams) {
|
for (Bitstream bitstream : bitstreams) {
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
if (!bitstream.getFormat(context).isInternal() /*&& RequestItemManager.isRestricted(context, bitstreams[k])*/) {
|
if (!bitstream.getFormat(context).isInternal() /*&& RequestItemManager.isRestricted(context, bitstreams[k])*/) {
|
||||||
email.addAttachment(bitstreamStorageService.retrieve(context, bitstream), bitstream.getName(), bitstream.getFormat(context).getMIMEType());
|
email.addAttachment(bitstreamStorageService.retrieve(context, bitstream), bitstream.getName(), bitstream.getFormat(context).getMIMEType());
|
||||||
}
|
}
|
||||||
|
@@ -191,7 +191,7 @@ public class CSVOutputter extends AbstractReader implements Recyclable
|
|||||||
|
|
||||||
entryValues[0] = bitstream.getID() + "";
|
entryValues[0] = bitstream.getID() + "";
|
||||||
entryValues[1] = bitstream.getName();
|
entryValues[1] = bitstream.getName();
|
||||||
entryValues[2] = bitstream.getBundles().get(0).getBundle().getName();
|
entryValues[2] = bitstream.getBundles().get(0).getName();
|
||||||
entryValues[3] = item.getName();
|
entryValues[3] = item.getName();
|
||||||
entryValues[4] = "http://hdl.handle.net/" + item.getHandle();
|
entryValues[4] = "http://hdl.handle.net/" + item.getHandle();
|
||||||
entryValues[5] = wrapInDelimitedString(itemService.getMetadataByMetadataString(item, "dc.creator"));
|
entryValues[5] = wrapInDelimitedString(itemService.getMetadataByMetadataString(item, "dc.creator"));
|
||||||
|
@@ -194,7 +194,7 @@ public class UploadStep extends AbstractSubmissionStep
|
|||||||
String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";
|
String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";
|
||||||
boolean disableFileEditing = (submissionInfo.isInWorkflow()) && !ConfigurationManager.getBooleanProperty("workflow", "reviewer.file-edit");
|
boolean disableFileEditing = (submissionInfo.isInWorkflow()) && !ConfigurationManager.getBooleanProperty("workflow", "reviewer.file-edit");
|
||||||
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
||||||
java.util.List<BundleBitstream> bitstreams = new ArrayList<>();
|
java.util.List<Bitstream> bitstreams = new ArrayList<>();
|
||||||
if (bundles.size() > 0)
|
if (bundles.size() > 0)
|
||||||
{
|
{
|
||||||
bitstreams = bundles.get(0).getBitstreams();
|
bitstreams = bundles.get(0).getBitstreams();
|
||||||
@@ -268,9 +268,8 @@ public class UploadStep extends AbstractSubmissionStep
|
|||||||
header.addCellContent(T_column5); // format
|
header.addCellContent(T_column5); // format
|
||||||
header.addCellContent(T_column6); // edit button
|
header.addCellContent(T_column6); // edit button
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
UUID id = bitstream.getID();
|
UUID id = bitstream.getID();
|
||||||
String name = bitstream.getName();
|
String name = bitstream.getName();
|
||||||
String url = makeBitstreamLink(item, bitstream);
|
String url = makeBitstreamLink(item, bitstream);
|
||||||
@@ -452,15 +451,14 @@ public class UploadStep extends AbstractSubmissionStep
|
|||||||
// Review all uploaded files
|
// Review all uploaded files
|
||||||
Item item = submission.getItem();
|
Item item = submission.getItem();
|
||||||
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
||||||
java.util.List<BundleBitstream> bitstreams = new ArrayList<>();
|
java.util.List<Bitstream> bitstreams = new ArrayList<>();
|
||||||
if (bundles.size() > 0)
|
if (bundles.size() > 0)
|
||||||
{
|
{
|
||||||
bitstreams = bundles.get(0).getBitstreams();
|
bitstreams = bundles.get(0).getBitstreams();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
BitstreamFormat bitstreamFormat = bitstream.getFormat(context);
|
BitstreamFormat bitstreamFormat = bitstream.getFormat(context);
|
||||||
|
|
||||||
String name = bitstream.getName();
|
String name = bitstream.getName();
|
||||||
|
@@ -15,8 +15,10 @@ import org.dspace.app.xmlui.utils.UIException;
|
|||||||
import org.dspace.app.xmlui.wing.Message;
|
import org.dspace.app.xmlui.wing.Message;
|
||||||
import org.dspace.app.xmlui.wing.WingException;
|
import org.dspace.app.xmlui.wing.WingException;
|
||||||
import org.dspace.app.xmlui.wing.element.*;
|
import org.dspace.app.xmlui.wing.element.*;
|
||||||
|
import org.dspace.app.xmlui.wing.element.List;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.*;
|
import org.dspace.content.*;
|
||||||
|
import org.dspace.content.Collection;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
@@ -24,9 +26,7 @@ import org.xml.sax.SAXException;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class manages the upload step with embargo fields during the submission.
|
* This class manages the upload step with embargo fields during the submission.
|
||||||
@@ -189,7 +189,7 @@ public class UploadWithEmbargoStep extends UploadStep
|
|||||||
String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";
|
String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";
|
||||||
boolean disableFileEditing = (submissionInfo.isInWorkflow()) && !ConfigurationManager.getBooleanProperty("workflow", "reviewer.file-edit");
|
boolean disableFileEditing = (submissionInfo.isInWorkflow()) && !ConfigurationManager.getBooleanProperty("workflow", "reviewer.file-edit");
|
||||||
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
||||||
java.util.List<BundleBitstream> bitstreams = new ArrayList<>();
|
java.util.List<Bitstream> bitstreams = new ArrayList<>();
|
||||||
if (bundles.size() > 0)
|
if (bundles.size() > 0)
|
||||||
{
|
{
|
||||||
bitstreams = bundles.get(0).getBitstreams();
|
bitstreams = bundles.get(0).getBitstreams();
|
||||||
@@ -274,10 +274,8 @@ public class UploadWithEmbargoStep extends UploadStep
|
|||||||
header.addCellContent(T_column5); // format
|
header.addCellContent(T_column5); // format
|
||||||
header.addCellContent(T_column6); // edit button
|
header.addCellContent(T_column6); // edit button
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
|
|
||||||
UUID id = bitstream.getID();
|
UUID id = bitstream.getID();
|
||||||
String name = bitstream.getName();
|
String name = bitstream.getName();
|
||||||
String url = makeBitstreamLink(item, bitstream);
|
String url = makeBitstreamLink(item, bitstream);
|
||||||
@@ -411,15 +409,14 @@ public class UploadWithEmbargoStep extends UploadStep
|
|||||||
// Review all uploaded files
|
// Review all uploaded files
|
||||||
Item item = submission.getItem();
|
Item item = submission.getItem();
|
||||||
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
java.util.List<Bundle> bundles = itemService.getBundles(item, "ORIGINAL");
|
||||||
java.util.List<BundleBitstream> bitstreams = new ArrayList<>();
|
java.util.List<Bitstream> bitstreams = new ArrayList<>();
|
||||||
if (bundles.size() > 0)
|
if (bundles.size() > 0)
|
||||||
{
|
{
|
||||||
bitstreams = bundles.get(0).getBitstreams();
|
bitstreams = bundles.get(0).getBitstreams();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
BitstreamFormat bitstreamFormat = bitstream.getFormat(context);
|
BitstreamFormat bitstreamFormat = bitstream.getFormat(context);
|
||||||
|
|
||||||
String name = bitstream.getName();
|
String name = bitstream.getName();
|
||||||
|
@@ -463,13 +463,13 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
if (bundleBitstream.getBitstream().getSequenceID() == sequence)
|
if (bitstream.getSequenceID() == sequence)
|
||||||
{
|
{
|
||||||
return bundleBitstream.getBitstream();
|
return bitstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -511,13 +511,13 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
if (name.equals(bundleBitstream.getBitstream().getName()))
|
if (name.equals(bitstream.getName()))
|
||||||
{
|
{
|
||||||
return bundleBitstream.getBitstream();
|
return bitstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -158,13 +158,13 @@ public class UsageLoggerAction extends AbstractAction {
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
if (bundleBitstream.getBitstream().getSequenceID() == sequence)
|
if (bitstream.getSequenceID() == sequence)
|
||||||
{
|
{
|
||||||
return bundleBitstream.getBitstream();
|
return bitstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,13 +206,13 @@ public class UsageLoggerAction extends AbstractAction {
|
|||||||
List<Bundle> bundles = item.getBundles();
|
List<Bundle> bundles = item.getBundles();
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
if (name.equals(bundleBitstream.getBitstream().getName()))
|
if (name.equals(bitstream.getName()))
|
||||||
{
|
{
|
||||||
return bundleBitstream.getBitstream();
|
return bitstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -530,15 +530,15 @@ public class ItemAdapter extends AbstractAdapter
|
|||||||
List<Bundle> bundles = findEnabledBundles();
|
List<Bundle> bundles = findEnabledBundles();
|
||||||
for (Bundle bundle : bundles)
|
for (Bundle bundle : bundles)
|
||||||
{
|
{
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
// Create a sub-section of <amdSec> for each bitstream in bundle
|
// Create a sub-section of <amdSec> for each bitstream in bundle
|
||||||
for(BundleBitstream bundleBitstream : bundleBitstreams)
|
for(Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
// Only render the section if crosswalk works with bitstreams
|
// Only render the section if crosswalk works with bitstreams
|
||||||
if(crosswalk.canDisseminate(bundleBitstream.getBitstream()))
|
if(crosswalk.canDisseminate(bitstream))
|
||||||
{
|
{
|
||||||
renderAmdSubSection(amdSecName, mdType, crosswalk, bundleBitstream.getBitstream());
|
renderAmdSubSection(amdSecName, mdType, crosswalk, bitstream);
|
||||||
}
|
}
|
||||||
} // end for each bitstream
|
} // end for each bitstream
|
||||||
} // end for each bundle
|
} // end for each bundle
|
||||||
@@ -722,9 +722,8 @@ public class ItemAdapter extends AbstractAdapter
|
|||||||
attributes.put("USE", use);
|
attributes.put("USE", use);
|
||||||
startElement(METS,"fileGrp",attributes);
|
startElement(METS,"fileGrp",attributes);
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundle.getBitstreams())
|
for (Bitstream bitstream : bundle.getBitstreams())
|
||||||
{
|
{
|
||||||
Bitstream bitstream = bundleBitstream.getBitstream();
|
|
||||||
// //////////////////////////////
|
// //////////////////////////////
|
||||||
// Determine the file's IDs
|
// Determine the file's IDs
|
||||||
String fileID = getFileID(bitstream);
|
String fileID = getFileID(bitstream);
|
||||||
@@ -973,13 +972,13 @@ public class ItemAdapter extends AbstractAdapter
|
|||||||
&& bundle.getName().equals("ORIGINAL"))
|
&& bundle.getName().equals("ORIGINAL"))
|
||||||
{
|
{
|
||||||
// Now find the corresponding bitstream
|
// Now find the corresponding bitstream
|
||||||
List<BundleBitstream> bundleBitstreams = bundle.getBitstreams();
|
List<Bitstream> bitstreams = bundle.getBitstreams();
|
||||||
|
|
||||||
for (BundleBitstream bundleBitstream : bundleBitstreams)
|
for (Bitstream bitstream : bitstreams)
|
||||||
{
|
{
|
||||||
if (bundleBitstream.getBitstream().getName().equals(originalFilename))
|
if (bitstream.getName().equals(originalFilename))
|
||||||
{
|
{
|
||||||
return bundleBitstream.getBitstream();
|
return bitstream;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -304,9 +304,9 @@ public class DSpaceValidity implements SourceValidity
|
|||||||
validityKey.append(bundle.getName());
|
validityKey.append(bundle.getName());
|
||||||
validityKey.append(bundle.getPrimaryBitstream() != null ? bundle.getPrimaryBitstream().getID() : "");
|
validityKey.append(bundle.getPrimaryBitstream() != null ? bundle.getPrimaryBitstream().getID() : "");
|
||||||
|
|
||||||
for(BundleBitstream bundleBitstream : bundle.getBitstreams())
|
for(Bitstream bitstream : bundle.getBitstreams())
|
||||||
{
|
{
|
||||||
this.add(context, bundleBitstream.getBitstream());
|
this.add(context, bitstream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dso instanceof Bitstream)
|
else if (dso instanceof Bitstream)
|
||||||
|
@@ -188,9 +188,9 @@ public class HandleUtil
|
|||||||
if (aDso instanceof Bitstream)
|
if (aDso instanceof Bitstream)
|
||||||
{
|
{
|
||||||
Bitstream bitstream = (Bitstream) aDso;
|
Bitstream bitstream = (Bitstream) aDso;
|
||||||
List<BundleBitstream> bundles = bitstream.getBundles();
|
List<Bundle> bundles = bitstream.getBundles();
|
||||||
|
|
||||||
aDso = bundles.get(0).getBundle();
|
aDso = bundles.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aDso instanceof Bundle)
|
if (aDso instanceof Bundle)
|
||||||
|
@@ -58,7 +58,6 @@
|
|||||||
<mapping class="org.dspace.content.Bitstream"/>
|
<mapping class="org.dspace.content.Bitstream"/>
|
||||||
<mapping class="org.dspace.content.BitstreamFormat"/>
|
<mapping class="org.dspace.content.BitstreamFormat"/>
|
||||||
<mapping class="org.dspace.content.Bundle"/>
|
<mapping class="org.dspace.content.Bundle"/>
|
||||||
<mapping class="org.dspace.content.BundleBitstream"/>
|
|
||||||
<mapping class="org.dspace.content.Collection"/>
|
<mapping class="org.dspace.content.Collection"/>
|
||||||
<mapping class="org.dspace.content.Community"/>
|
<mapping class="org.dspace.content.Community"/>
|
||||||
<mapping class="org.dspace.content.Item"/>
|
<mapping class="org.dspace.content.Item"/>
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
<bean class="org.dspace.content.dao.impl.CollectionDAOImpl"/>
|
<bean class="org.dspace.content.dao.impl.CollectionDAOImpl"/>
|
||||||
<bean class="org.dspace.content.dao.impl.BitstreamDAOImpl"/>
|
<bean class="org.dspace.content.dao.impl.BitstreamDAOImpl"/>
|
||||||
<bean class="org.dspace.content.dao.impl.BitstreamFormatDAOImpl"/>
|
<bean class="org.dspace.content.dao.impl.BitstreamFormatDAOImpl"/>
|
||||||
<bean class="org.dspace.content.dao.impl.BundleBitstreamDAOImpl"/>
|
|
||||||
<bean class="org.dspace.content.dao.impl.BundleDAOImpl"/>
|
<bean class="org.dspace.content.dao.impl.BundleDAOImpl"/>
|
||||||
<bean class="org.dspace.content.dao.impl.CommunityDAOImpl"/>
|
<bean class="org.dspace.content.dao.impl.CommunityDAOImpl"/>
|
||||||
<bean class="org.dspace.content.dao.impl.ItemDAOImpl"/>
|
<bean class="org.dspace.content.dao.impl.ItemDAOImpl"/>
|
||||||
|
Reference in New Issue
Block a user