@Override public void removeLicense(Context context, Item item) throws SQLException, IOException, AuthorizeException { // remove CC license bundle if one exists List<Bundle> bundles = itemService.getBundles(item, CC_BUNDLE_NAME); if ((bundles.size() > 0) && (bundles.get(0) != null)) { itemService.removeBundle(context, item, bundles.get(0)); } }
protected Bundle getCcBundle(Context context, Item item) throws SQLException, AuthorizeException, IOException { List<Bundle> bundles = itemService.getBundles(item, CC_BUNDLE_NAME); if ((bundles.size() > 0) && (bundles.get(0) != null)) { itemService.removeBundle(context, item, bundles.get(0)); } return bundleService.create(context, item, CC_BUNDLE_NAME); }
public void removeBundle(Context context, Item item, Bundle source, boolean archive) throws SQLException, AuthorizeException, IOException { // archive the bundle contents if desired if (archive) { this.archiveBundle(context, item, source); } // remove all the bitstreams from the bundle Iterator<Bitstream> bitstreams = source.getBitstreams() .iterator(); while (bitstreams.hasNext()) { Bitstream bitstream = bitstreams.next(); bitstreams.remove(); bundleService.removeBitstream(context, source, bitstream); } // delete the bundle itself itemService.removeBundle(context, item, source); }
Bundle bundle = bunds.next(); bunds.remove(); itemService.removeBundle(context, item, bundle);
List<Bitstream> bitstreams = bundle.getBitstreams(); if (bitstreams == null || bitstreams.size() == 0) { itemService.removeBundle(context, item, bundle);
itemService.removeBundle(ourContext, item, bundle);