Merge branch 'master' into dspace-rest-fixes

This commit is contained in:
Kostas Stamatis
2013-10-31 08:40:46 +02:00
32 changed files with 235 additions and 210 deletions

View File

@@ -116,6 +116,7 @@ public class BrowseDAOOracle implements BrowseDAO
/** flags for what the items represent */ /** flags for what the items represent */
private boolean itemsInArchive = true; private boolean itemsInArchive = true;
private boolean itemsWithdrawn = false; private boolean itemsWithdrawn = false;
private boolean itemsDiscoverable = true;
private boolean enableBrowseFrequencies = true; private boolean enableBrowseFrequencies = true;
@@ -360,7 +361,8 @@ public class BrowseDAOOracle implements BrowseDAO
TableRow row = tri.next(); TableRow row = tri.next();
BrowseItem browseItem = new BrowseItem(context, row.getIntColumn("item_id"), BrowseItem browseItem = new BrowseItem(context, row.getIntColumn("item_id"),
itemsInArchive, itemsInArchive,
itemsWithdrawn); itemsWithdrawn,
itemsDiscoverable);
results.add(browseItem); results.add(browseItem);
} }
@@ -682,11 +684,19 @@ public class BrowseDAOOracle implements BrowseDAO
{ {
itemsInArchive = false; itemsInArchive = false;
itemsWithdrawn = true; itemsWithdrawn = true;
itemsDiscoverable = true;
}
else if (table.equals(BrowseIndex.getPrivateBrowseIndex().getTableName()))
{
itemsInArchive = true;
itemsWithdrawn = false;
itemsDiscoverable = false;
} }
else else
{ {
itemsInArchive = true; itemsInArchive = true;
itemsWithdrawn = false; itemsWithdrawn = false;
itemsDiscoverable = true;
} }
this.rebuildQuery = true; this.rebuildQuery = true;

View File

@@ -116,6 +116,7 @@ public class BrowseDAOPostgres implements BrowseDAO
/** flags for what the items represent */ /** flags for what the items represent */
private boolean itemsInArchive = true; private boolean itemsInArchive = true;
private boolean itemsWithdrawn = false; private boolean itemsWithdrawn = false;
private boolean itemsDiscoverable = true;
private boolean enableBrowseFrequencies = true; private boolean enableBrowseFrequencies = true;
@@ -367,7 +368,8 @@ public class BrowseDAOPostgres implements BrowseDAO
TableRow row = tri.next(); TableRow row = tri.next();
BrowseItem browseItem = new BrowseItem(context, row.getIntColumn("item_id"), BrowseItem browseItem = new BrowseItem(context, row.getIntColumn("item_id"),
itemsInArchive, itemsInArchive,
itemsWithdrawn); itemsWithdrawn,
itemsDiscoverable);
results.add(browseItem); results.add(browseItem);
} }
@@ -687,13 +689,22 @@ public class BrowseDAOPostgres implements BrowseDAO
{ {
itemsInArchive = false; itemsInArchive = false;
itemsWithdrawn = true; itemsWithdrawn = true;
itemsDiscoverable = true;
}
else if (table.equals(BrowseIndex.getPrivateBrowseIndex().getTableName()))
{
itemsInArchive = true;
itemsWithdrawn = false;
itemsDiscoverable = false;
} }
else else
{ {
itemsInArchive = true; itemsInArchive = true;
itemsWithdrawn = false; itemsWithdrawn = false;
itemsDiscoverable = true;
} }
this.rebuildQuery = true; this.rebuildQuery = true;
} }

View File

@@ -55,6 +55,9 @@ public class BrowseItem extends DSpaceObject
/** is the item withdrawn */ /** is the item withdrawn */
private boolean withdrawn = false; private boolean withdrawn = false;
/** is the item discoverable */
private boolean discoverable = true;
/** item handle */ /** item handle */
private String handle = null; private String handle = null;
@@ -66,12 +69,13 @@ public class BrowseItem extends DSpaceObject
* @param in_archive * @param in_archive
* @param withdrawn * @param withdrawn
*/ */
public BrowseItem(Context context, int id, boolean in_archive, boolean withdrawn) public BrowseItem(Context context, int id, boolean in_archive, boolean withdrawn, boolean discoverable)
{ {
this.context = context; this.context = context;
this.id = id; this.id = id;
this.in_archive = in_archive; this.in_archive = in_archive;
this.withdrawn = withdrawn; this.withdrawn = withdrawn;
this.discoverable = discoverable;
} }
/** /**
@@ -404,4 +408,8 @@ public class BrowseItem extends DSpaceObject
{ {
return withdrawn; return withdrawn;
} }
public boolean isDiscoverable() {
return discoverable;
}
} }

View File

@@ -21,7 +21,7 @@ import java.util.List;
public class BrowseItemDAOOracle implements BrowseItemDAO public class BrowseItemDAOOracle implements BrowseItemDAO
{ {
/** query to obtain all the items from the database */ /** query to obtain all the items from the database */
private String findAll = "SELECT item_id, in_archive, withdrawn FROM item WHERE in_archive = 1 OR withdrawn = 1"; private String findAll = "SELECT item_id, in_archive, withdrawn, discoverable FROM item WHERE in_archive = 1 OR withdrawn = 1";
/** query to get the text value of a metadata element only (qualifier is NULL) */ /** query to get the text value of a metadata element only (qualifier is NULL) */
private String getByMetadataElement = "SELECT authority, confidence, text_value,text_lang,element,qualifier FROM metadatavalue, metadatafieldregistry, metadataschemaregistry " + private String getByMetadataElement = "SELECT authority, confidence, text_value,text_lang,element,qualifier FROM metadatavalue, metadatafieldregistry, metadataschemaregistry " +
@@ -75,7 +75,8 @@ public class BrowseItemDAOOracle implements BrowseItemDAO
TableRow row = tri.next(); TableRow row = tri.next();
items.add(new BrowseItem(context, row.getIntColumn("item_id"), items.add(new BrowseItem(context, row.getIntColumn("item_id"),
row.getBooleanColumn("in_archive"), row.getBooleanColumn("in_archive"),
row.getBooleanColumn("withdrawn"))); row.getBooleanColumn("withdrawn"),
row.getBooleanColumn("discoverable")));
} }
} }
finally finally

View File

