added custom attributes enum

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portal/portal-manager@125625 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2016-03-17 14:19:05 +00:00
parent ec89534cbf
commit 44588df835
3 changed files with 40 additions and 13 deletions

View File

@ -0,0 +1,24 @@
package org.gcube.common.portal;
/**
*
* @author Massimiliano Assante, CNR-ISTI
* For gCube Portal Bundle (Site) Custom Attributes keys
*
*/
public enum CustomAttributeKeys {
MANDATORY("Mandatory"),
IS_EXTERNAL("Isexternal"),
URL("Url"),
POST_NOTIFICATION("Postnotificationviaemail"),
VIRTUAL_GROUP("Virtualgroup");
private String name;
private CustomAttributeKeys(String name) {
this.name = name;
}
public String getKeyName() {
return this.name;
}
}

View File

@ -0,0 +1,11 @@
package org.gcube.common.portal;
public class GCubePortalConstants {
public static final String PREFIX_GROUP_URL = "/group";
public static final String INFRASTRUCTURE_NAME = "infrastructure";
public static final String SCOPES = "scopes";
public static final String SENDER_EMAIL = "notificationSenderEmail";
public static final String GATEWAY_NAME = "portalinstancename";
public static final String ADMIN_USERNAME = "administratorUsername";
}

View File

@ -22,14 +22,6 @@ import org.slf4j.LoggerFactory;
*/
public class PortalContext {
private static final Logger _log = LoggerFactory.getLogger(PortalContext.class);
private static final String INFRASTRUCTURE_NAME = "infrastructure";
private static final String SCOPES = "scopes";
private static final String SENDER_EMAIL = "notificationSenderEmail";
private static final String GATEWAY_NAME = "portalinstancename";
private static final String ADMIN_USERNAME = "administratorUsername";
private static PortalContext singleton = new PortalContext();
private String infra;
@ -53,8 +45,8 @@ public class PortalContext {
File propsFile = new File(propertyfile);
FileInputStream fis = new FileInputStream(propsFile);
props.load( fis);
infra = props.getProperty(INFRASTRUCTURE_NAME);
vos = props.getProperty(SCOPES);
infra = props.getProperty(GCubePortalConstants.INFRASTRUCTURE_NAME);
vos = props.getProperty(GCubePortalConstants.SCOPES);
}
catch(IOException e) {
infra = "gcube";
@ -113,7 +105,7 @@ public class PortalContext {
File propsFile = new File(propertyfile);
FileInputStream fis = new FileInputStream(propsFile);
props.load( fis);
toReturn = props.getProperty(GATEWAY_NAME);
toReturn = props.getProperty(GCubePortalConstants.GATEWAY_NAME);
}
//catch exception in case properties file does not exist
catch(IOException e) {
@ -137,7 +129,7 @@ public class PortalContext {
File propsFile = new File(propertyfile);
FileInputStream fis = new FileInputStream(propsFile);
props.load( fis);
toReturn = props.getProperty(SENDER_EMAIL);
toReturn = props.getProperty(GCubePortalConstants.SENDER_EMAIL);
}
//catch exception in case properties file does not exist
catch(IOException e) {
@ -162,7 +154,7 @@ public class PortalContext {
File propsFile = new File(propertyfile);
FileInputStream fis = new FileInputStream(propsFile);
props.load( fis);
toReturn = props.getProperty(ADMIN_USERNAME);
toReturn = props.getProperty(GCubePortalConstants.ADMIN_USERNAME);
}
//catch exception in case properties file does not exist
catch(IOException e) {