Fixed service class and name
This commit is contained in:
parent
7e38fc8fb4
commit
a7ff757499
|
@ -5,9 +5,12 @@ package org.gcube.gcat.api;
|
||||||
*/
|
*/
|
||||||
public class GCatConstants {
|
public class GCatConstants {
|
||||||
|
|
||||||
public static final String SERVICE_CLASS = "data-catalogue";
|
public static final String SERVICE_CLASS = "org.gcube.data-catalogue";
|
||||||
public static final String SERVICE_NAME = "gcat";
|
public static final String SERVICE_NAME = "gcat";
|
||||||
|
|
||||||
|
public final static String CONFIGURATION_CATEGORY = GCatConstants.SERVICE_CLASS;
|
||||||
|
public final static String CONFIGURATION_NAME = GCatConstants.SERVICE_NAME + "-configuration";
|
||||||
|
|
||||||
public static final String SERVICE_ENTRY_NAME = "org.gcube.gcat.ResourceInitializer";
|
public static final String SERVICE_ENTRY_NAME = "org.gcube.gcat.ResourceInitializer";
|
||||||
public static final String PURGE_QUERY_PARAMETER = "purge";
|
public static final String PURGE_QUERY_PARAMETER = "purge";
|
||||||
public static final String APPLICATION_JSON_CHARSET_UTF_8 = "application/json;charset=UTF-8";
|
public static final String APPLICATION_JSON_CHARSET_UTF_8 = "application/json;charset=UTF-8";
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
package org.gcube.gcat.api.configuration;
|
package org.gcube.gcat.api.configuration;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||||
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
|
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
|
||||||
|
@ -14,9 +17,18 @@ import org.gcube.common.scope.impl.ScopeBean;
|
||||||
public class CatalogueConfiguration {
|
public class CatalogueConfiguration {
|
||||||
|
|
||||||
public static final String CONTEXT_KEY = "context";
|
public static final String CONTEXT_KEY = "context";
|
||||||
public static final String CKAN_URL_KEY = "ckanURL";
|
public static final String DEFAULT_ORGANIZATION_KEY = "defaultOrganization";
|
||||||
|
public static final String SUPPORTED_ORGANIZATIONS_KEY = "supportedOrganizations";
|
||||||
|
|
||||||
public static final String SYS_ADMIN_TOKEN_KEY = "sysAdminToken";
|
public static final String SYS_ADMIN_TOKEN_KEY = "sysAdminToken";
|
||||||
|
|
||||||
|
public static final String SOCIAL_POST_ENABLED_KEY = "socialPostEnabled";
|
||||||
|
public static final String NOTIFICATION_TO_USER_ENABLED_KEY = "notificationToUsersEnabled";
|
||||||
|
public static final String MODERATION_ENABLED_KEY = "moderationEnabled";
|
||||||
|
|
||||||
|
public static final String CKAN_URL_KEY = "ckanURL";
|
||||||
public static final String SOLR_URL_KEY = "solrURL";
|
public static final String SOLR_URL_KEY = "solrURL";
|
||||||
|
|
||||||
public static final String CKAN_DB_KEY = "ckanDB";
|
public static final String CKAN_DB_KEY = "ckanDB";
|
||||||
|
|
||||||
protected String id;
|
protected String id;
|
||||||
|
@ -26,17 +38,17 @@ public class CatalogueConfiguration {
|
||||||
protected String defaultOrganization;
|
protected String defaultOrganization;
|
||||||
protected Set<String> supportedOrganizations;
|
protected Set<String> supportedOrganizations;
|
||||||
|
|
||||||
protected String ckanURL;
|
|
||||||
|
|
||||||
protected String sysAdminToken;
|
protected String sysAdminToken;
|
||||||
|
|
||||||
|
protected String ckanURL;
|
||||||
protected String solrURL;
|
protected String solrURL;
|
||||||
|
|
||||||
protected boolean socialPostEnabled;
|
protected boolean socialPostEnabled;
|
||||||
protected boolean notificationToUsersEnabled;
|
protected boolean notificationToUsersEnabled;
|
||||||
|
|
||||||
protected boolean moderationEnabled;
|
protected boolean moderationEnabled;
|
||||||
|
|
||||||
|
protected Map<String,Object> additionalProperties;
|
||||||
|
|
||||||
protected CKANDB ckanDB;
|
protected CKANDB ckanDB;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -73,54 +85,12 @@ public class CatalogueConfiguration {
|
||||||
this.supportedOrganizations.add(defaultOrganization);
|
this.supportedOrganizations.add(defaultOrganization);
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty(value = CKAN_URL_KEY)
|
public String getID() {
|
||||||
public String getCkanURL() {
|
return id;
|
||||||
return ckanURL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCkanURL(String ckanURL) {
|
public void setID(String id) {
|
||||||
this.ckanURL = ckanURL;
|
this.id = id;
|
||||||
}
|
|
||||||
|
|
||||||
public String getSysAdminToken() {
|
|
||||||
return sysAdminToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSysAdminToken(String sysAdminToken) {
|
|
||||||
this.sysAdminToken = sysAdminToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonProperty(value = SOLR_URL_KEY)
|
|
||||||
public String getSolrURL() {
|
|
||||||
return solrURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSolrURL(String solrURL) {
|
|
||||||
this.solrURL = solrURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSocialPostEnabled() {
|
|
||||||
return socialPostEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSocialPostEnabled(boolean socialPostEnabled) {
|
|
||||||
this.socialPostEnabled = socialPostEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isNotificationToUsersEnabled() {
|
|
||||||
return notificationToUsersEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNotificationToUsersEnabled(boolean notificationToUsersEnabled) {
|
|
||||||
this.notificationToUsersEnabled = notificationToUsersEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isModerationEnabled() {
|
|
||||||
return moderationEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModerationEnabled(boolean moderationEnabled) {
|
|
||||||
this.moderationEnabled = moderationEnabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty(value = CONTEXT_KEY)
|
@JsonProperty(value = CONTEXT_KEY)
|
||||||
|
@ -134,6 +104,12 @@ public class CatalogueConfiguration {
|
||||||
this.scopeBean = new ScopeBean(context);
|
this.scopeBean = new ScopeBean(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public ScopeBean getScopeBean() {
|
||||||
|
return scopeBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = DEFAULT_ORGANIZATION_KEY)
|
||||||
public String getDefaultOrganization() {
|
public String getDefaultOrganization() {
|
||||||
if(defaultOrganization == null) {
|
if(defaultOrganization == null) {
|
||||||
defaultOrganization = CatalogueConfiguration.getOrganizationName(context);
|
defaultOrganization = CatalogueConfiguration.getOrganizationName(context);
|
||||||
|
@ -145,6 +121,7 @@ public class CatalogueConfiguration {
|
||||||
this.defaultOrganization = defaultOrganization;
|
this.defaultOrganization = defaultOrganization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = SUPPORTED_ORGANIZATIONS_KEY)
|
||||||
public Set<String> getSupportedOrganizations() {
|
public Set<String> getSupportedOrganizations() {
|
||||||
if(supportedOrganizations.isEmpty()) {
|
if(supportedOrganizations.isEmpty()) {
|
||||||
supportedOrganizations.add(getDefaultOrganization());
|
supportedOrganizations.add(getDefaultOrganization());
|
||||||
|
@ -156,14 +133,61 @@ public class CatalogueConfiguration {
|
||||||
this.supportedOrganizations = supportedOrganizations;
|
this.supportedOrganizations = supportedOrganizations;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getID() {
|
@JsonProperty(value = SYS_ADMIN_TOKEN_KEY)
|
||||||
return id;
|
public String getSysAdminToken() {
|
||||||
|
return sysAdminToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setID(String id) {
|
public void setSysAdminToken(String sysAdminToken) {
|
||||||
this.id = id;
|
this.sysAdminToken = sysAdminToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = CKAN_URL_KEY)
|
||||||
|
public String getCkanURL() {
|
||||||
|
return ckanURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCkanURL(String ckanURL) {
|
||||||
|
this.ckanURL = ckanURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = SOLR_URL_KEY)
|
||||||
|
public String getSolrURL() {
|
||||||
|
return solrURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSolrURL(String solrURL) {
|
||||||
|
this.solrURL = solrURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = SOCIAL_POST_ENABLED_KEY)
|
||||||
|
public boolean isSocialPostEnabled() {
|
||||||
|
return socialPostEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSocialPostEnabled(boolean socialPostEnabled) {
|
||||||
|
this.socialPostEnabled = socialPostEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = NOTIFICATION_TO_USER_ENABLED_KEY)
|
||||||
|
public boolean isNotificationToUsersEnabled() {
|
||||||
|
return notificationToUsersEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNotificationToUsersEnabled(boolean notificationToUsersEnabled) {
|
||||||
|
this.notificationToUsersEnabled = notificationToUsersEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = MODERATION_ENABLED_KEY)
|
||||||
|
public boolean isModerationEnabled() {
|
||||||
|
return moderationEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModerationEnabled(boolean moderationEnabled) {
|
||||||
|
this.moderationEnabled = moderationEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = CKAN_DB_KEY)
|
||||||
public CKANDB getCkanDB() {
|
public CKANDB getCkanDB() {
|
||||||
return ckanDB;
|
return ckanDB;
|
||||||
}
|
}
|
||||||
|
@ -172,9 +196,22 @@ public class CatalogueConfiguration {
|
||||||
this.ckanDB = ckanDB;
|
this.ckanDB = ckanDB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonAnyGetter
|
||||||
public ScopeBean getScopeBean() {
|
public Map<String,Object> getAdditionalProperties() {
|
||||||
return scopeBean;
|
return additionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdditionalProperties(Map<String,Object> additionalProperties) {
|
||||||
|
this.additionalProperties = additionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getAdditionalProperty(String key) {
|
||||||
|
return this.additionalProperties.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonAnySetter
|
||||||
|
public void setAdditionalProperty(String key, Object value) {
|
||||||
|
this.additionalProperties.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue