diff options
Diffstat (limited to 'sdnr/wt/odlux/core/provider')
3 files changed, 20 insertions, 11 deletions
diff --git a/sdnr/wt/odlux/core/provider/pom.xml b/sdnr/wt/odlux/core/provider/pom.xml index 7436b3768..94a239aa4 100644 --- a/sdnr/wt/odlux/core/provider/pom.xml +++ b/sdnr/wt/odlux/core/provider/pom.xml @@ -49,16 +49,14 @@ <dependencies> <dependency> - <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> + <groupId>${project.groupId}</groupId> <artifactId>sdnr-wt-odlux-core-model</artifactId> <version>${project.version}</version> - <scope>provided</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>sdnr-wt-odlux-framework</artifactId> <version>${project.version}</version> - <scope>provided</scope> </dependency> <dependency> <groupId>org.osgi</groupId> @@ -77,7 +75,6 @@ <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> - <scope>provided</scope> </dependency> <dependency> <groupId>org.mockito</groupId> @@ -90,14 +87,14 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.onap.ccsdk.features.sdnr.wt</groupId> - <artifactId>sdnr-wt-common</artifactId> - <version>${project.version}</version> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-server</artifactId> <scope>test</scope> </dependency> <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> + <groupId>${project.groupId}</groupId> + <artifactId>sdnr-wt-common</artifactId> + <version>${project.version}</version> <scope>test</scope> </dependency> </dependencies> diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java index c1cf875fc..82df2f0cd 100644 --- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java +++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java @@ -48,14 +48,18 @@ public class IndexOdluxBundle extends OdluxBundle implements OdluxBundleResource private static final String ENABLE_OAUTH_DEFAULT = "false"; private static final String ENV_ENABLE_ODLUX_RBAC = "ENABLE_ODLUX_RBAC"; private static final String ENABLE_ODLUX_RBAC_DEFAULT = "false"; + private static final String ENV_TRANSPORTPCEGUIURL = "TRPCEGUIURL"; + private static final String TRANSPORTPCEGUIURL_DEFAULT = ""; private final boolean oauthEnabled; private final boolean policyEnabled; + private final String transportPceGuiUrl; public IndexOdluxBundle() { super(null, BUNDLENAME_APP); this.oauthEnabled = "true".equals(getEnvVar(ENV_ENABLE_OAUTH, ENABLE_OAUTH_DEFAULT)); this.policyEnabled = "true".equals(getEnvVar(ENV_ENABLE_ODLUX_RBAC, ENABLE_ODLUX_RBAC_DEFAULT)); + this.transportPceGuiUrl = getEnvVar(ENV_TRANSPORTPCEGUIURL, TRANSPORTPCEGUIURL_DEFAULT); LOG.info("instantiating index with oauthEnabled={} and policyEnabled={}",this.oauthEnabled, this.policyEnabled); } @@ -134,8 +138,15 @@ public class IndexOdluxBundle extends OdluxBundle implements OdluxBundleResource } private String generateConfigureJson() { - return String.format("{\"authentication\":\"%s\",\"enablePolicy\":%s}", this.oauthEnabled ? "oauth" : "basic", - String.valueOf(this.policyEnabled)); + StringBuilder sb = new StringBuilder(); + sb.append(String.format("{\"authentication\":\"%s\",\"enablePolicy\":%s", this.oauthEnabled ? "oauth" : "basic", + String.valueOf(this.policyEnabled))); + if (this.transportPceGuiUrl != null && this.transportPceGuiUrl.length() > 0) { + sb.append(String.format(",\"transportpceUrl\":\"%s\"}", this.transportPceGuiUrl)); + } else { + sb.append("}"); + } + return sb.toString(); } private static String getEnvVar(String v, String defaultValue) { diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java index b8afc3329..62e73ef1d 100644 --- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java +++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java @@ -88,4 +88,5 @@ public class ResFilesServlet extends HttpServlet { return t; } + } |