mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-12 12:33:18 +00:00
DS-3851 Configurable Workflow endpoints
This commit is contained in:

committed by
Andrea Bollini

parent
c0066d2a2f
commit
25e3a69b8f
@@ -11,6 +11,7 @@ import java.io.InputStream;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
@@ -21,6 +22,8 @@ import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.browse.BrowsableDSpaceObject;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.BitstreamService;
|
||||
import org.dspace.core.Constants;
|
||||
@@ -40,6 +43,12 @@ import org.hibernate.proxy.HibernateProxyHelper;
|
||||
@Entity
|
||||
@Table(name = "bitstream")
|
||||
public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport {
|
||||
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(Bitstream.class);
|
||||
|
||||
@Column(name = "bitstream_id", insertable = false, updatable = false)
|
||||
private Integer legacyId;
|
||||
|
||||
@@ -426,4 +435,17 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
.setMetadataSingleValue(context, this, "dcterms", "accessRights", null, null, acceptanceDate.toString());
|
||||
}
|
||||
|
||||
public BrowsableDSpaceObject getParentObject() {
|
||||
Context context = new Context();
|
||||
try {
|
||||
return (BrowsableDSpaceObject) (getBitstreamService().getParentObject(context, this));
|
||||
} catch (SQLException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getMetadata(String field) {
|
||||
return getBitstreamService().getMetadata(this, field);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user