/** * Adds passed value to the set of values for the field in passed item. * * @param context The relevant DSpace Context. * @param item - the item to update * @param value - the value to add in this field * @throws SQLException An exception that provides information on a database access error or other errors. */ public void addItemValue(Context context, Item item, String value) throws SQLException { itemService.addMetadata(context, item, params[0], params[1], params[2], params[3], value); }
private void archiveBitstream(Context context, Bundle target, Bitstream bitstream) throws SQLException, AuthorizeException, IOException { bundleService.addBitstream(context, target, bitstream); }
@Override public List<WorkspaceItem> getAll(Context context) throws SQLException { return workspaceItemService.findAllSupervisedItems(context); }
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); }
@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; }
@Override public List<MetadataValue> getLiftMetadata(Context context, Item item) { return itemService.getMetadata(item, lift_schema, lift_element, lift_qualifier, Item.ANY); }
public InputStream getInputStream() throws SQLException, IOException, AuthorizeException { return getBitstreamService().retrieve(context, bitstream); }
@Override public List<Collection> getAvailableSubscriptions(Context context, EPerson eperson) throws SQLException { List<Collection> collections; if (eperson != null) { context.setCurrentUser(eperson); } collections = collectionService.findAuthorized(context, null, Constants.ADD); return collections; }
@Override public Iterator<Item> findItemsByLiftMetadata(Context context) throws SQLException, IOException, AuthorizeException { return itemService.findByMetadataField(context, lift_schema, lift_element, lift_qualifier, Item.ANY); } }
/** * Get the format of the bitstream * * @param context context * @return the format of this bitstream * @throws SQLException if database error */ public BitstreamFormat getFormat(Context context) throws SQLException { return getBitstreamService().getFormat(context, this); }
/** * Set the license for this collection. Passing in <code>null</code> means * that the site-wide default will be used. * * @param context context * @param license the license, or <code>null</code> * @throws SQLException if database error */ public void setLicense(Context context, String license) throws SQLException { getCollectionService().setMetadata(context, this, "license", license); }
@Override public BitstreamFormat getFormat(Context context, Bitstream bitstream) throws SQLException { if (bitstream.getBitstreamFormat() == null) { return bitstreamFormatService.findUnknown(context); } else { return bitstream.getBitstreamFormat(); } }
/** * Set the name of the bitstream * * @param context context * @param n the new name of the bitstream * @throws SQLException if database error */ public void setName(Context context, String n) throws SQLException { getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, n); }
@Override public List<WorkspaceItem> findbyEPerson(Context context, EPerson ep) throws SQLException { return workspaceItemService.findSupervisedItemsByEPerson(context, ep); }
/** * Set the user's format description. This implies that the format of the * bitstream is uncertain, and the format is set to "unknown." * * @param context The relevant DSpace Context. * @param desc the user's description of the format * @throws SQLException if database error */ public void setUserFormatDescription(Context context, String desc) throws SQLException { getBitstreamService().setUserFormatDescription(context, this, desc); }
/** * Get the name of the bundle * * @return name of the bundle (ORIGINAL, TEXT, THUMBNAIL) or NULL if not set */ @Override public String getName() { return getBundleService().getMetadataFirstValue(this, MetadataSchema.DC_SCHEMA, "title", null, Item.ANY); }
@Override public String getName() { String value = getCollectionService() .getMetadataFirstValue(this, MetadataSchema.DC_SCHEMA, "title", null, Item.ANY); return value == null ? "" : value; }
/** * Get the description of this bitstream - optional free text, typically * provided by a user at submission time * * @return the description of the bitstream */ public String getDescription() { return getBitstreamService() .getMetadataFirstValue(this, MetadataSchema.DC_SCHEMA, "description", null, Item.ANY); }
/** * Set the source of the bitstream * * @param context context * @param n the new source of the bitstream * @throws SQLException if database error */ public void setSource(Context context, String n) throws SQLException { getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "source", null, null, n); }
/** * Set the description of the bitstream * * @param context context * @param n the new description of the bitstream * @throws SQLException if database error */ public void setDescription(Context context, String n) throws SQLException { getBitstreamService() .setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "description", null, null, n); }