@@ -21,7 +21,7 @@ import java.util.List;
public class BrowseItemDAOPostgres implements BrowseItemDAO public class BrowseItemDAOPostgres implements BrowseItemDAO
{ {
/** query to obtain all the items from the database */ /** query to obtain all the items from the database */
private String findAll = "SELECT item_id, in_archive, withdrawn FROM item WHERE in_archive = true OR withdrawn = true"; private String findAll = "SELECT item_id, in_archive, withdrawn, discoverable FROM item WHERE in_archive = true OR withdrawn = true";
/** query to get the text value of a metadata element only (qualifier is NULL) */ /** query to get the text value of a metadata element only (qualifier is NULL) */
private String getByMetadataElement = "SELECT authority, confidence, text_value,text_lang,element,qualifier FROM metadatavalue, metadatafieldregistry, metadataschemaregistry " + private String getByMetadataElement = "SELECT authority, confidence, text_value,text_lang,element,qualifier FROM metadatavalue, metadatafieldregistry, metadataschemaregistry " +
@@ -74,7 +74,8 @@ public class BrowseItemDAOPostgres implements BrowseItemDAO
TableRow row = tri.next(); TableRow row = tri.next();
items.add(new BrowseItem(context, row.getIntColumn("item_id"), items.add(new BrowseItem(context, row.getIntColumn("item_id"),
row.getBooleanColumn("in_archive"), row.getBooleanColumn("in_archive"),
row.getBooleanColumn("withdrawn"))); row.getBooleanColumn("withdrawn"),
row.getBooleanColumn("discoverable")));
} }
} }
finally finally

View File

@@ -344,7 +344,7 @@ public class IndexBrowse
{ {
boolean reqCommunityMappings = false; boolean reqCommunityMappings = false;
Map<Integer, String> sortMap = getSortValues(item, itemMDMap); Map<Integer, String> sortMap = getSortValues(item, itemMDMap);
if (item.isArchived() && !item.isWithdrawn()) if (item.isArchived() && item.isDiscoverable())
{ {
// Try to update an existing record in the item index // Try to update an existing record in the item index
if (!dao.updateIndex(BrowseIndex.getItemBrowseIndex().getTableName(), item.getID(), sortMap)) if (!dao.updateIndex(BrowseIndex.getItemBrowseIndex().getTableName(), item.getID(), sortMap))
@@ -358,17 +358,15 @@ public class IndexBrowse
reqCommunityMappings = true; reqCommunityMappings = true;
} }
else if (item.isWithdrawn()) else if (!item.isDiscoverable())
{ {
// Private items are marked as withdrawn as well. check before if they are private...
Item dsoItem = Item.find(context, item.getID());
if (!dsoItem.isDiscoverable()){
if (!dao.updateIndex(BrowseIndex.getPrivateBrowseIndex().getTableName(), item.getID(), sortMap)) { if (!dao.updateIndex(BrowseIndex.getPrivateBrowseIndex().getTableName(), item.getID(), sortMap)) {
dao.deleteByItemID(BrowseIndex.getItemBrowseIndex().getTableName(), item.getID()); dao.deleteByItemID(BrowseIndex.getItemBrowseIndex().getTableName(), item.getID());
dao.insertIndex(BrowseIndex.getPrivateBrowseIndex().getTableName(), item.getID(), sortMap); dao.insertIndex(BrowseIndex.getPrivateBrowseIndex().getTableName(), item.getID(), sortMap);
} }
} }
else{ else if (item.isWithdrawn())
{
// Try to update an existing record in the withdrawn index // Try to update an existing record in the withdrawn index
if (!dao.updateIndex(BrowseIndex.getWithdrawnBrowseIndex().getTableName(), item.getID(), sortMap)) if (!dao.updateIndex(BrowseIndex.getWithdrawnBrowseIndex().getTableName(), item.getID(), sortMap))
{ {
@@ -378,11 +376,6 @@ public class IndexBrowse
dao.insertIndex(BrowseIndex.getWithdrawnBrowseIndex().getTableName(), item.getID(), sortMap); dao.insertIndex(BrowseIndex.getWithdrawnBrowseIndex().getTableName(), item.getID(), sortMap);
} }
} }
}
else else
{ {
// This item shouldn't exist in either index - ensure that it is removed // This item shouldn't exist in either index - ensure that it is removed
@@ -1273,5 +1266,21 @@ public class IndexBrowse
return browseItem.isWithdrawn(); return browseItem.isWithdrawn();
} }
/**
* Is the Item discoverable?
* @return
*/
public boolean isDiscoverable()
{
if (item != null)
{
return item.isDiscoverable();
}
return browseItem.isDiscoverable();
}
} }
} }

View File

@@ -133,7 +133,7 @@ public class SolrBrowseDAO implements BrowseDAO
private DiscoverResult sResponse = null; private DiscoverResult sResponse = null;
private boolean itemsWithdrawn = false; private boolean itemsWithdrawn = false;
private boolean itemsPrivate = false; private boolean itemsDiscoverable = true;
private boolean showFrequencies; private boolean showFrequencies;
@@ -186,7 +186,8 @@ public class SolrBrowseDAO implements BrowseDAO
} }
try try
{ {
sResponse = searcher.search(context, query, itemsWithdrawn); sResponse = searcher.search(context, query, itemsWithdrawn
|| !itemsDiscoverable);
} }
catch (SearchServiceException e) catch (SearchServiceException e)
{ {
@@ -201,19 +202,11 @@ public class SolrBrowseDAO implements BrowseDAO
if (itemsWithdrawn) if (itemsWithdrawn)
{ {
query.addFilterQueries("withdrawn:true"); query.addFilterQueries("withdrawn:true");
if (itemsPrivate) }
else if (!itemsDiscoverable)
{ {
query.addFilterQueries("discoverable:false"); query.addFilterQueries("discoverable:false");
} }
else
{
query.addFilterQueries("NOT(discoverable:false)");
}
}
else
{
query.addFilterQueries("NOT(withdrawn:true)");
}
} }
private void addLocationScopeFilter(DiscoverQuery query) private void addLocationScopeFilter(DiscoverQuery query)
@@ -301,7 +294,7 @@ public class SolrBrowseDAO implements BrowseDAO
// processing the query... // processing the query...
Item item = (Item) solrDoc; Item item = (Item) solrDoc;
BrowseItem bitem = new BrowseItem(context, item.getID(), BrowseItem bitem = new BrowseItem(context, item.getID(),
item.isArchived(), item.isWithdrawn()); item.isArchived(), item.isWithdrawn(), item.isDiscoverable());
bitems.add(bitem); bitems.add(bitem);
} }
return bitems; return bitems;
@@ -681,13 +674,10 @@ public class SolrBrowseDAO implements BrowseDAO
if (table.equals(BrowseIndex.getWithdrawnBrowseIndex().getTableName())) if (table.equals(BrowseIndex.getWithdrawnBrowseIndex().getTableName()))
{ {
itemsWithdrawn = true; itemsWithdrawn = true;
itemsPrivate = false;
} }
else if (table.equals(BrowseIndex.getPrivateBrowseIndex().getTableName())) else if (table.equals(BrowseIndex.getPrivateBrowseIndex().getTableName()))
{ {
itemsPrivate = true; itemsDiscoverable = false;
// items private are also withdrawn
itemsWithdrawn = true;
} }
facetField = table; facetField = table;
} }

