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 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 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 PURGE_QUERY_PARAMETER = "purge";
|
||||
public static final String APPLICATION_JSON_CHARSET_UTF_8 = "application/json;charset=UTF-8";
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package org.gcube.gcat.api.configuration;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
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.JsonProperty;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
|
||||
|
@ -14,9 +17,18 @@ import org.gcube.common.scope.impl.ScopeBean;
|
|||
public class CatalogueConfiguration {
|
||||
|
||||
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 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 CKAN_DB_KEY = "ckanDB";
|
||||
|
||||
protected String id;
|
||||
|
@ -26,17 +38,17 @@ public class CatalogueConfiguration {
|
|||
protected String defaultOrganization;
|
||||
protected Set<String> supportedOrganizations;
|
||||
|
||||
protected String ckanURL;
|
||||
|
||||
protected String sysAdminToken;
|
||||
|
||||
protected String ckanURL;
|
||||
protected String solrURL;
|
||||
|
||||
protected boolean socialPostEnabled;
|
||||
protected boolean notificationToUsersEnabled;
|
||||
|
||||
protected boolean moderationEnabled;
|
||||
|
||||
protected Map<String,Object> additionalProperties;
|
||||
|
||||
protected CKANDB ckanDB;
|
||||
|
||||
/*
|
||||
|
@ -72,55 +84,13 @@ public class CatalogueConfiguration {
|
|||
this.defaultOrganization = CatalogueConfiguration.getOrganizationName(context);
|
||||
this.supportedOrganizations.add(defaultOrganization);
|
||||
}
|
||||
|
||||
@JsonProperty(value = CKAN_URL_KEY)
|
||||
public String getCkanURL() {
|
||||
return ckanURL;
|
||||
}
|
||||
|
||||
public void setCkanURL(String ckanURL) {
|
||||
this.ckanURL = ckanURL;
|
||||
}
|
||||
|
||||
public String getSysAdminToken() {
|
||||
return sysAdminToken;
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
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;
|
||||
public void setID(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@JsonProperty(value = CONTEXT_KEY)
|
||||
|
@ -134,6 +104,12 @@ public class CatalogueConfiguration {
|
|||
this.scopeBean = new ScopeBean(context);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public ScopeBean getScopeBean() {
|
||||
return scopeBean;
|
||||
}
|
||||
|
||||
@JsonProperty(value = DEFAULT_ORGANIZATION_KEY)
|
||||
public String getDefaultOrganization() {
|
||||
if(defaultOrganization == null) {
|
||||
defaultOrganization = CatalogueConfiguration.getOrganizationName(context);
|
||||
|
@ -145,25 +121,73 @@ public class CatalogueConfiguration {
|
|||
this.defaultOrganization = defaultOrganization;
|
||||
}
|
||||
|
||||
@JsonProperty(value = SUPPORTED_ORGANIZATIONS_KEY)
|
||||
public Set<String> getSupportedOrganizations() {
|
||||
if(supportedOrganizations.isEmpty()) {
|
||||
supportedOrganizations.add(getDefaultOrganization());
|
||||
}
|
||||
return supportedOrganizations;
|
||||
}
|
||||
|
||||
|
||||
public void setSupportedOrganizations(Set<String> supportedOrganizations) {
|
||||
this.supportedOrganizations = supportedOrganizations;
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
|
||||
@JsonProperty(value = SYS_ADMIN_TOKEN_KEY)
|
||||
public String getSysAdminToken() {
|
||||
return sysAdminToken;
|
||||
}
|
||||
|
||||
public void setID(String id) {
|
||||
this.id = id;
|
||||
public void setSysAdminToken(String sysAdminToken) {
|
||||
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() {
|
||||
return ckanDB;
|
||||
}
|
||||
|
@ -172,9 +196,22 @@ public class CatalogueConfiguration {
|
|||
this.ckanDB = ckanDB;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public ScopeBean getScopeBean() {
|
||||
return scopeBean;
|
||||
@JsonAnyGetter
|
||||
public Map<String,Object> getAdditionalProperties() {
|
||||
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