mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 20:13:17 +00:00
Search indexing all values (now getControlledVocabulariesDisplayValueLocalized returns a list of all the values and the DSIndexer manages these values)
A return statement is added if the item has no collection
This commit is contained in:
@@ -363,9 +363,9 @@ public class Util {
|
||||
|
||||
|
||||
/**
|
||||
* Get the localized respective "displayed-value" from the given
|
||||
* "stored-value" for a specific metadata field of a DSpace Item, by reading
|
||||
* input-forms.xml. In this case the localized input-forms is used, e.g. input-forms_el.xml
|
||||
* Get a list of all the respective "displayed-value(s)" from the given
|
||||
* "stored-value(s)" for a specific metadata field of a DSpace Item, by reading
|
||||
* input-forms.xml
|
||||
*
|
||||
* @param item
|
||||
* The Dspace Item
|
||||
@@ -377,14 +377,12 @@ public class Util {
|
||||
* A String with the element name of the metadata field
|
||||
* @param qualifier
|
||||
* A String with the qualifier name of the metadata field
|
||||
* @param Locale
|
||||
* The given locale
|
||||
* @return A String of the respective "displayed-value"
|
||||
* @return A list of the respective "displayed-values"
|
||||
*/
|
||||
|
||||
public static String getControlledVocabulariesDisplayValueLocalized(Item item, DCValue[] values, String schema, String element, String qualifier, Locale locale) throws SQLException, DCInputsReaderException{
|
||||
public static List getControlledVocabulariesDisplayValueLocalized(Item item, DCValue[] values, String schema, String element, String qualifier, Locale locale) throws SQLException, DCInputsReaderException{
|
||||
|
||||
String toReturn="";
|
||||
List toReturn=new ArrayList<String>();
|
||||
DCInput myInputs = null;
|
||||
boolean myInputsFound=false;
|
||||
String formFileName = I18nUtil.getInputFormsFileName(locale);
|
||||
@@ -398,7 +396,8 @@ public class Util {
|
||||
|
||||
if (collection==null)
|
||||
{
|
||||
col_handle = "db-id/" + item.getID();
|
||||
// col_handle = "db-id/" + item.getID();
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
col_handle = collection.getHandle();
|
||||
@@ -451,16 +450,12 @@ public class Util {
|
||||
|
||||
if (displayVal!=null && !"".equals(displayVal)){
|
||||
|
||||
return displayVal;
|
||||
toReturn.add(displayVal);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1071,16 +1071,20 @@ public class DSIndexer
|
||||
//Index the controlled vocabularies localized display values for all localized input-forms.xml (e.g. input-forms_el.xml)
|
||||
if ("inputform".equalsIgnoreCase(indexConfigArr[i].type)){
|
||||
|
||||
|
||||
List newValues=new ArrayList<String>();
|
||||
String displayValue;
|
||||
Locale[] supportedLocales=I18nUtil.getSupportedLocales();
|
||||
|
||||
//Get the display value of the respective stored value
|
||||
for (int k=0;k<supportedLocales.length;k++){
|
||||
List displayValues=new ArrayList<String>();
|
||||
displayValues = org.dspace.app.util.Util.getControlledVocabulariesDisplayValueLocalized(item, mydc,indexConfigArr[i].schema, indexConfigArr[i].element, indexConfigArr[i].qualifier, supportedLocales[k]);
|
||||
if (displayValues!=null && !displayValues.isEmpty()){
|
||||
for (int d=0;d<displayValues.size();d++){
|
||||
newValues.add(displayValues.get(d));
|
||||
}
|
||||
}
|
||||
|
||||
displayValue = org.dspace.app.util.Util.getControlledVocabulariesDisplayValueLocalized(item, mydc,indexConfigArr[i].schema, indexConfigArr[i].element, indexConfigArr[i].qualifier, supportedLocales[k]);
|
||||
newValues.add(displayValue);
|
||||
}
|
||||
|
||||
if (newValues!=null){
|
||||
|
Reference in New Issue
Block a user