View File

@@ -190,13 +190,8 @@ public class InstallItem
// set owning collection // set owning collection
item.setOwningCollection(is.getCollection()); item.setOwningCollection(is.getCollection());
// set in_archive=true only if the user didn't specify that it is a private item // set in_archive=true
if(item.isDiscoverable()){
item.setArchived(true); item.setArchived(true);
}
else{ // private item is withdrawn as well
item.withdraw();
}
// save changes ;-) // save changes ;-)
item.update(); item.update();

View File

@@ -1526,7 +1526,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
return search(context, dso, query, false); return search(context, dso, query, false);
} }
public DiscoverResult search(Context context, DSpaceObject dso, DiscoverQuery discoveryQuery, boolean includeWithdrawn) throws SearchServiceException { public DiscoverResult search(Context context, DSpaceObject dso, DiscoverQuery discoveryQuery, boolean includeUnDiscoverable) throws SearchServiceException {
if(dso != null) if(dso != null)
{ {
if (dso instanceof Community) if (dso instanceof Community)
@@ -1540,17 +1540,17 @@ public class SolrServiceImpl implements SearchService, IndexingService {
discoveryQuery.addFilterQueries("handle:" + dso.getHandle()); discoveryQuery.addFilterQueries("handle:" + dso.getHandle());
} }
} }
return search(context, discoveryQuery, includeWithdrawn); return search(context, discoveryQuery, includeUnDiscoverable);
} }
public DiscoverResult search(Context context, DiscoverQuery discoveryQuery, boolean includeWithdrawn) throws SearchServiceException { public DiscoverResult search(Context context, DiscoverQuery discoveryQuery, boolean includeUnDiscoverable) throws SearchServiceException {
try { try {
if(getSolr() == null){ if(getSolr() == null){
return new DiscoverResult(); return new DiscoverResult();
} }
SolrQuery solrQuery = resolveToSolrQuery(context, discoveryQuery, includeWithdrawn); SolrQuery solrQuery = resolveToSolrQuery(context, discoveryQuery, includeUnDiscoverable);
QueryResponse queryResponse = getSolr().query(solrQuery); QueryResponse queryResponse = getSolr().query(solrQuery);
@@ -1562,7 +1562,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
} }
} }
protected SolrQuery resolveToSolrQuery(Context context, DiscoverQuery discoveryQuery, boolean includeWithdrawn) protected SolrQuery resolveToSolrQuery(Context context, DiscoverQuery discoveryQuery, boolean includeUnDiscoverable)
{ {
SolrQuery solrQuery = new SolrQuery(); SolrQuery solrQuery = new SolrQuery();
@@ -1580,9 +1580,10 @@ public class SolrServiceImpl implements SearchService, IndexingService {
solrQuery.setParam("spellcheck", Boolean.TRUE); solrQuery.setParam("spellcheck", Boolean.TRUE);
} }
if (!includeWithdrawn) if (!includeUnDiscoverable)
{ {
solrQuery.addFilterQuery("NOT(withdrawn:true)"); solrQuery.addFilterQuery("NOT(withdrawn:true)");
solrQuery.addFilterQuery("NOT(discoverable:false)");
} }
for (int i = 0; i < discoveryQuery.getFilterQueries().size(); i++) for (int i = 0; i < discoveryQuery.getFilterQueries().size(); i++)

View File

@@ -59,32 +59,26 @@ public class SolrServiceResourceRestrictionPlugin implements SolrServiceIndexPlu
@Override @Override
public void additionalSearchParameters(Context context, DiscoverQuery discoveryQuery, SolrQuery solrQuery) { public void additionalSearchParameters(Context context, DiscoverQuery discoveryQuery, SolrQuery solrQuery) {
try {
if(!AuthorizeManager.isAdmin(context)){
StringBuilder resourceQuery = new StringBuilder(); StringBuilder resourceQuery = new StringBuilder();
//Always add the anonymous group id to the query //Always add the anonymous group id to the query
resourceQuery.append("read:(g0"); resourceQuery.append("read:(g0");
EPerson currentUser = context.getCurrentUser(); EPerson currentUser = context.getCurrentUser();
if(currentUser != null){ if(currentUser != null){
try {
resourceQuery.append(" OR e").append(currentUser.getID()); resourceQuery.append(" OR e").append(currentUser.getID());
//Retrieve all the groups the current user is a member of ! //Retrieve all the groups the current user is a member of !
Set<Integer> groupIds = Group.allMemberGroupIDs(context, currentUser); Set<Integer> groupIds = Group.allMemberGroupIDs(context, currentUser);
for (Integer groupId : groupIds) { for (Integer groupId : groupIds) {
resourceQuery.append(" OR g").append(groupId); resourceQuery.append(" OR g").append(groupId);
} }
} catch (SQLException e) {
log.error(LogManager.getHeader(context, "Error while adding resource policy information to query", "") ,e);
}
} }
resourceQuery.append(")"); resourceQuery.append(")");
try {
if(AuthorizeManager.isAdmin(context)){
//Admins always have read access even if no policies are present !
resourceQuery.append(" OR (!read:[* TO *])");
}
} catch (SQLException e) {
log.error(LogManager.getHeader(context, "Error while verifying if current user is admin !", ""), e);
}
solrQuery.addFilterQuery(resourceQuery.toString()); solrQuery.addFilterQuery(resourceQuery.toString());
} }
} catch (SQLException e) {
log.error(LogManager.getHeader(context, "Error while adding resource policy information to query", ""), e);
}
}
} }

View File

@@ -100,7 +100,8 @@ public class CCLicenseStep extends AbstractProcessingStep
session.setAttribute("inProgress", "TRUE"); session.setAttribute("inProgress", "TRUE");
// check what submit button was pressed in User Interface // check what submit button was pressed in User Interface
String buttonPressed = Util.getSubmitButton(request, NEXT_BUTTON); String buttonPressed = Util.getSubmitButton(request, NEXT_BUTTON);
if (buttonPressed.equals("submit_grant")) if ("submit_grant".equalsIgnoreCase(buttonPressed)
|| "submit_no_cc".equalsIgnoreCase(buttonPressed))
{ {
return processCC(context, request, response, subInfo); return processCC(context, request, response, subInfo);
} }

View File

