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); }
private void archiveBundle(Context context, Item item, Bundle source) throws SQLException, AuthorizeException, IOException { // get the datestamped root bundle name SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String oldName = "VER" + sdf.format(new Date()); oldName = this.getNumberedName(item, oldName, 0); Bundle old = bundleService.create(context, item, oldName); List<Bitstream> bitstreams = source.getBitstreams(); for (Bitstream bitstream : bitstreams) { bundleService .addBitstream(context, old, bitstream); } }
@Override public Bitstream createSingleBitstream(Context context, InputStream is, Item item, String name) throws AuthorizeException, IOException, SQLException { // Authorisation is checked by methods below // Create a bundle Bundle bnd = bundleService.create(context, item, name); Bitstream bitstream = bitstreamService.create(context, bnd, is); addBundle(context, item, bnd); // FIXME: Create permissions for new bundle + bitstream return bitstream; }
private Bundle archiveBitstream(Context context, Item item, Bitstream bitstream) throws SQLException, AuthorizeException, IOException { String swordBundle = ConfigurationManager .getProperty("swordv2-server", "bundle.deleted"); if (swordBundle == null) { swordBundle = "DELETED"; } List<Bundle> bundles = item.getBundles(); Bundle archive = null; for (Bundle bundle : bundles) { if (swordBundle.equals(bundle.getName())) { archive = bundle; break; } } if (archive == null) { archive = bundleService.create(context, item, swordBundle); } this.archiveBitstream(context, archive, bitstream); return archive; }
targetBundle = bundleService.create(c, i, newBundleName); } else {
targetBundle = bundleService.create(c, i, newBundleName); } else {
lb = bundleService.create(context, item, Constants.LICENSE_BUNDLE_NAME); } else { lb = bundles.get(0);
if (dBundles == null || dBundles.size() == 0) { try { dBundle = bundleService.create(Curator.curationContext(), item, CitationPage.DISPLAY_BUNDLE_NAME); } catch (AuthorizeException e) { log.error("User not authroized to create bundle on item \"" } else { try { pBundle = bundleService.create(Curator.curationContext(), item, CitationPage.PRESERVATION_BUNDLE_NAME); } catch (AuthorizeException e) { log.error("User not authroized to create bundle on item \""
result.getOriginalDeposit()); } else { Bundle bundle = bundleService.create(context, item, Constants.CONTENT_BUNDLE_NAME); bundleService.addBitstream(context, bundle,
targetBundle = bundleService.create(context, item, bundleName); itemService.addBundle(context, item, targetBundle); } else {
targetBundle = bundleService.create(context, item, newBundleName); } else {
original = bundleService.create(context, myitem, "ORIGINAL");
AuthorizeException, PackageValidationException { Bundle mdBundle = bundleService.create(context, item, Constants.METADATA_BUNDLE_NAME);
swordBundle = bundleService.create( context, item, bundleName);
.create(context, item, Constants.CONTENT_BUNDLE_NAME);
.create(context, item, Constants.CONTENT_BUNDLE_NAME);
.create(context, item, bundleName);
protected void createBundlesAndAddBitstreams(Context c, Item itemNew, Item nativeItem) throws SQLException, AuthorizeException, IOException { for (Bundle nativeBundle : nativeItem.getBundles()) { Bundle bundleNew = bundleService.create(c, itemNew, nativeBundle.getName());
.create(context, item, Constants.CONTENT_BUNDLE_NAME);
.create(context, item, Constants.CONTENT_BUNDLE_NAME);