mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
[DS-707] Style / readability
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5546 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -124,7 +124,11 @@ public class MetadataExport
|
|||||||
Collection[] collections = community.getCollections();
|
Collection[] collections = community.getCollections();
|
||||||
for (Collection collection : collections)
|
for (Collection collection : collections)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < indent; i++) System.out.print(" ");
|
for (int i = 0; i < indent; i++)
|
||||||
|
{
|
||||||
|
System.out.print(" ");
|
||||||
|
}
|
||||||
|
|
||||||
ItemIterator items = collection.getAllItems();
|
ItemIterator items = collection.getAllItems();
|
||||||
while (items.hasNext())
|
while (items.hasNext())
|
||||||
{
|
{
|
||||||
@@ -141,7 +145,10 @@ public class MetadataExport
|
|||||||
Community[] communities = community.getSubcommunities();
|
Community[] communities = community.getSubcommunities();
|
||||||
for (Community subCommunity : communities)
|
for (Community subCommunity : communities)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < indent; i++) System.out.print(" ");
|
for (int i = 0; i < indent; i++)
|
||||||
|
{
|
||||||
|
System.out.print(" ");
|
||||||
|
}
|
||||||
buildFromCommunity(subCommunity, itemIDs, indent + 1);
|
buildFromCommunity(subCommunity, itemIDs, indent + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -419,8 +419,10 @@ public class MediaFilterManager
|
|||||||
Community[] topLevelCommunities = Community.findAllTop(c);
|
Community[] topLevelCommunities = Community.findAllTop(c);
|
||||||
|
|
||||||
for(int i=0; i<topLevelCommunities.length; i++)
|
for(int i=0; i<topLevelCommunities.length; i++)
|
||||||
|
{
|
||||||
applyFiltersCommunity(c, topLevelCommunities[i]);
|
applyFiltersCommunity(c, topLevelCommunities[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//otherwise, just find every item and process
|
//otherwise, just find every item and process
|
||||||
|
@@ -240,13 +240,17 @@ public class Packager
|
|||||||
String pn[] = PluginManager
|
String pn[] = PluginManager
|
||||||
.getAllPluginNames(PackageIngester.class);
|
.getAllPluginNames(PackageIngester.class);
|
||||||
for (int i = 0; i < pn.length; ++i)
|
for (int i = 0; i < pn.length; ++i)
|
||||||
|
{
|
||||||
System.out.println(" " + pn[i]);
|
System.out.println(" " + pn[i]);
|
||||||
|
}
|
||||||
System.out
|
System.out
|
||||||
.println("\nAvailable Dissemination Package (DIP) types:");
|
.println("\nAvailable Dissemination Package (DIP) types:");
|
||||||
pn = PluginManager.getAllPluginNames(PackageDisseminator.class);
|
pn = PluginManager.getAllPluginNames(PackageDisseminator.class);
|
||||||
for (int i = 0; i < pn.length; ++i)
|
for (int i = 0; i < pn.length; ++i)
|
||||||
|
{
|
||||||
System.out.println(" " + pn[i]);
|
System.out.println(" " + pn[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -312,7 +312,9 @@ public class SyndicationFeed
|
|||||||
{
|
{
|
||||||
List<String> creators = new ArrayList<String>();
|
List<String> creators = new ArrayList<String>();
|
||||||
for (DCValue author : dcAuthors)
|
for (DCValue author : dcAuthors)
|
||||||
|
{
|
||||||
creators.add(author.value);
|
creators.add(author.value);
|
||||||
|
}
|
||||||
dc.setCreators(creators);
|
dc.setCreators(creators);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -278,8 +278,10 @@ public class AuthenticationManager
|
|||||||
EPerson eperson)
|
EPerson eperson)
|
||||||
throws SQLException
|
throws SQLException
|
||||||
{
|
{
|
||||||
for (int i = 0; i < methodStack.length; ++i)
|
for (AuthenticationMethod method : methodStack)
|
||||||
methodStack[i].initEPerson(context, request, eperson);
|
{
|
||||||
|
method.initEPerson(context, request, eperson);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -330,8 +332,10 @@ public class AuthenticationManager
|
|||||||
for (int i = 0; i < gll.size(); ++i)
|
for (int i = 0; i < gll.size(); ++i)
|
||||||
{
|
{
|
||||||
int gl[] = (int [])gll.get(i);
|
int gl[] = (int [])gll.get(i);
|
||||||
for (int j = 0; j < gl.length; ++j)
|
for (int aGl : gl)
|
||||||
result[k++] = gl[j];
|
{
|
||||||
|
result[k++] = aGl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -281,18 +281,24 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
|
|
||||||
// revert back to original entry when no mapping is provided
|
// revert back to original entry when no mapping is provided
|
||||||
if (groupLabels == null)
|
if (groupLabels == null)
|
||||||
|
{
|
||||||
groupLabels = affiliation;
|
groupLabels = affiliation;
|
||||||
|
}
|
||||||
|
|
||||||
String[] labels = groupLabels.split(",");
|
String[] labels = groupLabels.split(",");
|
||||||
for (int i = 0; i < labels.length; i++)
|
for (int i = 0; i < labels.length; i++)
|
||||||
|
{
|
||||||
addGroup(groups, context, labels[i].trim());
|
addGroup(groups, context, labels[i].trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int ids[] = new int[groups.size()];
|
int ids[] = new int[groups.size()];
|
||||||
java.util.Iterator it = groups.iterator();
|
java.util.Iterator it = groups.iterator();
|
||||||
for (int i = 0; it.hasNext(); i++)
|
for (int i = 0; it.hasNext(); i++)
|
||||||
|
{
|
||||||
ids[i] = ((Integer) it.next()).intValue();
|
ids[i] = ((Integer) it.next()).intValue();
|
||||||
|
}
|
||||||
|
|
||||||
// store the special group, if already transformed from headers
|
// store the special group, if already transformed from headers
|
||||||
// since subsequent header may not have the values anymore
|
// since subsequent header may not have the values anymore
|
||||||
|
@@ -171,11 +171,17 @@ public class InstallItem
|
|||||||
boolean identifierExists = false;
|
boolean identifierExists = false;
|
||||||
DCValue[] identifiers = item.getDC("identifier", "uri", Item.ANY);
|
DCValue[] identifiers = item.getDC("identifier", "uri", Item.ANY);
|
||||||
for (DCValue identifier : identifiers)
|
for (DCValue identifier : identifiers)
|
||||||
|
{
|
||||||
if (handleref.equals(identifier.value))
|
if (handleref.equals(identifier.value))
|
||||||
|
{
|
||||||
identifierExists = true;
|
identifierExists = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!identifierExists)
|
if (!identifierExists)
|
||||||
|
{
|
||||||
item.addDC("identifier", "uri", null, handleref);
|
item.addDC("identifier", "uri", null, handleref);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// fill in metadata needed by new Item.
|
// fill in metadata needed by new Item.
|
||||||
private static void populateMetadata(Context c, Item item, DCDate embargoLiftDate)
|
private static void populateMetadata(Context c, Item item, DCDate embargoLiftDate)
|
||||||
|
@@ -188,9 +188,11 @@ public abstract class AbstractMETSDisseminator
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
for (InputStream is : extraFiles.values())
|
for (InputStream is : extraFiles.values())
|
||||||
|
{
|
||||||
is.close();
|
is.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a new unique ID symbol with specified prefix.
|
* Make a new unique ID symbol with specified prefix.
|
||||||
|
@@ -293,8 +293,10 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
|||||||
// NOTE: The AbstractPackageIngester itself will perform the
|
// NOTE: The AbstractPackageIngester itself will perform the
|
||||||
// recursive ingest call, based on these child pkg references
|
// recursive ingest call, based on these child pkg references
|
||||||
for (int i = 0; i < childFilePaths.length; i++)
|
for (int i = 0; i < childFilePaths.length; i++)
|
||||||
|
{
|
||||||
addPackageReference(dso, childFilePaths[i]);
|
addPackageReference(dso, childFilePaths[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return dso;
|
return dso;
|
||||||
}
|
}
|
||||||
@@ -1075,8 +1077,10 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
|||||||
// NOTE: The AbstractPackageIngester itself will perform the
|
// NOTE: The AbstractPackageIngester itself will perform the
|
||||||
// recursive ingest call, based on these child pkg references.
|
// recursive ingest call, based on these child pkg references.
|
||||||
for (int i = 0; i < childFilePaths.length; i++)
|
for (int i = 0; i < childFilePaths.length; i++)
|
||||||
|
{
|
||||||
addPackageReference(dso, childFilePaths[i]);
|
addPackageReference(dso, childFilePaths[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return dso;
|
return dso;
|
||||||
}
|
}
|
||||||
|
@@ -146,30 +146,42 @@ public class DSpaceAIPIngester
|
|||||||
if (userDmd != null && userDmd.length() > 0)
|
if (userDmd != null && userDmd.length() > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dmds.length; ++i)
|
for (int i = 0; i < dmds.length; ++i)
|
||||||
|
{
|
||||||
if (userDmd.equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
if (userDmd.equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
||||||
|
{
|
||||||
found = i;
|
found = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DIM is preferred, if nothing specified by user
|
// DIM is preferred, if nothing specified by user
|
||||||
if (found == -1)
|
if (found == -1)
|
||||||
{
|
{
|
||||||
// DIM is preferred for AIP
|
// DIM is preferred for AIP
|
||||||
for (int i = 0; i < dmds.length; ++i)
|
for (int i = 0; i < dmds.length; ++i)
|
||||||
|
{
|
||||||
//NOTE: METS standard actually says this should be DIM (all uppercase). But,
|
//NOTE: METS standard actually says this should be DIM (all uppercase). But,
|
||||||
// just in case, we're going to be a bit more forgiving.
|
// just in case, we're going to be a bit more forgiving.
|
||||||
if ("DIM".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
if ("DIM".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
||||||
|
{
|
||||||
found = i;
|
found = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MODS is acceptable otehrwise..
|
// MODS is acceptable otehrwise..
|
||||||
if (found == -1)
|
if (found == -1)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dmds.length; ++i)
|
for (int i = 0; i < dmds.length; ++i)
|
||||||
|
{
|
||||||
//NOTE: METS standard actually says this should be MODS (all uppercase). But,
|
//NOTE: METS standard actually says this should be MODS (all uppercase). But,
|
||||||
// just in case, we're going to be a bit more forgiving.
|
// just in case, we're going to be a bit more forgiving.
|
||||||
if ("MODS".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
if ("MODS".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
||||||
|
{
|
||||||
found = i;
|
found = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String groupID = null;
|
String groupID = null;
|
||||||
if (found >= 0)
|
if (found >= 0)
|
||||||
|
@@ -124,29 +124,41 @@ public class DSpaceMETSIngester
|
|||||||
if (userDmd != null && userDmd.length() > 0)
|
if (userDmd != null && userDmd.length() > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dmds.length; ++i)
|
for (int i = 0; i < dmds.length; ++i)
|
||||||
|
{
|
||||||
if (userDmd.equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
if (userDmd.equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
||||||
|
{
|
||||||
found = i;
|
found = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MODS is preferred, if nothing specified by user
|
// MODS is preferred, if nothing specified by user
|
||||||
if (found == -1)
|
if (found == -1)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dmds.length; ++i)
|
for (int i = 0; i < dmds.length; ++i)
|
||||||
|
{
|
||||||
//NOTE: METS standard actually says this should be MODS (all uppercase). But,
|
//NOTE: METS standard actually says this should be MODS (all uppercase). But,
|
||||||
// just in case, we're going to be a bit more forgiving.
|
// just in case, we're going to be a bit more forgiving.
|
||||||
if ("MODS".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
if ("MODS".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
||||||
|
{
|
||||||
found = i;
|
found = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DC acceptable if no MODS
|
// DC acceptable if no MODS
|
||||||
if (found == -1)
|
if (found == -1)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < dmds.length; ++i)
|
for (int i = 0; i < dmds.length; ++i)
|
||||||
|
{
|
||||||
//NOTE: METS standard actually says this should be DC (all uppercase). But,
|
//NOTE: METS standard actually says this should be DC (all uppercase). But,
|
||||||
// just in case, we're going to be a bit more forgiving.
|
// just in case, we're going to be a bit more forgiving.
|
||||||
if ("DC".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
if ("DC".equalsIgnoreCase(manifest.getMdType(dmds[i])))
|
||||||
|
{
|
||||||
found = i;
|
found = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String groupID = null;
|
String groupID = null;
|
||||||
if (found >= 0)
|
if (found >= 0)
|
||||||
|
@@ -590,7 +590,9 @@ public class METSManifest
|
|||||||
String id = mdSec.getAttributeValue("ID");
|
String id = mdSec.getAttributeValue("ID");
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
for (Iterator mi = mdc.iterator(); mi.hasNext();)
|
for (Iterator mi = mdc.iterator(); mi.hasNext();)
|
||||||
|
{
|
||||||
sb.append(", ").append(((Content)mi.next()).toString());
|
sb.append(", ").append(((Content)mi.next()).toString());
|
||||||
|
}
|
||||||
throw new MetadataValidationException("Cannot parse METS with "+mdSec.getQualifiedName()+" element that contains more than one child, size="+String.valueOf(mdc.size())+", ID="+id+"Kids="+sb.toString());
|
throw new MetadataValidationException("Cannot parse METS with "+mdSec.getQualifiedName()+" element that contains more than one child, size="+String.valueOf(mdc.size())+", ID="+id+"Kids="+sb.toString());
|
||||||
}
|
}
|
||||||
Element mdRef = null;
|
Element mdRef = null;
|
||||||
@@ -905,7 +907,9 @@ public class METSManifest
|
|||||||
Element result[] = new Element[dmdID.length];
|
Element result[] = new Element[dmdID.length];
|
||||||
|
|
||||||
for (int i = 0; i < dmdID.length; ++i)
|
for (int i = 0; i < dmdID.length; ++i)
|
||||||
|
{
|
||||||
result[i] = getElementByXPath("mets:dmdSec[@ID=\""+dmdID[i]+"\"]", false);
|
result[i] = getElementByXPath("mets:dmdSec[@ID=\""+dmdID[i]+"\"]", false);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -964,13 +968,19 @@ public class METSManifest
|
|||||||
{
|
{
|
||||||
Element amdSec = getElementByXPath("mets:amdSec[@ID=\""+amdID+"\"]", false);
|
Element amdSec = getElementByXPath("mets:amdSec[@ID=\""+amdID+"\"]", false);
|
||||||
for (Iterator ti = amdSec.getChildren("techMD", metsNS).iterator(); ti.hasNext();)
|
for (Iterator ti = amdSec.getChildren("techMD", metsNS).iterator(); ti.hasNext();)
|
||||||
|
{
|
||||||
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
|
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
|
||||||
|
}
|
||||||
for (Iterator ti = amdSec.getChildren("digiprovMD", metsNS).iterator(); ti.hasNext();)
|
for (Iterator ti = amdSec.getChildren("digiprovMD", metsNS).iterator(); ti.hasNext();)
|
||||||
|
{
|
||||||
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
|
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
|
||||||
|
}
|
||||||
for (Iterator ti = amdSec.getChildren("rightsMD", metsNS).iterator(); ti.hasNext();)
|
for (Iterator ti = amdSec.getChildren("rightsMD", metsNS).iterator(); ti.hasNext();)
|
||||||
|
{
|
||||||
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
|
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Just crosswalk the sourceMD sections; used to set the handle and parent of AIP.
|
* Just crosswalk the sourceMD sections; used to set the handle and parent of AIP.
|
||||||
@@ -1150,11 +1160,15 @@ public class METSManifest
|
|||||||
{
|
{
|
||||||
Element amdSec = getElementByXPath("mets:amdSec[@ID=\""+amdID[i]+"\"]", false);
|
Element amdSec = getElementByXPath("mets:amdSec[@ID=\""+amdID[i]+"\"]", false);
|
||||||
for (Iterator ti = amdSec.getChildren("techMD", metsNS).iterator(); ti.hasNext();)
|
for (Iterator ti = amdSec.getChildren("techMD", metsNS).iterator(); ti.hasNext();)
|
||||||
|
{
|
||||||
crosswalkXmd(context, params, bitstream, (Element)ti.next(), callback);
|
crosswalkXmd(context, params, bitstream, (Element)ti.next(), callback);
|
||||||
|
}
|
||||||
for (Iterator ti = amdSec.getChildren("sourceMD", metsNS).iterator(); ti.hasNext();)
|
for (Iterator ti = amdSec.getChildren("sourceMD", metsNS).iterator(); ti.hasNext();)
|
||||||
|
{
|
||||||
crosswalkXmd(context, params, bitstream, (Element)ti.next(), callback);
|
crosswalkXmd(context, params, bitstream, (Element)ti.next(), callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return root element of METS document.
|
* @return root element of METS document.
|
||||||
|
@@ -242,7 +242,9 @@ public class RoleDisseminator implements PackageDisseminator
|
|||||||
writer.writeStartElement(GROUPS);
|
writer.writeStartElement(GROUPS);
|
||||||
|
|
||||||
for (Group group : groups)
|
for (Group group : groups)
|
||||||
|
{
|
||||||
writeGroup(context, object, group, writer);
|
writeGroup(context, object, group, writer);
|
||||||
|
}
|
||||||
|
|
||||||
writer.writeEndElement(); // GROUPS
|
writer.writeEndElement(); // GROUPS
|
||||||
}
|
}
|
||||||
@@ -253,7 +255,9 @@ public class RoleDisseminator implements PackageDisseminator
|
|||||||
writer.writeStartElement(EPERSONS);
|
writer.writeStartElement(EPERSONS);
|
||||||
|
|
||||||
for (EPerson eperson : people)
|
for (EPerson eperson : people)
|
||||||
|
{
|
||||||
writeEPerson(eperson, writer, emitPasswords);
|
writeEPerson(eperson, writer, emitPasswords);
|
||||||
|
}
|
||||||
|
|
||||||
writer.writeEndElement(); // EPERSONS
|
writer.writeEndElement(); // EPERSONS
|
||||||
}
|
}
|
||||||
|
@@ -229,7 +229,9 @@ public class RoleIngester implements PackageIngester
|
|||||||
if (params.replaceModeEnabled()) // -r -f
|
if (params.replaceModeEnabled()) // -r -f
|
||||||
{
|
{
|
||||||
for (Group member : collider.getMemberGroups())
|
for (Group member : collider.getMemberGroups())
|
||||||
|
{
|
||||||
collider.removeMember(member);
|
collider.removeMember(member);
|
||||||
|
}
|
||||||
for (EPerson member : collider.getMembers())
|
for (EPerson member : collider.getMembers())
|
||||||
{
|
{
|
||||||
// Remove all group members *EXCEPT* we don't ever want
|
// Remove all group members *EXCEPT* we don't ever want
|
||||||
|
@@ -730,10 +730,14 @@ public class PluginManager
|
|||||||
val = val.trim();
|
val = val.trim();
|
||||||
String classname[] = val.split("\\s*,\\s*");
|
String classname[] = val.split("\\s*,\\s*");
|
||||||
for (int i = 0; i < classname.length; ++i)
|
for (int i = 0; i < classname.length; ++i)
|
||||||
|
{
|
||||||
if (checkClassname(classname[i], "implementation class"))
|
if (checkClassname(classname[i], "implementation class"))
|
||||||
|
{
|
||||||
allImpls.put(classname[i], classname[i]);
|
allImpls.put(classname[i], classname[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 3. self-named plugins - grab and check all values
|
// 3. self-named plugins - grab and check all values
|
||||||
// then make sure it is a subclass of SelfNamedPlugin
|
// then make sure it is a subclass of SelfNamedPlugin
|
||||||
@@ -749,11 +753,13 @@ public class PluginManager
|
|||||||
val = val.trim();
|
val = val.trim();
|
||||||
String classname[] = val.split("\\s*,\\s*");
|
String classname[] = val.split("\\s*,\\s*");
|
||||||
for (int i = 0; i < classname.length; ++i)
|
for (int i = 0; i < classname.length; ++i)
|
||||||
|
{
|
||||||
if (checkClassname(classname[i], "selfnamed implementation class"))
|
if (checkClassname(classname[i], "selfnamed implementation class"))
|
||||||
{
|
{
|
||||||
allImpls.put(classname[i], classname[i]);
|
allImpls.put(classname[i], classname[i]);
|
||||||
checkSelfNamed(classname[i]);
|
checkSelfNamed(classname[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
checkNames(key);
|
checkNames(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -463,13 +463,19 @@ public class Event implements Serializable
|
|||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
for (int i = 0; i < eventTypeText.length; ++i)
|
for (int i = 0; i < eventTypeText.length; ++i)
|
||||||
|
{
|
||||||
result |= (1 << i);
|
result |= (1 << i);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < eventTypeText.length; ++i)
|
for (int i = 0; i < eventTypeText.length; ++i)
|
||||||
|
{
|
||||||
if (eventTypeText[i].equalsIgnoreCase(s))
|
if (eventTypeText[i].equalsIgnoreCase(s))
|
||||||
|
{
|
||||||
return 1 << i;
|
return 1 << i;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,10 +577,16 @@ public class Event implements Serializable
|
|||||||
private static int log2(int n)
|
private static int log2(int n)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 32; ++i)
|
for (int i = 0; i < 32; ++i)
|
||||||
|
{
|
||||||
if (n == 1)
|
if (n == 1)
|
||||||
|
{
|
||||||
return i;
|
return i;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
n = n >> 1;
|
n = n >> 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -812,10 +812,14 @@ public class DSIndexer
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (i = 0; i < communities.length; i++)
|
for (i = 0; i < communities.length; i++)
|
||||||
|
{
|
||||||
location.append(" m").append(communities[i].getID());
|
location.append(" m").append(communities[i].getID());
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < collections.length; i++)
|
for (i = 0; i < collections.length; i++)
|
||||||
|
{
|
||||||
location.append(" l").append(collections[i].getID());
|
location.append(" l").append(collections[i].getID());
|
||||||
|
}
|
||||||
|
|
||||||
return location.toString();
|
return location.toString();
|
||||||
}
|
}
|
||||||
@@ -831,7 +835,9 @@ public class DSIndexer
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (i = 0; i < communities.length; i++)
|
for (i = 0; i < communities.length; i++)
|
||||||
|
{
|
||||||
location.append(" m").append(communities[i].getID());
|
location.append(" m").append(communities[i].getID());
|
||||||
|
}
|
||||||
|
|
||||||
return location.toString();
|
return location.toString();
|
||||||
}
|
}
|
||||||
|
@@ -357,7 +357,9 @@ public class SortOption
|
|||||||
public static SortOption getDefaultSortOption() throws SortException
|
public static SortOption getDefaultSortOption() throws SortException
|
||||||
{
|
{
|
||||||
for (SortOption so : getSortOptions())
|
for (SortOption so : getSortOptions())
|
||||||
|
{
|
||||||
return so;
|
return so;
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -38,12 +38,7 @@
|
|||||||
|
|
||||||
package org.dspace.text.filter;
|
package org.dspace.text.filter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
@@ -292,7 +287,9 @@ public class MARC21InitialArticleWord extends InitialArticleWord
|
|||||||
String[] words = new String[wordList.size()];
|
String[] words = new String[wordList.size()];
|
||||||
|
|
||||||
for (int idx = 0; idx < wordList.size(); idx++)
|
for (int idx = 0; idx < wordList.size(); idx++)
|
||||||
|
{
|
||||||
words[idx] = (String)wordList.get(idx);
|
words[idx] = (String)wordList.get(idx);
|
||||||
|
}
|
||||||
|
|
||||||
// Sort the array into length order - longest to shortest
|
// Sort the array into length order - longest to shortest
|
||||||
// This ensures maximal matching on the article words
|
// This ensures maximal matching on the article words
|
||||||
|
@@ -152,8 +152,12 @@ public class WorkflowManager
|
|||||||
public static int getWorkflowID(String state)
|
public static int getWorkflowID(String state)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < workflowText.length; ++i)
|
for (int i = 0; i < workflowText.length; ++i)
|
||||||
|
{
|
||||||
if (state.equalsIgnoreCase(workflowText[i]))
|
if (state.equalsIgnoreCase(workflowText[i]))
|
||||||
|
{
|
||||||
return i;
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -571,10 +571,14 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (i = 0; i < communities.length; i++)
|
for (i = 0; i < communities.length; i++)
|
||||||
|
{
|
||||||
locations.add(new String("m" + communities[i].getID()));
|
locations.add(new String("m" + communities[i].getID()));
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < collections.length; i++)
|
for (i = 0; i < collections.length; i++)
|
||||||
|
{
|
||||||
locations.add(new String("l" + collections[i].getID()));
|
locations.add(new String("l" + collections[i].getID()));
|
||||||
|
}
|
||||||
|
|
||||||
return locations;
|
return locations;
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,9 @@ public class FlowGroupUtils {
|
|||||||
|
|
||||||
String[] epeopleIDs = new String[epeople.length];
|
String[] epeopleIDs = new String[epeople.length];
|
||||||
for (int i=0; i < epeople.length; i++)
|
for (int i=0; i < epeople.length; i++)
|
||||||
|
{
|
||||||
epeopleIDs[i] = String.valueOf(epeople[i].getID());
|
epeopleIDs[i] = String.valueOf(epeople[i].getID());
|
||||||
|
}
|
||||||
|
|
||||||
return epeopleIDs;
|
return epeopleIDs;
|
||||||
}
|
}
|
||||||
@@ -138,7 +140,9 @@ public class FlowGroupUtils {
|
|||||||
|
|
||||||
String[] groupIDs = new String[groups.length];
|
String[] groupIDs = new String[groups.length];
|
||||||
for (int i=0; i < groups.length; i++)
|
for (int i=0; i < groups.length; i++)
|
||||||
|
{
|
||||||
groupIDs[i] = String.valueOf(groups[i].getID());
|
groupIDs[i] = String.valueOf(groups[i].getID());
|
||||||
|
}
|
||||||
|
|
||||||
return groupIDs;
|
return groupIDs;
|
||||||
}
|
}
|
||||||
@@ -270,10 +274,14 @@ public class FlowGroupUtils {
|
|||||||
// Second, Prepare to check members by turning arrays into lists
|
// Second, Prepare to check members by turning arrays into lists
|
||||||
List<Integer> newEPeopleIDs = new ArrayList<Integer>();
|
List<Integer> newEPeopleIDs = new ArrayList<Integer>();
|
||||||
for (String epeopleID : newEPeopleIDsArray)
|
for (String epeopleID : newEPeopleIDsArray)
|
||||||
|
{
|
||||||
newEPeopleIDs.add(Integer.valueOf(epeopleID));
|
newEPeopleIDs.add(Integer.valueOf(epeopleID));
|
||||||
|
}
|
||||||
List<Integer> newGroupIDs = new ArrayList<Integer>();
|
List<Integer> newGroupIDs = new ArrayList<Integer>();
|
||||||
for (String _groupID : newGroupIDsArray)
|
for (String _groupID : newGroupIDsArray)
|
||||||
|
{
|
||||||
newGroupIDs.add(Integer.valueOf(_groupID));
|
newGroupIDs.add(Integer.valueOf(_groupID));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Third, check if there are any members to remove
|
// Third, check if there are any members to remove
|
||||||
|
@@ -159,7 +159,9 @@ public class FlowRegistryUtils
|
|||||||
// First remove and fields in the schema
|
// First remove and fields in the schema
|
||||||
MetadataField[] fields = MetadataField.findAllInSchema(context, schema.getSchemaID());
|
MetadataField[] fields = MetadataField.findAllInSchema(context, schema.getSchemaID());
|
||||||
for (MetadataField field : fields)
|
for (MetadataField field : fields)
|
||||||
|
{
|
||||||
field.delete(context);
|
field.delete(context);
|
||||||
|
}
|
||||||
|
|
||||||
// Once all the fields are gone, then delete the schema.
|
// Once all the fields are gone, then delete the schema.
|
||||||
schema.delete(context);
|
schema.delete(context);
|
||||||
@@ -459,8 +461,12 @@ public class FlowRegistryUtils
|
|||||||
|
|
||||||
// Remove leading periods from file extensions.
|
// Remove leading periods from file extensions.
|
||||||
for (int i = 0; i < extensions.length; i++)
|
for (int i = 0; i < extensions.length; i++)
|
||||||
|
{
|
||||||
if (extensions[i].startsWith("."))
|
if (extensions[i].startsWith("."))
|
||||||
|
{
|
||||||
extensions[i] = extensions[i].substring(1);
|
extensions[i] = extensions[i].substring(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get or create the format
|
// Get or create the format
|
||||||
|
@@ -125,14 +125,18 @@ public class AdvacedAuthorizationsForm extends AbstractDSpaceTransformer
|
|||||||
groupSelect.setMultiple(true);
|
groupSelect.setMultiple(true);
|
||||||
groupSelect.setSize(15);
|
groupSelect.setSize(15);
|
||||||
for (Group group : Group.findAll(context, Group.NAME))
|
for (Group group : Group.findAll(context, Group.NAME))
|
||||||
|
{
|
||||||
groupSelect.addOption(false, group.getID(), group.getName());
|
groupSelect.addOption(false, group.getID(), group.getName());
|
||||||
|
}
|
||||||
|
|
||||||
// Grant the ability to perform the following action...
|
// Grant the ability to perform the following action...
|
||||||
actionsList.addItem().addContent(T_actions_actionSentence);
|
actionsList.addItem().addContent(T_actions_actionSentence);
|
||||||
actionsList.addLabel(T_actions_policyAction);
|
actionsList.addLabel(T_actions_policyAction);
|
||||||
Select actionSelect = actionsList.addItem().addSelect("action_id");
|
Select actionSelect = actionsList.addItem().addSelect("action_id");
|
||||||
for( int i = 0; i < Constants.actionText.length; i++ )
|
for( int i = 0; i < Constants.actionText.length; i++ )
|
||||||
|
{
|
||||||
actionSelect.addOption(i, Constants.actionText[i]);
|
actionSelect.addOption(i, Constants.actionText[i]);
|
||||||
|
}
|
||||||
|
|
||||||
// For all following object types...
|
// For all following object types...
|
||||||
actionsList.addItem().addContent(T_actions_resourceSentence);
|
actionsList.addItem().addContent(T_actions_resourceSentence);
|
||||||
@@ -148,7 +152,9 @@ public class AdvacedAuthorizationsForm extends AbstractDSpaceTransformer
|
|||||||
collectionsSelect.setMultiple(true);
|
collectionsSelect.setMultiple(true);
|
||||||
collectionsSelect.setSize(15);
|
collectionsSelect.setSize(15);
|
||||||
for (Collection collection : Collection.findAll(context))
|
for (Collection collection : Collection.findAll(context))
|
||||||
|
{
|
||||||
collectionsSelect.addOption(false, collection.getID(), collection.getMetadata("name"));
|
collectionsSelect.addOption(false, collection.getID(), collection.getMetadata("name"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Para buttons = main.addPara();
|
Para buttons = main.addPara();
|
||||||
|
@@ -115,8 +115,10 @@ public class AuthorizationMain extends AbstractDSpaceTransformer
|
|||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
{
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Division main = body.addInteractiveDivision("authorization-main",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
|
Division main = body.addInteractiveDivision("authorization-main",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
|
||||||
main.setHead(T_main_head);
|
main.setHead(T_main_head);
|
||||||
|
@@ -174,8 +174,10 @@ public class EditPolicyForm extends AbstractDSpaceTransformer
|
|||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
{
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set up our current Dspace object */
|
/* Set up our current Dspace object */
|
||||||
|
@@ -151,7 +151,9 @@ public class AddEPersonForm extends AbstractDSpaceTransformer
|
|||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
{
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String emailValue = request.getParameter("email_address");
|
String emailValue = request.getParameter("email_address");
|
||||||
|
@@ -199,7 +199,9 @@ public class EditEPersonForm extends AbstractDSpaceTransformer
|
|||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
{
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grab the person in question
|
// Grab the person in question
|
||||||
|
@@ -266,9 +266,13 @@ public class EditGroupForm extends AbstractDSpaceTransformer
|
|||||||
if (memberEPeopleIDsString != null)
|
if (memberEPeopleIDsString != null)
|
||||||
{
|
{
|
||||||
for (String id : memberEPeopleIDsString.split(","))
|
for (String id : memberEPeopleIDsString.split(","))
|
||||||
|
{
|
||||||
if (id.length() > 0)
|
if (id.length() > 0)
|
||||||
|
{
|
||||||
memberEPeopleIDs.add(Integer.valueOf(id));
|
memberEPeopleIDs.add(Integer.valueOf(id));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get highlight parameters
|
// Get highlight parameters
|
||||||
int highlightEPersonID = parameters.getParameterAsInteger("highlightEPersonID",-1);
|
int highlightEPersonID = parameters.getParameterAsInteger("highlightEPersonID",-1);
|
||||||
@@ -283,10 +287,12 @@ public class EditGroupForm extends AbstractDSpaceTransformer
|
|||||||
String errorString = parameters.getParameter("errors",null);
|
String errorString = parameters.getParameter("errors",null);
|
||||||
ArrayList<String> errors = new ArrayList<String>();
|
ArrayList<String> errors = new ArrayList<String>();
|
||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//DIVISION: group-edit
|
//DIVISION: group-edit
|
||||||
Division main = body.addInteractiveDivision("group-edit",contextPath+"/admin/groups",Division.METHOD_POST,"primary administrative groups");
|
Division main = body.addInteractiveDivision("group-edit",contextPath+"/admin/groups",Division.METHOD_POST,"primary administrative groups");
|
||||||
|
@@ -85,8 +85,12 @@ public class FindItemForm extends AbstractDSpaceTransformer {
|
|||||||
String errorString = parameters.getParameter("errors",null);
|
String errorString = parameters.getParameter("errors",null);
|
||||||
ArrayList<String> errors = new ArrayList<String>();
|
ArrayList<String> errors = new ArrayList<String>();
|
||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DIVISION: find-item
|
// DIVISION: find-item
|
||||||
Division findItem = body.addInteractiveDivision("find-item",contextPath + "/admin/item", Division.METHOD_GET,"primary administrative item");
|
Division findItem = body.addInteractiveDivision("find-item",contextPath + "/admin/item", Division.METHOD_GET,"primary administrative item");
|
||||||
|
@@ -139,8 +139,12 @@ public class EditBitstreamFormat extends AbstractDSpaceTransformer
|
|||||||
String errorString = parameters.getParameter("errors",null);
|
String errorString = parameters.getParameter("errors",null);
|
||||||
ArrayList<String> errors = new ArrayList<String>();
|
ArrayList<String> errors = new ArrayList<String>();
|
||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||||
String mimetypeValue = request.getParameter("mimetype");
|
String mimetypeValue = request.getParameter("mimetype");
|
||||||
@@ -153,8 +157,12 @@ public class EditBitstreamFormat extends AbstractDSpaceTransformer
|
|||||||
|
|
||||||
// Remove leading periods from file extensions.
|
// Remove leading periods from file extensions.
|
||||||
for (int i = 0; i < extensionValues.length; i++)
|
for (int i = 0; i < extensionValues.length; i++)
|
||||||
|
{
|
||||||
if (extensionValues[i].startsWith("."))
|
if (extensionValues[i].startsWith("."))
|
||||||
|
{
|
||||||
extensionValues[i] = extensionValues[i].substring(1);
|
extensionValues[i] = extensionValues[i].substring(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (format != null)
|
if (format != null)
|
||||||
{
|
{
|
||||||
|
@@ -161,8 +161,10 @@ public class EditMetadataSchema extends AbstractDSpaceTransformer
|
|||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
{
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// DIVISION: edit-schema
|
// DIVISION: edit-schema
|
||||||
|
@@ -125,7 +125,9 @@ public class MetadataRegistryMain extends AbstractDSpaceTransformer
|
|||||||
if (errorString != null)
|
if (errorString != null)
|
||||||
{
|
{
|
||||||
for (String error : errorString.split(","))
|
for (String error : errorString.split(","))
|
||||||
|
{
|
||||||
errors.add(error);
|
errors.add(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MetadataSchema[] schemas = MetadataSchema.findAll(context);
|
MetadataSchema[] schemas = MetadataSchema.findAll(context);
|
||||||
|
|
||||||
|
@@ -372,7 +372,9 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
|||||||
Stack<TreeNode> stack = new Stack<TreeNode>();
|
Stack<TreeNode> stack = new Stack<TreeNode>();
|
||||||
|
|
||||||
for (Community community : communities)
|
for (Community community : communities)
|
||||||
|
{
|
||||||
stack.push(newRoot.addChild(community));
|
stack.push(newRoot.addChild(community));
|
||||||
|
}
|
||||||
|
|
||||||
while (!stack.empty())
|
while (!stack.empty())
|
||||||
{
|
{
|
||||||
|
@@ -376,13 +376,17 @@ public class EditProfile extends AbstractDSpaceTransformer
|
|||||||
{
|
{
|
||||||
String name = possible.getMetadata("name");
|
String name = possible.getMetadata("name");
|
||||||
if (name.length() > 50)
|
if (name.length() > 50)
|
||||||
|
{
|
||||||
name = name.substring(0, 47) + "...";
|
name = name.substring(0, 47) + "...";
|
||||||
|
}
|
||||||
subscriptions.addOption(possible.getID(), name);
|
subscriptions.addOption(possible.getID(), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Collection collection: currentList)
|
for (Collection collection: currentList)
|
||||||
|
{
|
||||||
subscriptions.addInstance().setOptionSelected(collection.getID());
|
subscriptions.addInstance().setOptionSelected(collection.getID());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (allowSetPassword)
|
if (allowSetPassword)
|
||||||
|
@@ -188,8 +188,12 @@ public class DSpaceLocaleAction extends ServiceableAction implements Configurabl
|
|||||||
|
|
||||||
// Otherwise check if they are listed
|
// Otherwise check if they are listed
|
||||||
for (Locale locale : supportedLocales)
|
for (Locale locale : supportedLocales)
|
||||||
|
{
|
||||||
if (locale.equals(test))
|
if (locale.equals(test))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fail if not found
|
// Fail if not found
|
||||||
return false;
|
return false;
|
||||||
|
@@ -159,7 +159,7 @@ public class OpenSearchGenerator extends AbstractGenerator
|
|||||||
if (this.validity == null)
|
if (this.validity == null)
|
||||||
{
|
{
|
||||||
long expiry = System.currentTimeMillis() +
|
long expiry = System.currentTimeMillis() +
|
||||||
ConfigurationManager.getIntProperty("websvc.opensearch.validity") * 60 * 60 * 1000;
|
ConfigurationManager.getLongProperty("websvc.opensearch.validity") * 60 * 60 * 1000;
|
||||||
this.validity = new ExpiresValidity(expiry);
|
this.validity = new ExpiresValidity(expiry);
|
||||||
}
|
}
|
||||||
return this.validity;
|
return this.validity;
|
||||||
|
@@ -333,11 +333,15 @@ public class RepositoryAdapter extends AbstractAdapter
|
|||||||
if (dso instanceof Community)
|
if (dso instanceof Community)
|
||||||
{
|
{
|
||||||
for (DSpaceObject child : ((Community)dso).getCollections())
|
for (DSpaceObject child : ((Community)dso).getCollections())
|
||||||
|
{
|
||||||
renderStructuralDiv(child);
|
renderStructuralDiv(child);
|
||||||
|
}
|
||||||
|
|
||||||
for (DSpaceObject child : ((Community)dso).getSubcommunities())
|
for (DSpaceObject child : ((Community)dso).getSubcommunities())
|
||||||
|
{
|
||||||
renderStructuralDiv(child);
|
renderStructuralDiv(child);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ////////////////////
|
// ////////////////////
|
||||||
// Close division
|
// Close division
|
||||||
|
@@ -224,7 +224,9 @@ public class AuthenticationUtil
|
|||||||
int[] groupIDs = AuthenticationManager.getSpecialGroups(context,
|
int[] groupIDs = AuthenticationManager.getSpecialGroups(context,
|
||||||
request);
|
request);
|
||||||
for (int groupID : groupIDs)
|
for (int groupID : groupIDs)
|
||||||
|
{
|
||||||
context.setSpecialGroup(groupID);
|
context.setSpecialGroup(groupID);
|
||||||
|
}
|
||||||
|
|
||||||
// and the remote IP address to compare against later requests
|
// and the remote IP address to compare against later requests
|
||||||
// so we can detect session hijacking.
|
// so we can detect session hijacking.
|
||||||
@@ -303,8 +305,10 @@ public class AuthenticationUtil
|
|||||||
// Set any special groups - invoke the authentication mgr.
|
// Set any special groups - invoke the authentication mgr.
|
||||||
int[] groupIDs = AuthenticationManager.getSpecialGroups(context, request);
|
int[] groupIDs = AuthenticationManager.getSpecialGroups(context, request);
|
||||||
for (int groupID : groupIDs)
|
for (int groupID : groupIDs)
|
||||||
|
{
|
||||||
context.setSpecialGroup(groupID);
|
context.setSpecialGroup(groupID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Possible hack attempt.
|
// Possible hack attempt.
|
||||||
@@ -366,7 +370,9 @@ public class AuthenticationUtil
|
|||||||
// Set any special groups - invoke the authentication mgr.
|
// Set any special groups - invoke the authentication mgr.
|
||||||
int[] groupIDs = AuthenticationManager.getSpecialGroups(context,request);
|
int[] groupIDs = AuthenticationManager.getSpecialGroups(context,request);
|
||||||
for (int groupID : groupIDs)
|
for (int groupID : groupIDs)
|
||||||
|
{
|
||||||
context.setSpecialGroup(groupID);
|
context.setSpecialGroup(groupID);
|
||||||
|
}
|
||||||
|
|
||||||
// Set both the effective and authenticated user to the same.
|
// Set both the effective and authenticated user to the same.
|
||||||
session.setAttribute(EFFECTIVE_USER_ID, loginAs.getID());
|
session.setAttribute(EFFECTIVE_USER_ID, loginAs.getID());
|
||||||
|
@@ -260,11 +260,17 @@ public class Include extends AbstractTransformer implements CacheableProcessingC
|
|||||||
|
|
||||||
Element foundChild = null;
|
Element foundChild = null;
|
||||||
for (Element child : getElementList(peek))
|
for (Element child : getElementList(peek))
|
||||||
|
{
|
||||||
if (isEqual(child, uri, localName, qName, attributes))
|
if (isEqual(child, uri, localName, qName, attributes))
|
||||||
|
{
|
||||||
foundChild = child;
|
foundChild = child;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (foundChild != null)
|
if (foundChild != null)
|
||||||
|
{
|
||||||
peek.removeChild(foundChild);
|
peek.removeChild(foundChild);
|
||||||
|
}
|
||||||
|
|
||||||
stack.push(foundChild);
|
stack.push(foundChild);
|
||||||
}
|
}
|
||||||
@@ -304,9 +310,11 @@ public class Include extends AbstractTransformer implements CacheableProcessingC
|
|||||||
//getLogger().debug("startElement: streaming");
|
//getLogger().debug("startElement: streaming");
|
||||||
|
|
||||||
for (Node node : getNodeList(poped))
|
for (Node node : getNodeList(poped))
|
||||||
|
{
|
||||||
streamer.stream(node);
|
streamer.stream(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
super.endElement(uri, localName, qName);
|
super.endElement(uri, localName, qName);
|
||||||
}
|
}
|
||||||
|
@@ -262,7 +262,9 @@ public class Body extends AbstractWingElement implements WingMergeableElement
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
for (Division division : divisions)
|
for (Division division : divisions)
|
||||||
|
{
|
||||||
division.dispose();
|
division.dispose();
|
||||||
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -111,7 +111,9 @@ public abstract class Container extends AbstractWingElement
|
|||||||
if (this.contents != null)
|
if (this.contents != null)
|
||||||
{
|
{
|
||||||
for (AbstractWingElement element : contents)
|
for (AbstractWingElement element : contents)
|
||||||
|
{
|
||||||
element.dispose();
|
element.dispose();
|
||||||
|
}
|
||||||
this.contents.clear();
|
this.contents.clear();
|
||||||
}
|
}
|
||||||
this.contents = null;
|
this.contents = null;
|
||||||
|
@@ -944,7 +944,9 @@ public class Division extends AbstractWingElement implements StructuralElement,
|
|||||||
head.dispose();
|
head.dispose();
|
||||||
head = null;
|
head = null;
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
if (contents != null)
|
if (contents != null)
|
||||||
contents.clear();
|
contents.clear();
|
||||||
contents = null;
|
contents = null;
|
||||||
|
@@ -494,8 +494,12 @@ public abstract class Field extends AbstractWingElement implements
|
|||||||
{
|
{
|
||||||
List<Value> found = new ArrayList<Value>();
|
List<Value> found = new ArrayList<Value>();
|
||||||
for (Value value : values)
|
for (Value value : values)
|
||||||
|
{
|
||||||
if (value.getType().equals(removeType))
|
if (value.getType().equals(removeType))
|
||||||
|
{
|
||||||
found.add(value);
|
found.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Value remove : found)
|
for (Value remove : found)
|
||||||
{
|
{
|
||||||
@@ -546,19 +550,29 @@ public abstract class Field extends AbstractWingElement implements
|
|||||||
help.toSAX(contentHandler, lexicalHandler, namespaces);
|
help.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
|
||||||
for (Error error : errors)
|
for (Error error : errors)
|
||||||
|
{
|
||||||
error.toSAX(contentHandler, lexicalHandler, namespaces);
|
error.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
for (Field field : fields)
|
for (Field field : fields)
|
||||||
|
{
|
||||||
field.toSAX(contentHandler, lexicalHandler, namespaces);
|
field.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
for (Option option : options)
|
for (Option option : options)
|
||||||
|
{
|
||||||
option.toSAX(contentHandler, lexicalHandler, namespaces);
|
option.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
for (Value value : values)
|
for (Value value : values)
|
||||||
|
{
|
||||||
value.toSAX(contentHandler, lexicalHandler, namespaces);
|
value.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
for (Instance instance : instances)
|
for (Instance instance : instances)
|
||||||
|
{
|
||||||
instance.toSAX(contentHandler, lexicalHandler, namespaces);
|
instance.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
endElement(contentHandler, namespaces, E_FIELD);
|
endElement(contentHandler, namespaces, E_FIELD);
|
||||||
}
|
}
|
||||||
@@ -569,38 +583,64 @@ public abstract class Field extends AbstractWingElement implements
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
if (params != null)
|
if (params != null)
|
||||||
|
{
|
||||||
params.dispose();
|
params.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
if (label != null)
|
if (label != null)
|
||||||
|
{
|
||||||
label.dispose();
|
label.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
if (help != null)
|
if (help != null)
|
||||||
|
{
|
||||||
help.dispose();
|
help.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
for (Error error : errors)
|
for (Error error : errors)
|
||||||
|
{
|
||||||
error.dispose();
|
error.dispose();
|
||||||
|
}
|
||||||
if (errors != null)
|
if (errors != null)
|
||||||
|
{
|
||||||
errors.clear();
|
errors.clear();
|
||||||
|
}
|
||||||
|
|
||||||
for (Field field : fields)
|
for (Field field : fields)
|
||||||
|
{
|
||||||
field.dispose();
|
field.dispose();
|
||||||
|
}
|
||||||
if (fields != null)
|
if (fields != null)
|
||||||
|
{
|
||||||
fields.clear();
|
fields.clear();
|
||||||
|
}
|
||||||
|
|
||||||
for (Option option : options)
|
for (Option option : options)
|
||||||
|
{
|
||||||
option.dispose();
|
option.dispose();
|
||||||
|
}
|
||||||
if (options != null)
|
if (options != null)
|
||||||
|
{
|
||||||
options.clear();
|
options.clear();
|
||||||
|
}
|
||||||
|
|
||||||
for (Value value : values)
|
for (Value value : values)
|
||||||
|
{
|
||||||
value.dispose();
|
value.dispose();
|
||||||
|
}
|
||||||
if (values != null)
|
if (values != null)
|
||||||
|
{
|
||||||
values.clear();
|
values.clear();
|
||||||
|
}
|
||||||
|
|
||||||
for (Instance instance : instances)
|
for (Instance instance : instances)
|
||||||
|
{
|
||||||
instance.dispose();
|
instance.dispose();
|
||||||
|
}
|
||||||
if (instances != null)
|
if (instances != null)
|
||||||
|
{
|
||||||
instances.clear();
|
instances.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
params = null;
|
params = null;
|
||||||
|
@@ -552,14 +552,20 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (childMerged == false && head != null)
|
if (childMerged == false && head != null)
|
||||||
|
{
|
||||||
head.toSAX(contentHandler, lexicalHandler, namespaces);
|
head.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.merged == false)
|
if (this.merged == false)
|
||||||
|
{
|
||||||
endElement(contentHandler, namespaces, E_LIST);
|
endElement(contentHandler, namespaces, E_LIST);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dispose
|
* dispose
|
||||||
@@ -567,10 +573,14 @@ public class List extends AbstractWingElement implements WingMergeableElement,
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
if (head != null)
|
if (head != null)
|
||||||
|
{
|
||||||
head.dispose();
|
head.dispose();
|
||||||
|
}
|
||||||
head = null;
|
head = null;
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
contents.clear();
|
contents.clear();
|
||||||
contents = null;
|
contents = null;
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
@@ -211,7 +211,9 @@ public class Options extends AbstractWingElement implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
if (!merged)
|
if (!merged)
|
||||||
{
|
{
|
||||||
@@ -225,7 +227,9 @@ public class Options extends AbstractWingElement implements
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
contents.clear();
|
contents.clear();
|
||||||
contents = null;
|
contents = null;
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
@@ -262,7 +262,9 @@ public class PageMeta extends AbstractWingElement implements
|
|||||||
if (WingConstants.DRI.URI.equals(namespace) && Trail.E_TRAIL.equals(localName))
|
if (WingConstants.DRI.URI.equals(namespace) && Trail.E_TRAIL.equals(localName))
|
||||||
{
|
{
|
||||||
for (Trail trail : trails)
|
for (Trail trail : trails)
|
||||||
|
{
|
||||||
trail.dispose();
|
trail.dispose();
|
||||||
|
}
|
||||||
trails.clear();
|
trails.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,14 +326,20 @@ public class PageMeta extends AbstractWingElement implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Metadata metadata : metadatum)
|
for (Metadata metadata : metadatum)
|
||||||
|
{
|
||||||
metadata.toSAX(contentHandler, lexicalHandler, namespaces);
|
metadata.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
for (Trail trail : trails)
|
for (Trail trail : trails)
|
||||||
|
{
|
||||||
trail.toSAX(contentHandler, lexicalHandler, namespaces);
|
trail.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
if (!merged)
|
if (!merged)
|
||||||
|
{
|
||||||
endElement(contentHandler, namespaces, E_PAGE_META);
|
endElement(contentHandler, namespaces, E_PAGE_META);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dispose
|
* dispose
|
||||||
@@ -339,10 +347,14 @@ public class PageMeta extends AbstractWingElement implements
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
for (Metadata metadata : metadatum)
|
for (Metadata metadata : metadatum)
|
||||||
|
{
|
||||||
metadata.dispose();
|
metadata.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
for (Trail trail : trails)
|
for (Trail trail : trails)
|
||||||
|
{
|
||||||
trail.dispose();
|
trail.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
trails.clear();
|
trails.clear();
|
||||||
trails = null;
|
trails = null;
|
||||||
|
@@ -200,9 +200,13 @@ public class Reference extends AbstractWingElement implements
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
if (contents != null)
|
if (contents != null)
|
||||||
|
{
|
||||||
contents.clear();
|
contents.clear();
|
||||||
|
}
|
||||||
contents = null;
|
contents = null;
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
@@ -235,9 +235,13 @@ public class ReferenceSet extends AbstractWingElement implements
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
if (contents != null)
|
if (contents != null)
|
||||||
|
{
|
||||||
contents.clear();
|
contents.clear();
|
||||||
|
}
|
||||||
contents = null;
|
contents = null;
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
@@ -298,7 +298,9 @@ public class Row extends AbstractWingElement implements StructuralElement
|
|||||||
|
|
||||||
startElement(contentHandler, namespaces, E_ROW, attributes);
|
startElement(contentHandler, namespaces, E_ROW, attributes);
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
endElement(contentHandler, namespaces, E_ROW);
|
endElement(contentHandler, namespaces, E_ROW);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,7 +310,9 @@ public class Row extends AbstractWingElement implements StructuralElement
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
contents.clear();
|
contents.clear();
|
||||||
contents = null;
|
contents = null;
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
@@ -242,7 +242,9 @@ public class Table extends AbstractWingElement implements StructuralElement
|
|||||||
if (head != null)
|
if (head != null)
|
||||||
head.toSAX(contentHandler, lexicalHandler, namespaces);
|
head.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
content.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
endElement(contentHandler, namespaces, E_TABLE);
|
endElement(contentHandler, namespaces, E_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,9 +254,13 @@ public class Table extends AbstractWingElement implements StructuralElement
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
if (head != null)
|
if (head != null)
|
||||||
|
{
|
||||||
head.dispose();
|
head.dispose();
|
||||||
|
}
|
||||||
for (AbstractWingElement content : contents)
|
for (AbstractWingElement content : contents)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
head = null;
|
head = null;
|
||||||
contents.clear();
|
contents.clear();
|
||||||
|
@@ -315,11 +315,15 @@ public class UserMeta extends AbstractWingElement implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Metadata metadata : metadatum)
|
for (Metadata metadata : metadatum)
|
||||||
|
{
|
||||||
metadata.toSAX(contentHandler, lexicalHandler, namespaces);
|
metadata.toSAX(contentHandler, lexicalHandler, namespaces);
|
||||||
|
}
|
||||||
|
|
||||||
if (!merged)
|
if (!merged)
|
||||||
|
{
|
||||||
endElement(contentHandler, namespaces, E_USER_META);
|
endElement(contentHandler, namespaces, E_USER_META);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dispose
|
* dispose
|
||||||
@@ -327,7 +331,9 @@ public class UserMeta extends AbstractWingElement implements
|
|||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
for (AbstractWingElement content : metadatum)
|
for (AbstractWingElement content : metadatum)
|
||||||
|
{
|
||||||
content.dispose();
|
content.dispose();
|
||||||
|
}
|
||||||
metadatum.clear();
|
metadatum.clear();
|
||||||
metadatum = null;
|
metadatum = null;
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
Reference in New Issue
Block a user