@@ -118,7 +118,7 @@ public class LayoutTag extends BodyTagSupport
public LayoutTag() public LayoutTag()
{ {
super(); super();
String template = ConfigurationManager.getProperty("jspui", "template.name"); String template = ConfigurationManager.getProperty("jspui.template.name");
if (StringUtils.isNotBlank(template) if (StringUtils.isNotBlank(template)
&& !"default".equalsIgnoreCase(template)) && !"default".equalsIgnoreCase(template))
{ {

View File

@@ -339,7 +339,7 @@ public class EditItemServlet extends DSpaceServlet
// Withdraw the item // Withdraw the item
item.setDiscoverable(false); item.setDiscoverable(false);
item.withdraw(); item.update();
JSPManager.showJSP(request, response, "/tools/get-item-id.jsp"); JSPManager.showJSP(request, response, "/tools/get-item-id.jsp");
context.complete(); context.complete();
@@ -347,7 +347,7 @@ public class EditItemServlet extends DSpaceServlet
case PUBLICIZE: case PUBLICIZE:
item.setDiscoverable(true); item.setDiscoverable(true);
item.reinstate(); item.update();
JSPManager.showJSP(request, response, "/tools/get-item-id.jsp"); JSPManager.showJSP(request, response, "/tools/get-item-id.jsp");
context.complete(); context.complete();
@@ -536,31 +536,14 @@ public class EditItemServlet extends DSpaceServlet
if (item.isDiscoverable()) if (item.isDiscoverable())
{ {
try request.setAttribute("privating_button", AuthorizeManager
{ .authorizeActionBoolean(context, item, Constants.WRITE));
// who can Withdraw can also Make It Private
AuthorizeUtil.authorizeWithdrawItem(context, item);
request.setAttribute("privating_button", Boolean.TRUE);
}
catch (AuthorizeException authex)
{
request.setAttribute("privating_button", Boolean.FALSE);
}
} }
else else
{ {
try request.setAttribute("publicize_button", AuthorizeManager
{ .authorizeActionBoolean(context, item, Constants.WRITE));
// who can Reinstate can also Make It Public
AuthorizeUtil.authorizeReinstateItem(context, item);
request.setAttribute("publicize_button", Boolean.TRUE);
} }
catch (AuthorizeException authex)
{
request.setAttribute("publicize_button", Boolean.FALSE);
}
}
request.setAttribute("item", item); request.setAttribute("item", item);
request.setAttribute("handle", handle); request.setAttribute("handle", handle);

View File

@@ -84,16 +84,19 @@
<dspace:popup page="<%= LocaleSupport.getLocalizedMessage(pageContext, \"help.site-admin\") + \"#itempolicies\"%>"><fmt:message key="jsp.help"/></dspace:popup> <dspace:popup page="<%= LocaleSupport.getLocalizedMessage(pageContext, \"help.site-admin\") + \"#itempolicies\"%>"><fmt:message key="jsp.help"/></dspace:popup>
</h1> </h1>
<p class="alert alert-info"><fmt:message key="jsp.dspace-admin.authorize-item-edit.text1"/></p> <p class="help-block"><fmt:message key="jsp.dspace-admin.authorize-item-edit.text1"/></p>
<p class="alert alert-info"><fmt:message key="jsp.dspace-admin.authorize-item-edit.text2"/></p> <p class="help-block"><fmt:message key="jsp.dspace-admin.authorize-item-edit.text2"/></p>
<h3><fmt:message key="jsp.dspace-admin.authorize-item-edit.item"/></h3> <div class="panel panel-primary">
<div class="panel-heading"><fmt:message key="jsp.dspace-admin.authorize-item-edit.item"/></div>
<div class="panel-body">
<form method="post" action=""> <form method="post" action="">
<div class="row col-md-offset-5"> <div class="row col-md-offset-4">
<input type="hidden" name="item_id" value="<%=item.getID()%>" /> <input type="hidden" name="item_id" value="<%=item.getID()%>" />
<input class="btn btn-success" type="submit" name="submit_item_add_policy" value="<fmt:message key="jsp.dspace-admin.general.addpolicy"/>" /> <input class="btn btn-success col-md-4" type="submit" name="submit_item_add_policy" value="<fmt:message key="jsp.dspace-admin.general.addpolicy"/>" />
</div> </div>
</form> </form>
<br/>
<table class="table" summary="Item Policy Edit Form"> <table class="table" summary="Item Policy Edit Form">
<tr> <tr>
@@ -123,8 +126,8 @@
<form method="post" action=""> <form method="post" action="">
<input type="hidden" name="policy_id" value="<%= rp.getID() %>" /> <input type="hidden" name="policy_id" value="<%= rp.getID() %>" />
<input type="hidden" name="item_id" value="<%= item.getID() %>" /> <input type="hidden" name="item_id" value="<%= item.getID() %>" />
<input class="btn btn-primary" type="submit" name="submit_item_edit_policy" value="<fmt:message key="jsp.dspace-admin.general.edit"/>" /> <input class="btn btn-primary col-md-4" type="submit" name="submit_item_edit_policy" value="<fmt:message key="jsp.dspace-admin.general.edit"/>" />
<input class="btn btn-danger" type="submit" name="submit_item_delete_policy" value="<fmt:message key="jsp.dspace-admin.general.delete"/>" /> <input class="btn btn-danger col-md-4 col-md-offset-1" type="submit" name="submit_item_delete_policy" value="<fmt:message key="jsp.dspace-admin.general.delete"/>" />
</form> </form>
</td> </td>
</tr> </tr>
@@ -133,6 +136,8 @@
} }
%> %>
</table> </table>
</div>
</div>
<% <%
for( int b = 0; b < bundles.length; b++ ) for( int b = 0; b < bundles.length; b++ )
{ {
@@ -143,19 +148,21 @@
// display bundle header w/ID // display bundle header w/ID
%> %>
<h3><fmt:message key="jsp.dspace-admin.authorize-item-edit.bundle"> <div class="panel panel-info">
<div class="panel-heading">
<fmt:message key="jsp.dspace-admin.authorize-item-edit.bundle">
<fmt:param><%=myBun.getName()%></fmt:param> <fmt:param><%=myBun.getName()%></fmt:param>
<fmt:param><%=myBun.getID()%></fmt:param> <fmt:param><%=myBun.getID()%></fmt:param>
</fmt:message></h3> </fmt:message></div>
<div class="panel-body">
<form method="post" action=""> <form method="post" action="">
<div class="row col-md-offset-5"> <div class="row col-md-offset-4">
<input type="hidden" name="item_id" value="<%=item.getID()%>" /> <input type="hidden" name="item_id" value="<%=item.getID()%>" />
<input type="hidden" name="bundle_id" value="<%=myBun.getID()%>" /> <input type="hidden" name="bundle_id" value="<%=myBun.getID()%>" />
<input class="btn btn-success" type="submit" name="submit_bundle_add_policy" value="<fmt:message key="jsp.dspace-admin.general.addpolicy"/>" /> <input class="btn btn-success col-md-4" type="submit" name="submit_bundle_add_policy" value="<fmt:message key="jsp.dspace-admin.general.addpolicy"/>" />
</div> </div>
</form> </form>
<br/>
<table class="table" summary="Bundle Policy Edit Form"> <table class="table" summary="Bundle Policy Edit Form">
<tr> <tr>
<th class="oddRowOddCol"><strong><fmt:message key="jsp.general.id" /></strong></th> <th class="oddRowOddCol"><strong><fmt:message key="jsp.general.id" /></strong></th>
@@ -186,8 +193,8 @@
<input type="hidden" name="policy_id" value="<%= rp.getID() %>" /> <input type="hidden" name="policy_id" value="<%= rp.getID() %>" />
<input type="hidden" name="item_id" value="<%= item.getID() %>" /> <input type="hidden" name="item_id" value="<%= item.getID() %>" />
<input type="hidden" name="bundle_id" value="<%= myBun.getID() %>" /> <input type="hidden" name="bundle_id" value="<%= myBun.getID() %>" />
<input class="btn btn-primary" type="submit" name="submit_item_edit_policy" value="<fmt:message key="jsp.dspace-admin.general.edit"/>" /> <input class="btn btn-primary col-md-4" type="submit" name="submit_item_edit_policy" value="<fmt:message key="jsp.dspace-admin.general.edit"/>" />
<input class="btn btn-danger" type="submit" name="submit_item_delete_policy" value="<fmt:message key="jsp.dspace-admin.general.delete"/>" /> <input class="btn btn-danger col-md-4 col-md-offset-1" type="submit" name="submit_item_delete_policy" value="<fmt:message key="jsp.dspace-admin.general.delete"/>" />
</form> </form>
</td> </td>
</tr> </tr>
@@ -196,7 +203,6 @@
} }
%> %>
</table> </table>
<% <%
Bitstream [] bitstreams = myBun.getBitstreams(); Bitstream [] bitstreams = myBun.getBitstreams();
@@ -209,17 +215,22 @@
// 'add policy' // 'add policy'
// display bitstream's policies // display bitstream's policies
%> %>
<p><fmt:message key="jsp.dspace-admin.authorize-item-edit.bitstream"> <div class="panel panel-success">
<div class="panel-heading">
<fmt:message key="jsp.dspace-admin.authorize-item-edit.bitstream">
<fmt:param><%=myBits.getID()%></fmt:param> <fmt:param><%=myBits.getID()%></fmt:param>
<fmt:param><%=myBits.getName()%></fmt:param> <fmt:param><%=myBits.getName()%></fmt:param>
</fmt:message></p> </fmt:message></div>
<div class="panel-body">
<form method="post" action=""> <form method="post" action="">
<div class="row col-md-offset-5"> <div class="row col-md-offset-4">
<input type="hidden" name="item_id"value="<%=item.getID()%>" /> <input type="hidden" name="item_id"value="<%=item.getID()%>" />
<input type="hidden" name="bitstream_id" value="<%=myBits.getID()%>" /> <input type="hidden" name="bitstream_id" value="<%=myBits.getID()%>" />
<input class="btn btn-success" type="submit" name="submit_bitstream_add_policy" value="<fmt:message key="jsp.dspace-admin.general.addpolicy"/>" /> <input class="btn btn-success col-md-4" type="submit" name="submit_bitstream_add_policy" value="<fmt:message key="jsp.dspace-admin.general.addpolicy"/>" />
</div> </div>
</form> </form>
<br/>
<table class="table" summary="This table displays the bitstream data"> <table class="table" summary="This table displays the bitstream data">
<tr> <tr>
<th class="oddRowOddCol"><strong><fmt:message key="jsp.general.id" /></strong></th> <th class="oddRowOddCol"><strong><fmt:message key="jsp.general.id" /></strong></th>
@@ -250,8 +261,8 @@
<input type="hidden" name="policy_id" value="<%= rp.getID() %>" /> <input type="hidden" name="policy_id" value="<%= rp.getID() %>" />
<input type="hidden" name="item_id" value="<%= item.getID() %>" /> <input type="hidden" name="item_id" value="<%= item.getID() %>" />
<input type="hidden" name="bitstream_id" value="<%= myBits.getID() %>" /> <input type="hidden" name="bitstream_id" value="<%= myBits.getID() %>" />
<input class="btn btn-primary" type="submit" name="submit_item_edit_policy" value="<fmt:message key="jsp.dspace-admin.general.edit"/>" /> <input class="btn btn-primary col-md-4" type="submit" name="submit_item_edit_policy" value="<fmt:message key="jsp.dspace-admin.general.edit"/>" />
<input class="btn btn-danger" type="submit" name="submit_item_delete_policy" value="<fmt:message key="jsp.dspace-admin.general.delete"/>" /> <input class="btn btn-danger col-md-4 col-md-offset-1" type="submit" name="submit_item_delete_policy" value="<fmt:message key="jsp.dspace-admin.general.delete"/>" />
</form> </form>
</td> </td>
</tr> </tr>
@@ -260,9 +271,15 @@
} }
%> %>
</table> </table>
</div>
</div>
<% <%
} }
%>
</div>
</div>
<%
} }
%> %>
</dspace:layout> </dspace:layout>

