Commit af93a2ce authored by George Kalampokis's avatar George Kalampokis

Fixed RDA Import indexing

parent f7a4bee8
......@@ -65,7 +65,6 @@ import org.w3c.dom.NodeList;
import javax.activation.MimetypesFileTypeMap;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.JoinType;
import javax.transaction.Transactional;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
......@@ -417,7 +416,7 @@ public class DatasetManager {
// return exportFile;
}
private XWPFDocument getightWordDocument(ConfigLoader configLoader, DatasetWizardModel dataset, VisibilityRuleService visibilityRuleService) throws IOException {
private XWPFDocument getLightWordDocument(ConfigLoader configLoader, DatasetWizardModel dataset, VisibilityRuleService visibilityRuleService) throws IOException {
WordBuilder wordBuilder = new WordBuilder();
XWPFDocument document = configLoader.getDocument();
......@@ -463,7 +462,7 @@ public class DatasetManager {
}
public String getWordDocumentText (DatasetWizardModel datasetEntity) throws Exception {
XWPFDocument document = getightWordDocument(this.configLoader, datasetEntity, this.apiContext.getUtilitiesService().getVisibilityRuleService());
XWPFDocument document = getLightWordDocument(this.configLoader, datasetEntity, this.apiContext.getUtilitiesService().getVisibilityRuleService());
XWPFWordExtractor extractor = new XWPFWordExtractor(document);
return extractor.getText();/*.replaceAll("\n\\s*", " ");*/
}
......
......@@ -38,6 +38,7 @@ public class MetadataRDAMapper {
rdas.get(rdas.size() - 1).setMetadataStandardId(MetadataStandardIdRDAMapper.toRDA(data.get("uri").asText()));
rdas.get(rdas.size() - 1).setDescription(data.get("label").asText());
rdas.get(rdas.size() - 1).setAdditionalProperty("fieldId", node.get("id").asText());
rdas.get(rdas.size() - 1).setAdditionalProperty("valueId", data.get("id").asText());
rdaMap.put(data.get("uri").asText(), node.get("numbering").asText());
}
}
......@@ -169,6 +170,12 @@ public class MetadataRDAMapper {
Map<String, Object> metadata = mapper.convertValue(rda, Map.class);
Map<String, String> additionalProperties = mapper.convertValue(metadata.get("additional_properties"), Map.class);
String id = additionalProperties.remove("valueId");
additionalProperties.clear();
additionalProperties.put("id", id);
Map<String, String> metadataStandardId = mapper.convertValue(metadata.get("metadata_standard_id"), Map.class);
String url = metadataStandardId.remove("identifier");
......@@ -185,6 +192,7 @@ public class MetadataRDAMapper {
result.putAll(newMetadata);
result.putAll(metadataStandardId);
result.putAll(additionalProperties);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment