Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #533 #556

Merged
merged 1 commit into from
Jun 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public void addBody(Map objectModel, Division div) throws WingException, SQLExce
private Table create_table(Division div) throws WingException
{
String baseURL = contextPath+"/admin/epeople?";

String base = ConfigurationManager.getProperty("dspace.url");
// table
Table wftable = div.addTable("workspace_items", 1, 4, "table-condensed");

Expand Down Expand Up @@ -116,24 +118,39 @@ private Table create_table(Division div) throws WingException
r.addCell().addXref(ld.getDefinition(), ld.getName());

Bitstream bitstream = Bitstream.find(context, bitstreamID);
Item item = (Item)bitstream.getParentObject();
String itemLink;
String itemLinkCaption;
String bitstreamLink;
String bitstreamLinkCaption;
if(bitstream == null || bitstream.isDeleted()){
bitstreamLink = itemLink = "#";
bitstreamLinkCaption = bitstreamID + " (deleted)";
itemLinkCaption = "No item, bitstream was deleted";

}else {
Item item = (Item) bitstream.getParentObject();

String base = ConfigurationManager.getProperty("dspace.url");
StringBuffer itemLink = new StringBuffer().append(base)
.append(base.endsWith("/") ? "" : "/")
.append("/handle/")
.append(item.getHandle());
StringBuffer sb = new StringBuffer().append(base)
.append(base.endsWith("/") ? "" : "/")
.append("/handle/")
.append(item.getHandle());
itemLink = sb.toString();
itemLinkCaption = Integer.toString(item.getID());

sb = new StringBuffer().append(base)
.append(base.endsWith("/") ? "" : "/")
.append("bitstream/handle/")
.append(item.getHandle())
.append("/")
.append(URLEncoder.encode(bitstream.getName(), "UTF8"))
.append("?sequence=").append(bitstream.getSequenceID());
bitstreamLink = sb.toString();
bitstreamLinkCaption = Integer.toString(bitstream.getID());
}

r.addCell().addXref(itemLink.toString(), "" + item.getID());
r.addCell().addXref(itemLink, itemLinkCaption);

StringBuffer bitstreamLink = new StringBuffer().append(base)
.append(base.endsWith("/") ? "" : "/")
.append("bitstream/handle/")
.append(item.getHandle())
.append("/")
.append(URLEncoder.encode(bitstream.getName(), "UTF8"))
.append("?sequence=").append(bitstream.getSequenceID());
r.addCell().addXref(bitstreamLink.toString(), "" + bitstream.getID());
r.addCell().addXref(bitstreamLink, bitstreamLinkCaption);

Cell c = r.addCell();
List<UserMetadata> extraMetaData = functionalityManager.getUserMetadata_License(ur.getEpersonId(), license.getTransactionId());
Expand Down