View File

@@ -135,12 +135,19 @@ if (submissions != null && submissions.count() > 0)
{ {
displayTitle = dcv[0].value; displayTitle = dcv[0].value;
} }
dcv = item.getMetadata("dc", "description", "abstract", Item.ANY);
String displayAbstract = "";
if (dcv != null & dcv.length > 0)
{
displayAbstract = dcv[0].value;
}
%> %>
<div style="padding-bottom: 50px; min-height: 200px;" class="item <%= first?"active":""%>"> <div style="padding-bottom: 50px; min-height: 200px;" class="item <%= first?"active":""%>">
<div style="padding-left: 80px; padding-right: 80px; display: inline-block;"><%= StringUtils.abbreviate(displayTitle, 400) %> <div style="padding-left: 80px; padding-right: 80px; display: inline-block;"><%= StringUtils.abbreviate(displayTitle, 400) %>
<a href="<%= request.getContextPath() %>/handle/<%=item.getHandle() %>"> <a href="<%= request.getContextPath() %>/handle/<%=item.getHandle() %>">
<button class="btn btn-success" type="button">See</button> <button class="btn btn-success" type="button">See</button>
</a> </a>
<p><%= StringUtils.abbreviate(displayAbstract, 500) %></p>
</div> </div>
</div> </div>
<% <%
@@ -195,19 +202,20 @@ if (communities != null && communities.length != 0)
<% } else { %> <% } else { %>
<div class="col-md-12"> <div class="col-md-12">
<% } %> <% } %>
<h4 class="list-group-item-heading"><a href="<%= request.getContextPath() %>/handle/<%= communities[i].getHandle() %>"><%= communities[i].getMetadata("name") %></a></h4> <h4 class="list-group-item-heading"><a href="<%= request.getContextPath() %>/handle/<%= communities[i].getHandle() %>"><%= communities[i].getMetadata("name") %></a>
<p><%= communities[i].getMetadata("short_description") %></p>
</div>
</div>
<% <%
if (ConfigurationManager.getBooleanProperty("webui.strengths.show")) if (ConfigurationManager.getBooleanProperty("webui.strengths.show"))
{ {
%> %>
[<%= ic.getCount(communities[i]) %>] <span class="badge pull-right"><%= ic.getCount(communities[i]) %></span>
<% <%
} }
%> %>
</h4>
<p><%= communities[i].getMetadata("short_description") %></p>
</div>
</div>
<% <%
} }
%> %>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -39,11 +39,11 @@
</main> </main>
<%-- Page footer --%> <%-- Page footer --%>
<footer class="navbar navbar-inverse navbar-bottom"> <footer class="navbar navbar-inverse navbar-bottom">
<div class="container text-muted" style="padding:5px;"> <div id="designedby" class="container text-muted">
<fmt:message key="jsp.layout.footer-default.theme-by"/> <a href="http://www.cineca.it"><img <fmt:message key="jsp.layout.footer-default.theme-by"/> <a href="http://www.cineca.it"><img
src="<%= request.getContextPath() %>/image/logo-cineca-small.png" src="<%= request.getContextPath() %>/image/logo-cineca-small.png"
alt="Logo CINECA" height="45" width="42" style="border:5px solid white;"/></a> alt="Logo CINECA" /></a>
<div class="pull-right" style="padding-top:10px;"> <div id="footer_feedback" class="pull-right">
<p class="text-muted"><fmt:message key="jsp.layout.footer-default.text"/>&nbsp;- <p class="text-muted"><fmt:message key="jsp.layout.footer-default.text"/>&nbsp;-
<a target="_blank" href="<%= request.getContextPath() %>/feedback"><fmt:message key="jsp.layout.footer-default.feedback"/></a> <a target="_blank" href="<%= request.getContextPath() %>/feedback"><fmt:message key="jsp.layout.footer-default.feedback"/></a>
<a href="<%= request.getContextPath() %>/htmlmap"></a></p> <a href="<%= request.getContextPath() %>/htmlmap"></a></p>

