documentTypeQuery.select(documentType.getKey(), true);
selectedDocumentTypes.add(documentType.getKey());
}
//metadatas
SearchMetadataFieldsProvider metadataProvider = (SearchMetadataFieldsProvider) CoreSpringFactory.getBean("SearchMetadataFieldsProvider");
// The metadata key selection, e.g DC.language for doublin core language metadata
List<String> metaDataList = metadataProvider.getAdvancedSearchableFields();
if (metaDataList.size() > 0) {
String[] metaDataFields = ArrayHelper.toArray(metaDataList);
String[] metaDataFieldsTranslated = new String[metaDataFields.length];
Translator metaTranslator = metadataProvider.createFieldsTranslator(getLocale());
for (int i=0; i < metaDataFields.length; i++) {
String key = metaDataFields[i];
metaDataFieldsTranslated[i] = key + " (" + metaTranslator.translate(key) + ")";
}
metadataType = uifactory.addDropdownSingleselect("metadata_type", "form.search.label.metadatatype", formLayout, metaDataFields, metaDataFieldsTranslated, null);