Allow for select-collection optimization to be disabled

Since there could be a potential edge case where the optimization falters
We'll provide a simple fallback to revert to using the original query
This commit is contained in:
Peter Dietz
2014-10-28 01:50:42 -04:00
parent 8ad0eca0b1
commit 7e893ffb38
3 changed files with 11 additions and 1 deletions

View File

@@ -1506,6 +1506,11 @@ public class Collection extends DSpaceObject
public static Collection[] findAuthorizedOptimized(Context context, int actionID) throws java.sql.SQLException public static Collection[] findAuthorizedOptimized(Context context, int actionID) throws java.sql.SQLException
{ {
if(! ConfigurationManager.getBooleanProperty("org.dspace.content.Collection.findAuthorizedPerformanceOptimize", true)) {
// Fallback to legacy query if config says so. The rationale could be that a site found a bug.
return findAuthorized(context, null, actionID);
}
List<Collection> myResults = new ArrayList<Collection>(); List<Collection> myResults = new ArrayList<Collection>();
if(AuthorizeManager.isAdmin(context)) if(AuthorizeManager.isAdmin(context))

View File

@@ -709,7 +709,7 @@
<message key="xmlui.Submission.submit.ResumeStep.submit_resume">Resume</message> <message key="xmlui.Submission.submit.ResumeStep.submit_resume">Resume</message>
<!-- org.dspace.app.xmlui.Submission.submit.SelectCollection --> <!-- org.dspace.app.xmlui.Submission.submit.SelectCollection -->
<message key="batch">Select a collection</message> <message key="xmlui.Submission.submit.SelectCollection.head">Select a collection</message>
<message key="xmlui.Submission.submit.SelectCollection.collection">Collection</message> <message key="xmlui.Submission.submit.SelectCollection.collection">Collection</message>
<message key="xmlui.Submission.submit.SelectCollection.collection_help">Select the collection you wish to submit an item to.</message> <message key="xmlui.Submission.submit.SelectCollection.collection_help">Select the collection you wish to submit an item to.</message>
<message key="xmlui.Submission.submit.SelectCollection.collection_default">Select a collection...</message> <message key="xmlui.Submission.submit.SelectCollection.collection_default">Select a collection...</message>

View File

@@ -814,6 +814,11 @@ org.dspace.app.itemexport.max.size = 200
# The directory where the results of imports will be placed (mapfile, upload file) # The directory where the results of imports will be placed (mapfile, upload file)
org.dspace.app.batchitemimport.work.dir = ${dspace.dir}/imports org.dspace.app.batchitemimport.work.dir = ${dspace.dir}/imports
# Enable performance optimization for select-collection-step collection query
# The only reason you might opt-out is in case the optimized algorithm missed a policy
# default = true, (enabled)
#org.dspace.content.Collection.findAuthorizedPerformanceOptimize = false
# For backwards compatibility, the subscription emails by default include any modified items # For backwards compatibility, the subscription emails by default include any modified items
# uncomment the following entry for only new items to be emailed # uncomment the following entry for only new items to be emailed
# eperson.subscription.onlynew = true # eperson.subscription.onlynew = true