View File

@@ -121,7 +121,7 @@
<%-- HACK: leftmargin, topmargin: for non-CSS compliant Microsoft IE browser --%> <%-- HACK: leftmargin, topmargin: for non-CSS compliant Microsoft IE browser --%>
<%-- HACK: marginwidth, marginheight: for non-CSS compliant Netscape browser --%> <%-- HACK: marginwidth, marginheight: for non-CSS compliant Netscape browser --%>
<body style="padding-top: 55px;"> <body class="undernavigation">
<a class="sr-only" href="#content">Skip navigation</a> <a class="sr-only" href="#content">Skip navigation</a>
<header class="navbar navbar-inverse navbar-fixed-top"> <header class="navbar navbar-inverse navbar-fixed-top">
<% <%
@@ -136,7 +136,7 @@
%> %>
</header> </header>
<main id="content" role="main" style="padding-bottom:60px;"> <main id="content" role="main">
<div class="container banner"> <div class="container banner">
<div class="row"> <div class="row">
<div class="col-md-9 brand"> <div class="col-md-9 brand">

View File

@@ -121,7 +121,7 @@
<%-- HACK: leftmargin, topmargin: for non-CSS compliant Microsoft IE browser --%> <%-- HACK: leftmargin, topmargin: for non-CSS compliant Microsoft IE browser --%>
<%-- HACK: marginwidth, marginheight: for non-CSS compliant Netscape browser --%> <%-- HACK: marginwidth, marginheight: for non-CSS compliant Netscape browser --%>
<body style="padding-top: 65px;"> <body class="undernavigation">
<a class="sr-only" href="#content">Skip navigation</a> <a class="sr-only" href="#content">Skip navigation</a>
<header class="navbar navbar-inverse navbar-fixed-top"> <header class="navbar navbar-inverse navbar-fixed-top">
<% <%
@@ -136,7 +136,7 @@
%> %>
</header> </header>
<main id="content" role="main" style="padding-bottom:60px;"> <main id="content" role="main">
<%-- Location bar --%> <%-- Location bar --%>
<% <%
if (locbar) if (locbar)

View File

@@ -68,6 +68,7 @@
<li><a href="<%= request.getContextPath() %>/dspace-admin/supervise"><fmt:message key="jsp.layout.navbar-admin.supervisors"/></a></li> <li><a href="<%= request.getContextPath() %>/dspace-admin/supervise"><fmt:message key="jsp.layout.navbar-admin.supervisors"/></a></li>
<li><a href="<%= request.getContextPath() %>/dspace-admin/curate"><fmt:message key="jsp.layout.navbar-admin.curate"/></a></li> <li><a href="<%= request.getContextPath() %>/dspace-admin/curate"><fmt:message key="jsp.layout.navbar-admin.curate"/></a></li>
<li><a href="<%= request.getContextPath() %>/dspace-admin/withdrawn"><fmt:message key="jsp.layout.navbar-admin.withdrawn"/></a></li> <li><a href="<%= request.getContextPath() %>/dspace-admin/withdrawn"><fmt:message key="jsp.layout.navbar-admin.withdrawn"/></a></li>
<li><a href="<%= request.getContextPath() %>/dspace-admin/privateitems"><fmt:message key="jsp.layout.navbar-admin.privateitems"/></a></li>
<li><a href="<%= request.getContextPath() %>/dspace-admin/metadataimport"><fmt:message key="jsp.layout.navbar-admin.metadataimport"/></a></li> <li><a href="<%= request.getContextPath() %>/dspace-admin/metadataimport"><fmt:message key="jsp.layout.navbar-admin.metadataimport"/></a></li>
<li><a href="<%= request.getContextPath() %>/dspace-admin/batchmetadataimport"><fmt:message key="jsp.layout.navbar-admin.batchmetadataimport"/></a></li> <li><a href="<%= request.getContextPath() %>/dspace-admin/batchmetadataimport"><fmt:message key="jsp.layout.navbar-admin.batchmetadataimport"/></a></li>
</ul> </ul>

View File

@@ -399,4 +399,6 @@
<% } %> <% } %>
</ol> </ol>
<%} %> <%} %>
</div>
</div>
</dspace:layout> </dspace:layout>

View File

