mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 23:43:06 +00:00
Clean up formatting so I can read the code
This commit is contained in:
@@ -87,12 +87,14 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
{
|
||||
class xmlFilter implements java.io.FilenameFilter
|
||||
{
|
||||
@Override
|
||||
public boolean accept(File dir, String name)
|
||||
{
|
||||
return name.endsWith(".xml");
|
||||
}
|
||||
}
|
||||
String vocabulariesPath = ConfigurationManager.getProperty("dspace.dir") + "/config/controlled-vocabularies/";
|
||||
String vocabulariesPath = ConfigurationManager.getProperty("dspace.dir")
|
||||
+ "/config/controlled-vocabularies/";
|
||||
String[] xmlFiles = (new File(vocabulariesPath)).list(new xmlFilter());
|
||||
List<String> names = new ArrayList<String>();
|
||||
for (String filename : xmlFiles)
|
||||
@@ -154,6 +156,7 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Choices getMatches(String field, String text, int collection, int start, int limit, String locale)
|
||||
{
|
||||
init();
|
||||
@@ -162,7 +165,8 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
XPath xpath = XPathFactory.newInstance().newXPath();
|
||||
Choice[] choices;
|
||||
try {
|
||||
NodeList results = (NodeList)xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODESET);
|
||||
NodeList results = (NodeList) xpath.evaluate(xpathExpression,
|
||||
vocabulary, XPathConstants.NODESET);
|
||||
String[] authorities = new String[results.getLength()];
|
||||
String[] values = new String[results.getLength()];
|
||||
String[] labels = new String[results.getLength()];
|
||||
@@ -194,7 +198,8 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
{
|
||||
for (int i = 0; i < resultCount; i++)
|
||||
{
|
||||
choices[i] = new Choice(authorities[start+i],values[start+i],labels[start+i]);
|
||||
choices[i] = new Choice(authorities[start + i], values[start
|
||||
+ i], labels[start + i]);
|
||||
}
|
||||
}
|
||||
} catch(XPathExpressionException e) {
|
||||
@@ -203,6 +208,7 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
return new Choices(choices, 0, choices.length, Choices.CF_AMBIGUOUS, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Choices getBestMatch(String field, String text, int collection, String locale)
|
||||
{
|
||||
init();
|
||||
@@ -210,6 +216,7 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
return getMatches(field, text, collection, 0, 2, locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel(String field, String key, String locale)
|
||||
{
|
||||
init();
|
||||
|
Reference in New Issue
Block a user