mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 12:03:09 +00:00
[DS-707] Correctness
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5633 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -528,11 +528,11 @@ public class X509Authentication implements AuthenticationMethod
|
||||
|
||||
if (authenticated)
|
||||
{
|
||||
List<String> groupNames = new ArrayList<String>();
|
||||
List<String> groupNames = getX509Groups();
|
||||
List<Integer> groupIDs = new ArrayList<Integer>();
|
||||
|
||||
groupNames = getX509Groups();
|
||||
|
||||
if (groupNames != null)
|
||||
{
|
||||
for (String groupName : groupNames)
|
||||
{
|
||||
if (groupName != null)
|
||||
@@ -550,6 +550,7 @@ public class X509Authentication implements AuthenticationMethod
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int[] results = new int[groupIDs.size()];
|
||||
for (int i = 0; i < groupIDs.size(); i++)
|
||||
|
@@ -204,6 +204,7 @@ public class DSIndexer
|
||||
{
|
||||
case 3:
|
||||
indexConfigArr[i].qualifier = parts[2];
|
||||
// Fall through for other parts of the array
|
||||
case 2:
|
||||
indexConfigArr[i].schema = parts[0];
|
||||
indexConfigArr[i].element = parts[1];
|
||||
|
@@ -78,11 +78,11 @@ public class UsageEvent extends Event {
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private HttpServletRequest request;
|
||||
private transient HttpServletRequest request;
|
||||
|
||||
private Context context;
|
||||
private transient Context context;
|
||||
|
||||
private DSpaceObject object;
|
||||
private transient DSpaceObject object;
|
||||
|
||||
private Action action;
|
||||
|
||||
|
@@ -1018,9 +1018,6 @@ public class WorkflowManager
|
||||
private static void recordStart(Context c, Item myitem)
|
||||
throws SQLException, IOException, AuthorizeException
|
||||
{
|
||||
// Get non-internal format bitstreams
|
||||
Bitstream[] bitstreams = myitem.getNonInternalBitstreams();
|
||||
|
||||
// get date
|
||||
DCDate now = DCDate.getCurrent();
|
||||
|
||||
|
@@ -804,7 +804,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
} catch (Exception e) {
|
||||
// this will never happen, but compiler is now
|
||||
// happy.
|
||||
// log.error(e.getMessage(), e);
|
||||
log.trace(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ public class BrowseListTag extends TagSupport
|
||||
private static Logger log = Logger.getLogger(BrowseListTag.class);
|
||||
|
||||
/** Items to display */
|
||||
private BrowseItem[] items;
|
||||
private transient BrowseItem[] items;
|
||||
|
||||
/** Row to highlight, -1 for no row */
|
||||
private int highlightRow = -1;
|
||||
@@ -125,7 +125,9 @@ public class BrowseListTag extends TagSupport
|
||||
|
||||
private static int authorLimit = -1;
|
||||
|
||||
private BrowseInfo browseInfo;
|
||||
private transient BrowseInfo browseInfo;
|
||||
|
||||
private static final long serialVersionUID = 8091584920304256107L;
|
||||
|
||||
public BrowseListTag()
|
||||
{
|
||||
|
@@ -59,7 +59,9 @@ import org.dspace.content.Collection;
|
||||
public class CollectionListTag extends TagSupport
|
||||
{
|
||||
/** Collections to display */
|
||||
private Collection[] collections;
|
||||
private transient Collection[] collections;
|
||||
|
||||
private static final long serialVersionUID = -9040013543196580904L;
|
||||
|
||||
public CollectionListTag()
|
||||
{
|
||||
|
@@ -60,7 +60,9 @@ import org.dspace.content.Community;
|
||||
public class CommunityListTag extends TagSupport
|
||||
{
|
||||
/** Communities to display */
|
||||
private Community[] communities;
|
||||
private transient Community[] communities;
|
||||
|
||||
private static final long serialVersionUID = 5788338729470292501L;
|
||||
|
||||
public CommunityListTag()
|
||||
{
|
||||
|
@@ -58,11 +58,13 @@ import org.dspace.content.DCDate;
|
||||
public class DateTag extends TagSupport
|
||||
{
|
||||
/** The date to display */
|
||||
private DCDate date;
|
||||
private transient DCDate date;
|
||||
|
||||
/** Display the time? */
|
||||
private boolean displayTime = true;
|
||||
|
||||
private static final long serialVersionUID = 6665825578727713535L;
|
||||
|
||||
/**
|
||||
* Get the date
|
||||
*
|
||||
|
@@ -93,7 +93,7 @@ public class ItemListTag extends TagSupport
|
||||
private static Logger log = Logger.getLogger(ItemListTag.class);
|
||||
|
||||
/** Items to display */
|
||||
private Item[] items;
|
||||
private transient Item[] items;
|
||||
|
||||
/** Row to highlight, -1 for no row */
|
||||
private int highlightRow = -1;
|
||||
@@ -134,7 +134,9 @@ public class ItemListTag extends TagSupport
|
||||
|
||||
private static int authorLimit = -1;
|
||||
|
||||
private SortOption sortOption = null;
|
||||
private transient SortOption sortOption = null;
|
||||
|
||||
private static final long serialVersionUID = 348762897199116432L;
|
||||
|
||||
public ItemListTag()
|
||||
{
|
||||
|
@@ -69,7 +69,9 @@ import javax.servlet.jsp.tagext.TagSupport;
|
||||
public class ItemPreviewTag extends TagSupport
|
||||
{
|
||||
/** Item to display */
|
||||
private Item item;
|
||||
private transient Item item;
|
||||
|
||||
private static final long serialVersionUID = -5535762797556685631L;
|
||||
|
||||
public ItemPreviewTag()
|
||||
{
|
||||
|
@@ -213,10 +213,10 @@ public class ItemTag extends TagSupport
|
||||
private static final String DOI_DEFAULT_BASEURL = "http://dx.doi.org/";
|
||||
|
||||
/** Item to display */
|
||||
private Item item;
|
||||
private transient Item item;
|
||||
|
||||
/** Collections this item appears in */
|
||||
private Collection[] collections;
|
||||
private transient Collection[] collections;
|
||||
|
||||
/** The style to use - "default" or "full" */
|
||||
private String style;
|
||||
@@ -241,6 +241,8 @@ public class ItemTag extends TagSupport
|
||||
/** regex pattern to capture the style of a field, ie <code>schema.element.qualifier(style)</code> */
|
||||
private Pattern fieldStylePatter = Pattern.compile(".*\\((.*)\\)");
|
||||
|
||||
private static final long serialVersionUID = -3841266490729417240L;
|
||||
|
||||
public ItemTag()
|
||||
{
|
||||
super();
|
||||
|
@@ -62,12 +62,14 @@ public class SFXLinkTag extends TagSupport
|
||||
{
|
||||
/** Item to display SFX link for */
|
||||
|
||||
private Item item;
|
||||
private transient Item item;
|
||||
|
||||
/** The fully qualified pathname of the SFX XML file */
|
||||
private String sfxFile = ConfigurationManager.getProperty("dspace.dir") + File.separator
|
||||
+ "config" + File.separator + "sfx.xml";
|
||||
|
||||
private static final long serialVersionUID = 7028793612957710128L;
|
||||
|
||||
public SFXLinkTag()
|
||||
{
|
||||
super();
|
||||
|
@@ -79,7 +79,9 @@ public class SelectEPersonTag extends TagSupport
|
||||
private boolean multiple;
|
||||
|
||||
/** Which eperson/epeople are initially in the list? */
|
||||
private EPerson[] epeople;
|
||||
private transient EPerson[] epeople;
|
||||
|
||||
private static final long serialVersionUID = -7323789442034590853L;
|
||||
|
||||
public SelectEPersonTag()
|
||||
{
|
||||
|
@@ -75,7 +75,9 @@ public class SelectGroupTag extends TagSupport
|
||||
private boolean multiple;
|
||||
|
||||
/** Which groups are initially in the list? */
|
||||
private Group[] groups;
|
||||
private transient Group[] groups;
|
||||
|
||||
private static final long serialVersionUID = -3330389128849427302L;
|
||||
|
||||
|
||||
public SelectGroupTag()
|
||||
|
@@ -107,7 +107,6 @@ public class SimpleSearchServlet extends DSpaceServlet
|
||||
String order = request.getParameter("order");
|
||||
int rpp = UIUtil.getIntParameter(request, "rpp");
|
||||
String advancedQuery = "";
|
||||
Map<String, String> queryHash = new HashMap<String, String>();
|
||||
|
||||
// can't start earlier than 0 in the results!
|
||||
if (start < 0)
|
||||
@@ -402,12 +401,15 @@ public class SimpleSearchServlet extends DSpaceServlet
|
||||
request.setAttribute("communities", communities);
|
||||
request.setAttribute("no_results", "yes");
|
||||
|
||||
queryHash = qArgs.buildQueryMap(request);
|
||||
Map<String, String> queryHash = qArgs.buildQueryMap(request);
|
||||
|
||||
if (queryHash != null)
|
||||
{
|
||||
for (Map.Entry<String, String> entry : queryHash.entrySet())
|
||||
{
|
||||
request.setAttribute(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
JSPManager.showJSP(request, response, "/search/advanced.jsp");
|
||||
}
|
||||
|
@@ -470,7 +470,6 @@ class DAVItem extends DAVDSpaceObject
|
||||
*
|
||||
* @throws SQLException the SQL exception
|
||||
* @throws AuthorizeException the authorize exception
|
||||
* @throws ServletException the servlet exception
|
||||
* @throws IOException Signals that an I/O exception has occurred.
|
||||
* @throws DAVStatusException the DAV status exception
|
||||
*/
|
||||
@@ -482,7 +481,6 @@ class DAVItem extends DAVDSpaceObject
|
||||
AuthorizeManager.authorizeAction(this.context, this.item, Constants.READ);
|
||||
|
||||
String packageType = this.request.getParameter("package");
|
||||
Bundle[] original = this.item.getBundles("ORIGINAL");
|
||||
|
||||
if (packageType == null)
|
||||
{
|
||||
|
@@ -23,16 +23,16 @@ package org.dspace.statistics.content;
|
||||
public abstract class DatasetGenerator {
|
||||
|
||||
/** The type of generator can either be CATEGORY or SERIE **/
|
||||
public int DatasetType;
|
||||
protected int datasetType;
|
||||
|
||||
public boolean includeTotal = false;
|
||||
protected boolean includeTotal = false;
|
||||
|
||||
public int getDatasetType(){
|
||||
return DatasetType;
|
||||
return datasetType;
|
||||
}
|
||||
|
||||
public void setDatasetType(int datasetType){
|
||||
DatasetType = datasetType;
|
||||
this.datasetType = datasetType;
|
||||
}
|
||||
|
||||
public boolean isIncludeTotal() {
|
||||
|
@@ -330,7 +330,6 @@ public class FlowContainerUtils
|
||||
*/
|
||||
public static FlowResult processReimportCollection(Context context, int collectionID, Request request) throws SQLException, IOException, AuthorizeException, CrosswalkException, ParserConfigurationException, SAXException, TransformerException, BrowseException
|
||||
{
|
||||
FlowResult result = new FlowResult();
|
||||
Collection collection = Collection.find(context, collectionID);
|
||||
HarvestedCollection hc = HarvestedCollection.find(context, collectionID);
|
||||
|
||||
@@ -347,9 +346,7 @@ public class FlowContainerUtils
|
||||
collection.update();
|
||||
context.commit();
|
||||
|
||||
result = processRunCollectionHarvest(context, collectionID, request);
|
||||
|
||||
return result;
|
||||
return processRunCollectionHarvest(context, collectionID, request);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -117,7 +117,7 @@ public class EditContainerPolicies extends AbstractDSpaceTransformer
|
||||
int highlightID = parameters.getParameterAsInteger("highlightID",-1);
|
||||
String baseURL = contextPath+"/admin/epeople?administrative-continue="+knot.getId();
|
||||
|
||||
ArrayList<ResourcePolicy> policies = new ArrayList<ResourcePolicy>();
|
||||
ArrayList<ResourcePolicy> policies;
|
||||
|
||||
// DIVISION: edit-container-policies
|
||||
Division main = body.addInteractiveDivision("edit-container-policies",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
|
||||
@@ -145,6 +145,8 @@ public class EditContainerPolicies extends AbstractDSpaceTransformer
|
||||
header.addCell().addContent(T_head_action);
|
||||
header.addCell().addContent(T_head_group);
|
||||
|
||||
if (policies != null)
|
||||
{
|
||||
for (ResourcePolicy policy : policies)
|
||||
{
|
||||
Row row;
|
||||
@@ -178,6 +180,8 @@ public class EditContainerPolicies extends AbstractDSpaceTransformer
|
||||
row.addCell().addContent("...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Para buttons = main.addPara();
|
||||
buttons.addButton("submit_delete").setValue(T_submit_delete);
|
||||
buttons.addButton("submit_return").setValue(T_submit_return);
|
||||
|
@@ -141,9 +141,6 @@ public class EditItemPolicies extends AbstractDSpaceTransformer
|
||||
|
||||
ArrayList<ResourcePolicy> itemPolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, item);
|
||||
|
||||
ArrayList<ResourcePolicy> bundlePolicies = new ArrayList<ResourcePolicy>();
|
||||
ArrayList<ResourcePolicy> bitstreamPolicies = new ArrayList<ResourcePolicy>();
|
||||
|
||||
// DIVISION: main
|
||||
Division main = body.addInteractiveDivision("edit-item-policies",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
|
||||
main.setHead(T_main_head.parameterize(item.getHandle(),item.getID()));
|
||||
@@ -172,7 +169,7 @@ public class EditItemPolicies extends AbstractDSpaceTransformer
|
||||
subheader.addCell(null, null, 1, 4, "indent").addHighlight("bold").addContent(T_subhead_bundle.parameterize(bundle.getName(),bundle.getID()));
|
||||
subheader.addCell().addHighlight("bold").addXref(baseURL + "&submit_add_bundle_" + bundle.getID(), T_add_bundlePolicy_link);
|
||||
|
||||
bundlePolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bundle);
|
||||
ArrayList<ResourcePolicy> bundlePolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bundle);
|
||||
this.rowBuilder(baseURL, table, bundlePolicies, bundle.getID(), Constants.BUNDLE, highlightID);
|
||||
|
||||
// And eventually to the bundle's bitstreams
|
||||
@@ -182,7 +179,7 @@ public class EditItemPolicies extends AbstractDSpaceTransformer
|
||||
subheader.addCell(null, null, 1, 4, "doubleIndent").addContent(T_subhead_bitstream.parameterize(bitstream.getName(),bitstream.getID()));
|
||||
subheader.addCell().addXref(baseURL + "&submit_add_bitstream_" + bitstream.getID(), T_add_bitstreamPolicy_link);
|
||||
|
||||
bitstreamPolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bitstream);
|
||||
ArrayList<ResourcePolicy> bitstreamPolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bitstream);
|
||||
this.rowBuilder(baseURL, table, bitstreamPolicies, bitstream.getID(), Constants.BITSTREAM, highlightID);
|
||||
}
|
||||
}
|
||||
|
@@ -190,8 +190,8 @@ public class DescribeStep extends AbstractSubmissionStep
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";
|
||||
|
||||
DCInputSet inputSet = null;
|
||||
DCInput[] inputs = {};
|
||||
DCInputSet inputSet;
|
||||
DCInput[] inputs;
|
||||
try
|
||||
{
|
||||
inputSet = getInputsReader().getInputs(submission.getCollection().getHandle());
|
||||
@@ -202,8 +202,6 @@ public class DescribeStep extends AbstractSubmissionStep
|
||||
throw new UIException(se);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Division div = body.addInteractiveDivision("submit-describe",actionURL,Division.METHOD_POST,"primary submission");
|
||||
div.setHead(T_submission_head);
|
||||
addSubmissionProgressList(div);
|
||||
@@ -357,7 +355,7 @@ public class DescribeStep extends AbstractSubmissionStep
|
||||
|
||||
String inputType = input.getInputType();
|
||||
String pairsName = input.getPairsType();
|
||||
DCValue[] values = new DCValue[0];
|
||||
DCValue[] values;
|
||||
|
||||
if (inputType.equals("qualdrop_value"))
|
||||
{
|
||||
@@ -368,7 +366,7 @@ public class DescribeStep extends AbstractSubmissionStep
|
||||
values = submission.getItem().getMetadata(input.getSchema(), input.getElement(), input.getQualifier(), Item.ANY);
|
||||
}
|
||||
|
||||
if (values.length > 0)
|
||||
if (values != null && values.length > 0)
|
||||
{
|
||||
for (DCValue value : values)
|
||||
{
|
||||
|
@@ -40,6 +40,8 @@
|
||||
|
||||
package org.dspace.app.xmlui.wing;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* This simple class just provides the Namespace datatype. It stores a URI that
|
||||
* is publicly accessible. The actually definitions of namespaces is found in
|
||||
@@ -48,7 +50,7 @@ package org.dspace.app.xmlui.wing;
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
|
||||
public class Namespace
|
||||
public class Namespace implements Serializable
|
||||
{
|
||||
/** The URI for this namespace */
|
||||
public final String URI;
|
||||
|
Reference in New Issue
Block a user