@@ -85,11 +85,11 @@
<label for="allfiles" class="control-label col-md-2"><fmt:message key="jsp.request.item.request-form.allfiles"/></label> <label for="allfiles" class="control-label col-md-2"><fmt:message key="jsp.request.item.request-form.allfiles"/></label>
<div class="col-md-10"> <div class="col-md-10">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><input type="radio" class="form-control" name="allfiles" value="true" <%=allfiles?"checked":""%> /></span> <span class="input-group-addon"><input type="radio" name="allfiles" value="true" <%=allfiles?"checked":""%> /></span>
<span class="form-control"><fmt:message key="jsp.request.item.request-form.yes"/></span> <span class="form-control"><fmt:message key="jsp.request.item.request-form.yes"/></span>
</div> </div>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><input type="radio" class="form-control" name="allfiles" value="false" <%=allfiles?"":"checked"%> /></span> <span class="input-group-addon"><input type="radio" name="allfiles" value="false" <%=allfiles?"":"checked"%> /></span>
<span class="form-control"><fmt:message key="jsp.request.item.request-form.no"/></span> <span class="form-control"><fmt:message key="jsp.request.item.request-form.no"/></span>
</div> </div>
</div> </div>

View File

@@ -10,7 +10,10 @@
.brand h4 {color: #999999} .brand h4 {color: #999999}
ol.breadcrumb li {color: white; font-style: italic;} ol.breadcrumb li {color: white; font-style: italic;}
ol.breadcrumb li a {color: white; font-weight: bold; font-style: normal;} ol.breadcrumb li a {color: white; font-weight: bold; font-style: normal;}
body {overflow-x: hidden;} body.undernavigation {overflow-x: hidden; padding-top: 65px;}
#content {padding-bottom:60px;}
#designedby {padding: 5px;}
#footer_feedback {padding-top: 12px;}
input[type="file"] {display: block;height: auto;} input[type="file"] {display: block;height: auto;}
div.panel-primary div.panel-heading a {color: white;} div.panel-primary div.panel-heading a {color: white;}
/* This magic gets the 16x16 icon to show up.. setting height/width didn't /* This magic gets the 16x16 icon to show up.. setting height/width didn't

View File

@@ -25,5 +25,5 @@
<script type="text/javascript"> <script type="text/javascript">
the_form = parent.document.getElementById("license_form"); the_form = parent.document.getElementById("license_form");
the_form.cc_license_url.value = "<%= cc_license_url %>"; the_form.cc_license_url.value = "<%= cc_license_url %>";
the_form.submit(); parent.document.getElementById("submit_grant").click();
</script> </script>

View File

@@ -62,7 +62,8 @@
licenseURL = CreativeCommons.getLicenseURL(subInfo.getSubmissionItem().getItem()); licenseURL = CreativeCommons.getLicenseURL(subInfo.getSubmissionItem().getItem());
%> %>
<dspace:layout locbar="off" <dspace:layout style="submission"
locbar="off"
navbar="off" navbar="off"
titlekey="jsp.submit.creative-commons.title" titlekey="jsp.submit.creative-commons.title"
nocache="true"> nocache="true">
@@ -73,7 +74,6 @@
<%-- <h1>Submit: Use a Creative Commons License</h1> --%> <%-- <h1>Submit: Use a Creative Commons License</h1> --%>
<h1><fmt:message key="jsp.submit.creative-commons.heading"/></h1> <h1><fmt:message key="jsp.submit.creative-commons.heading"/></h1>
<br />
<% <%
if (licenseExists) if (licenseExists)
@@ -81,13 +81,13 @@
%> %>
<%-- <p>You have already chosen a Creative Commons license and added it to this item. <%-- <p>You have already chosen a Creative Commons license and added it to this item.
You may:</p> --%> You may:</p> --%>
<p><fmt:message key="jsp.submit.creative-commons.info1"/></p> <p class="help-block"><fmt:message key="jsp.submit.creative-commons.info1"/></p>
<%-- <ul> <%-- <ul>
<li>Press the 'Next' button below to <em>keep</em> the license previously chosen.</li> <li>Press the 'Next' button below to <em>keep</em> the license previously chosen.</li>
<li>Press the 'Skip Creative Commons' button below to <em>remove</em> the current choice, and forego a Creative Commons license.</li> <li>Press the 'Skip Creative Commons' button below to <em>remove</em> the current choice, and forego a Creative Commons license.</li>
<li>Complete the selection process below to <em>replace</em> the current choice.</li> <li>Complete the selection process below to <em>replace</em> the current choice.</li>
</ul> --%> </ul> --%>
<ul> <ul class="alert alert-info">
<li><fmt:message key="jsp.submit.creative-commons.choice1"/></li> <li><fmt:message key="jsp.submit.creative-commons.choice1"/></li>
<li><fmt:message key="jsp.submit.creative-commons.choice2"/></li> <li><fmt:message key="jsp.submit.creative-commons.choice2"/></li>
<li><fmt:message key="jsp.submit.creative-commons.choice3"/></li> <li><fmt:message key="jsp.submit.creative-commons.choice3"/></li>
@@ -113,37 +113,28 @@
<%= SubmissionController.getSubmissionParameters(context, request) %> <%= SubmissionController.getSubmissionParameters(context, request) %>
<input type="hidden" name="cc_license_url" value="<%=licenseURL %>" /> <input type="hidden" name="cc_license_url" value="<%=licenseURL %>" />
<input type="hidden" name="submit_grant" value="I Grant the License" /> <input type="submit" id="submit_grant" name="submit_grant" value="submit_grant" style="display: none;" />
<center> <%
<table border="0" width="80%"> int numButton = 2 + (!SubmissionController.isFirstStep(request, subInfo)?1:0) + (licenseExists?1:0);
<tr>
<td width="100%">&nbsp;</td> %>
<div class="row col-md-<%= 2*numButton %> pull-right btn-group">
<% //if not first step, show "Previous" button <% //if not first step, show "Previous" button
if(!SubmissionController.isFirstStep(request, subInfo)) if(!SubmissionController.isFirstStep(request, subInfo))
{ %> { %>
<td> <input class="btn btn-default col-md-<%= 12 / numButton %>" type="submit" name="<%=AbstractProcessingStep.PREVIOUS_BUTTON%>" value="<fmt:message key="jsp.submit.general.previous"/>" />
<input type="submit" name="<%=AbstractProcessingStep.PREVIOUS_BUTTON%>" value="<fmt:message key="jsp.submit.general.previous"/>" />
</td>
<% } %> <% } %>
<input class="btn btn-default col-md-<%= 12 / numButton %>" type="submit" name="<%=AbstractProcessingStep.CANCEL_BUTTON%>" value="<fmt:message key="jsp.submit.general.cancel-or-save.button"/>"/>
<input class="btn btn-warning col-md-<%= 12 / numButton %>" type="submit" name="submit_no_cc" value="<fmt:message key="jsp.submit.creative-commons.skip.button"/>"/>
<% <%
if (licenseExists) if (licenseExists)
{ {
%> %>
<td> <input class="btn btn-primary col-md-<%= 12 / numButton %>" type="submit" name="<%=AbstractProcessingStep.NEXT_BUTTON%>" value="<fmt:message key="jsp.submit.general.next"/>" />
<input type="submit" name="<%=AbstractProcessingStep.NEXT_BUTTON%>" value="<fmt:message key="jsp.submit.general.next"/>" />
</td>
<% <%
} }
%> %>
<td> </div>
<input type="submit" name="submit_no_cc" value="<fmt:message key="jsp.submit.creative-commons.skip.button"/>"/>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td align="right">
<input type="submit" name="<%=AbstractProcessingStep.CANCEL_BUTTON%>" value="<fmt:message key="jsp.submit.general.cancel-or-save.button"/>"/>
</td>
</tr>
</table>
</center>
</form> </form>
</dspace:layout> </dspace:layout>

View File

@@ -477,4 +477,5 @@
<input class="btn btn-warning col-md-6" type="submit" name="submit_cancel" value="<fmt:message key="jsp.tools.edit-collection.form.button.cancel"/>" /> <input class="btn btn-warning col-md-6" type="submit" name="submit_cancel" value="<fmt:message key="jsp.tools.edit-collection.form.button.cancel"/>" />
</div> </div>
</form> </form>
</div>
</dspace:layout> </dspace:layout>

View File

@@ -175,9 +175,9 @@ public class XOAI
.println("Incremental import. Searching for documents modified after: " .println("Incremental import. Searching for documents modified after: "
+ last.toString()); + last.toString());
String sqlQuery = "SELECT item_id FROM item WHERE in_archive=TRUE AND last_modified > ?"; String sqlQuery = "SELECT item_id FROM item WHERE in_archive=TRUE AND discoverable=TRUE AND last_modified > ?";
if(DatabaseManager.isOracle()){ if(DatabaseManager.isOracle()){
sqlQuery = "SELECT item_id FROM item WHERE in_archive=1 AND last_modified > ?"; sqlQuery = "SELECT item_id FROM item WHERE in_archive=1 AND discoverable=1 AND last_modified > ?";
} }
try try
@@ -200,9 +200,9 @@ public class XOAI
try try
{ {
String sqlQuery = "SELECT item_id FROM item WHERE in_archive=TRUE"; String sqlQuery = "SELECT item_id FROM item WHERE in_archive=TRUE AND discoverable=TRUE";
if(DatabaseManager.isOracle()){ if(DatabaseManager.isOracle()){
sqlQuery = "SELECT item_id FROM item WHERE in_archive=1"; sqlQuery = "SELECT item_id FROM item WHERE in_archive=1 AND discoverable=1";
} }
TableRowIterator iterator = DatabaseManager.query(_context, TableRowIterator iterator = DatabaseManager.query(_context,

View File

@@ -333,8 +333,6 @@ public class FlowItemUtils
Item item = Item.find(context, itemID); Item item = Item.find(context, itemID);
item.setDiscoverable(false); item.setDiscoverable(false);
// private item is withdrawn as well
item.withdraw();
item.update(); item.update();
context.commit(); context.commit();
@@ -359,8 +357,6 @@ public class FlowItemUtils
Item item = Item.find(context, itemID); Item item = Item.find(context, itemID);
item.setDiscoverable(true); item.setDiscoverable(true);
// since private Items are withdrawn they are reinstated during "make it public" process
item.reinstate();
item.update(); item.update();
context.commit(); context.commit();

View File

@@ -216,27 +216,26 @@ public class EditItemStatusForm extends AbstractDSpaceTransformer {
if(item.isDiscoverable()) if(item.isDiscoverable())
{ {
itemInfo.addLabel(T_label_private); itemInfo.addLabel(T_label_private);
try if (AuthorizeManager.authorizeActionBoolean(context, item,
Constants.WRITE))
{ {
// who can Withdraw can also Make It Private itemInfo.addItem().addButton("submit_private")
AuthorizeUtil.authorizeWithdrawItem(context, item); .setValue(T_submit_private);
itemInfo.addItem().addButton("submit_private").setValue(T_submit_private);
} }
catch (AuthorizeException authex) else
{ {
addNotAllowedButton(itemInfo.addItem(), "submit_private", T_submit_private); addNotAllowedButton(itemInfo.addItem(), "submit_private",
T_submit_private);
} }
} }
else else
{ {
itemInfo.addLabel(T_label_public); itemInfo.addLabel(T_label_public);
try if (AuthorizeManager.authorizeActionBoolean(context, item, Constants.WRITE))
{ {
// who can Reinstate can also Make It Public
AuthorizeUtil.authorizeReinstateItem(context, item);
itemInfo.addItem().addButton("submit_public").setValue(T_submit_public); itemInfo.addItem().addButton("submit_public").setValue(T_submit_public);
} }
catch (AuthorizeException authex) else
{ {
addNotAllowedButton(itemInfo.addItem(), "submit_public", T_submit_public); addNotAllowedButton(itemInfo.addItem(), "submit_public", T_submit_public);
} }

View File

@@ -366,8 +366,9 @@
have some sort of hard autoCommit to limit the log size. have some sort of hard autoCommit to limit the log size.
--> -->
<autoCommit> <autoCommit>
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime> <maxDocs>10000</maxDocs> <!--Commit every 10.000 documents-->
<openSearcher>false</openSearcher> <maxTime>${solr.autoCommit.maxTime:10000}</maxTime> <!--Default commit every 10 seconds-->
<openSearcher>true</openSearcher>
</autoCommit> </autoCommit>
<!-- softAutoCommit is like autoCommit except it causes a <!-- softAutoCommit is like autoCommit except it causes a

View File

@@ -366,8 +366,9 @@
have some sort of hard autoCommit to limit the log size. have some sort of hard autoCommit to limit the log size.
--> -->
<autoCommit> <autoCommit>
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime> <maxDocs>10000</maxDocs> <!--Commit every 10.000 documents-->
<openSearcher>false</openSearcher> <maxTime>${solr.autoCommit.maxTime:10000}</maxTime> <!--Default commit every 10 seconds-->
<openSearcher>true</openSearcher>
</autoCommit> </autoCommit>
<!-- softAutoCommit is like autoCommit except it causes a <!-- softAutoCommit is like autoCommit except it causes a

View File

@@ -366,8 +366,9 @@
have some sort of hard autoCommit to limit the log size. have some sort of hard autoCommit to limit the log size.
--> -->
<autoCommit> <autoCommit>
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime> <maxDocs>10000</maxDocs> <!--Commit every 10.000 documents-->
<openSearcher>false</openSearcher> <maxTime>${solr.autoCommit.maxTime:900000}</maxTime> <!--Default commit every 15 minutes-->
<openSearcher>true</openSearcher>
</autoCommit> </autoCommit>
<!-- softAutoCommit is like autoCommit except it causes a <!-- softAutoCommit is like autoCommit except it causes a