Added defaults for missing configuration properties
This commit is contained in:
parent
4df3e7cf5c
commit
bd22fb48c3
|
@ -86,6 +86,14 @@ public class GCoreISConfigurationProxy {
|
||||||
return accessPoint;
|
return accessPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getDefaultSolrURL(String ckanURL) {
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append(ckanURL);
|
||||||
|
stringBuffer.append(ckanURL.endsWith("/")?"":"/");
|
||||||
|
stringBuffer.append("solr/");
|
||||||
|
return stringBuffer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
protected CatalogueConfiguration getCatalogueConfigurationFromIS() {
|
protected CatalogueConfiguration getCatalogueConfigurationFromIS() {
|
||||||
try {
|
try {
|
||||||
boolean mustBeUpdated = false;
|
boolean mustBeUpdated = false;
|
||||||
|
@ -114,7 +122,7 @@ public class GCoreISConfigurationProxy {
|
||||||
catalogueConfiguration.setSysAdminToken(sysAdminToken);
|
catalogueConfiguration.setSysAdminToken(sysAdminToken);
|
||||||
|
|
||||||
|
|
||||||
String defaultOrganization = CatalogueConfiguration.getOrganizationName(context);
|
String defaultOrganization = null;
|
||||||
if (propertyMap.containsKey(DEFAULT_ORGANIZATION_PROPERTY_KEY)) {
|
if (propertyMap.containsKey(DEFAULT_ORGANIZATION_PROPERTY_KEY)) {
|
||||||
String org = propertyMap.get(DEFAULT_ORGANIZATION_PROPERTY_KEY).value().trim();
|
String org = propertyMap.get(DEFAULT_ORGANIZATION_PROPERTY_KEY).value().trim();
|
||||||
if(org!=null && org.compareTo("")==0) {
|
if(org!=null && org.compareTo("")==0) {
|
||||||
|
@ -128,13 +136,13 @@ public class GCoreISConfigurationProxy {
|
||||||
}
|
}
|
||||||
catalogueConfiguration.setDefaultOrganization(defaultOrganization);
|
catalogueConfiguration.setDefaultOrganization(defaultOrganization);
|
||||||
|
|
||||||
|
|
||||||
String solrURL = null;
|
String solrURL = null;
|
||||||
if (propertyMap.containsKey(SOLR_INDEX_ADDRESS_PROPERTY_KEY)) {
|
if (propertyMap.containsKey(SOLR_INDEX_ADDRESS_PROPERTY_KEY)) {
|
||||||
solrURL = propertyMap.get(SOLR_INDEX_ADDRESS_PROPERTY_KEY).value();
|
solrURL = propertyMap.get(SOLR_INDEX_ADDRESS_PROPERTY_KEY).value();
|
||||||
catalogueConfiguration.setSolrURL(solrURL);
|
}else {
|
||||||
|
solrURL = getDefaultSolrURL(ckanURL);
|
||||||
}
|
}
|
||||||
|
catalogueConfiguration.setSolrURL(solrURL);
|
||||||
|
|
||||||
// retrieve option to check if the social post has to be made
|
// retrieve option to check if the social post has to be made
|
||||||
Boolean socialPostEnabled = true;
|
Boolean socialPostEnabled = true;
|
||||||
|
@ -178,12 +186,16 @@ public class GCoreISConfigurationProxy {
|
||||||
supportedOrganizations = getSupportedOrganizationsFromGenericResource();
|
supportedOrganizations = getSupportedOrganizationsFromGenericResource();
|
||||||
mustBeUpdated = true;
|
mustBeUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supportedOrganizations != null) {
|
if (supportedOrganizations != null) {
|
||||||
catalogueConfiguration.setSupportedOrganizations(supportedOrganizations);
|
catalogueConfiguration.setSupportedOrganizations(supportedOrganizations);
|
||||||
|
if(defaultOrganization==null) {
|
||||||
|
defaultOrganization = supportedOrganizations.toArray(new String[supportedOrganizations.size()])[0];
|
||||||
|
catalogueConfiguration.setDefaultOrganization(defaultOrganization);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mustBeUpdated) {
|
if(mustBeUpdated) {
|
||||||
// updateOnIS(serviceEndpoint);
|
|
||||||
logger.warn("The ServiceEndpoint with ID {} in context {} should be updated", serviceEndpoint.id(), context);
|
logger.warn("The ServiceEndpoint with ID {} in context {} should be updated", serviceEndpoint.id(), context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue