migration fixes
This commit is contained in:
parent
7f2abaedd5
commit
0d245492f7
|
@ -660,15 +660,18 @@ public class DescriptionTemplateXmlMigrationService {
|
|||
|
||||
ExternalFetcherApiSourceConfigurationEntity apiEntity = new ExternalFetcherApiSourceConfigurationEntity();
|
||||
|
||||
|
||||
String source = persist.getAutoCompleteOptions() != null ? persist.getAutoCompleteOptions().getSource() : null;
|
||||
|
||||
if ( source == null || source.isEmpty()) {
|
||||
URI uri;
|
||||
if (persist.getUrl().contains("?")) {
|
||||
uri = new URI(persist.getUrl().substring(0, persist.getUrl().trim().lastIndexOf("?")));
|
||||
} else {
|
||||
uri = new URI(persist.getUrl().trim());
|
||||
}
|
||||
String source = persist.getAutoCompleteOptions().getSource();
|
||||
source = source != null && !source.isEmpty() ? source : uri.getHost();
|
||||
|
||||
source = uri.getHost();
|
||||
}
|
||||
String parsedUrl = persist.getUrl().trim();
|
||||
parsedUrl = parsedUrl.replace("%20", " ");
|
||||
parsedUrl = parsedUrl.replace("%22", "\"");
|
||||
|
@ -705,14 +708,14 @@ public class DescriptionTemplateXmlMigrationService {
|
|||
|
||||
|
||||
data.setResultsArrayPath(persist.getOptionsRoot());
|
||||
if (persist.getAutoCompleteOptions() == null && this.conventionService.isNullOrEmpty(persist.getAutoCompleteOptions().getLabel())) {
|
||||
if (persist.getAutoCompleteOptions() != null && !this.conventionService.isNullOrEmpty(persist.getAutoCompleteOptions().getLabel())) {
|
||||
data.setFieldsMapping(new ArrayList<>());
|
||||
ResultFieldsMappingConfigurationEntity labelField = new ResultFieldsMappingConfigurationEntity();
|
||||
labelField.setCode(ReferenceEntity.KnownFields.Label);
|
||||
labelField.setResponsePath(persist.getAutoCompleteOptions().getLabel());
|
||||
data.getFieldsMapping().add(labelField);
|
||||
}
|
||||
if (persist.getAutoCompleteOptions() == null && this.conventionService.isNullOrEmpty(persist.getAutoCompleteOptions().getValue())) {
|
||||
if (persist.getAutoCompleteOptions() != null && !this.conventionService.isNullOrEmpty(persist.getAutoCompleteOptions().getValue())) {
|
||||
ResultFieldsMappingConfigurationEntity idField = new ResultFieldsMappingConfigurationEntity();
|
||||
idField.setCode(ReferenceEntity.KnownFields.ReferenceId);
|
||||
idField.setResponsePath(persist.getAutoCompleteOptions().getValue());
|
||||
|
|
Loading…
Reference in New Issue