summaryrefslogtreecommitdiffstats
path: root/ccsdk-app-os
diff options
context:
space:
mode:
authorHong Guan <hg4105@att.com>2018-03-07 12:21:17 -0500
committerHong Guan <hg4105@att.com>2018-03-07 12:21:17 -0500
commit3df51c6bb79df182be4f0f1bac20bde75f434494 (patch)
tree65a3ed0a009a2e198f932ba186a2cdcd5bf2d221 /ccsdk-app-os
parent8e60d8171fd7e42c4a2089f50ce751a695dab018 (diff)
Fix dashboard repo issue
Change-Id: I264bc0ec06bc308816bd96982efdfef28264978c Issue-ID: CCSDK-196 Signed-off-by: Hong Guan <hg4105@att.com>
Diffstat (limited to 'ccsdk-app-os')
-rw-r--r--ccsdk-app-os/pom.xml338
-rw-r--r--ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java327
-rw-r--r--ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java94
-rw-r--r--ccsdk-app-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java124
-rw-r--r--ccsdk-app-os/src/main/java/org/onap/portalapp/lm/FusionLicenseManagerImpl.java218
-rw-r--r--ccsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java182
-rw-r--r--ccsdk-app-os/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java136
-rw-r--r--ccsdk-app-os/src/main/resources/portal.properties89
-rw-r--r--ccsdk-app-os/src/main/webapp/WEB-INF/jsp/login_external.jsp226
9 files changed, 878 insertions, 856 deletions
diff --git a/ccsdk-app-os/pom.xml b/ccsdk-app-os/pom.xml
index 4d8975d..0efd176 100644
--- a/ccsdk-app-os/pom.xml
+++ b/ccsdk-app-os/pom.xml
@@ -1,169 +1,169 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.onap.ccsdk.dashboard</groupId>
- <artifactId>ccsdk-app-os</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <packaging>war</packaging>
- <name>ONAP Operations Manager Dashboard app</name>
- <description>CCSDK Dashboard Web Application for external release</description>
-
- <properties>
- <encoding>UTF-8</encoding>
- <springframework.version>4.2.0.RELEASE</springframework.version>
- <hibernate.version>4.3.11.Final</hibernate.version>
- <epsdk.version>1.1.0</epsdk.version>
- <ccsdk.version>1.1.0-SNAPSHOT</ccsdk.version>
- <nexusproxy>https://nexus.onap.org</nexusproxy>
- <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
- <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
- <!-- supplied by Jenkins server -->
- <build.version>${project.version}</build.version>
- <!-- Tests usually require some setup that maven cannot do, so skip. -->
- <skiptests>true</skiptests>
- </properties>
-
- <repositories>
- <repository>
- <!-- Releases repository has ECOMP release artifacts -->
- <id>ecomp-releases</id>
- <name>OpenECOMP - Release Repository</name>
- <url>${nexusproxy}/${releaseNexusPath}</url>
- </repository>
- <repository>
- <!-- Snapshots repository has ECOMP snapshot artifacts -->
- <id>ecomp-snapshots</id>
- <name>OpenECOMP - Snapshot Repository</name>
- <url>${nexusproxy}/${snapshotNexusPath}</url>
- </repository>
- </repositories>
-
- <build>
-
- <!-- War files are labeled with build information, not POM version -->
- <finalName>${project.artifactId}-${build.version}</finalName>
-
- <plugins>
- <!-- Compile to Java 1.8 class output format -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>3.0.0</version>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Build-Number>${build.version}</Build-Number>
- <Build-Time>${maven.build.timestamp}</Build-Time>
- </manifestEntries>
- </archive>
- <overlays>
- <overlay>
- <groupId>org.onap.ccsdk.dashboard</groupId>
- <artifactId>ccsdk-app-overlay</artifactId>
- </overlay>
- <overlay>
- <groupId>org.openecomp.ecompsdkos</groupId>
- <artifactId>epsdk-app-overlay</artifactId>
- <excludes>
- <exclude>app/fusionapp/**</exclude>
- <exclude>app/fusion/ase/**</exclude>
- <exclude>app/fusion/external/angular-1.5/**</exclude>
- <exclude>app/fusion/external/gis/**</exclude>
- <exclude>app/fusion/external/leaflet-0.7.3/**</exclude>
- <exclude>app/fusion/external/lodash/**</exclude>
- <exclude>app/fusion/external/samples/**</exclude>
- <exclude>app/fusion/external/showdown/**</exclude>
- <exclude>app/fusion/notebook-integration/**</exclude>
- <exclude>static/fusion/sample/**</exclude>
- <exclude>static/fusion/raptor/**</exclude>
- </excludes>
- </overlay>
- </overlays>
- </configuration>
- </plugin>
- <!-- no deployment needed -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <!-- ECD webapp resources -->
- <dependency>
- <groupId>org.onap.ccsdk.dashboard</groupId>
- <artifactId>ccsdk-app-overlay</artifactId>
- <version>${ccsdk.version}</version>
- <type>war</type>
- </dependency>
- <!-- ECD webapp controllers -->
- <dependency>
- <groupId>org.onap.ccsdk.dashboard</groupId>
- <artifactId>ccsdk-app-common</artifactId>
- <version>${ccsdk.version}</version>
- </dependency>
- <!-- SDK webapp resources -->
- <dependency>
- <groupId>org.openecomp.ecompsdkos</groupId>
- <artifactId>epsdk-app-overlay</artifactId>
- <version>${epsdk.version}</version>
- <type>war</type>
- </dependency>
- <!-- SDK webapp controllers -->
- <dependency>
- <groupId>org.openecomp.ecompsdkos</groupId>
- <artifactId>epsdk-app-common</artifactId>
- <version>${epsdk.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.openecomp.ecompsdkos</groupId>
- <artifactId>epsdk-analytics</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.openecomp.ecompsdkos</groupId>
- <artifactId>epsdk-workflow</artifactId>
- </exclusion>
- <exclusion>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.elasticsearch</groupId>
- <artifactId>elasticsearch</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.quartz-scheduler</groupId>
- <artifactId>quartz</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.drools</groupId>
- <artifactId>drools-compiler</artifactId>
- </exclusion>
- <exclusion>
- <groupId>io.searchbox</groupId>
- <artifactId>jest</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.onap.ccsdk.dashboard</groupId>
+ <artifactId>ccsdk-app-os</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>ONAP Operations Manager Dashboard app</name>
+ <description>CCSDK Dashboard Web Application for external release</description>
+
+ <properties>
+ <encoding>UTF-8</encoding>
+ <springframework.version>4.2.0.RELEASE</springframework.version>
+ <hibernate.version>4.3.11.Final</hibernate.version>
+ <epsdk.version>2.1.0</epsdk.version>
+ <ccsdk.version>1.1.0-SNAPSHOT</ccsdk.version>
+ <nexusproxy>https://nexus.onap.org</nexusproxy>
+ <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
+ <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
+ <!-- supplied by Jenkins server -->
+ <build.version>${project.version}</build.version>
+ <!-- Tests usually require some setup that maven cannot do, so skip. -->
+ <skiptests>true</skiptests>
+ </properties>
+
+ <repositories>
+ <repository>
+ <!-- Releases repository has ECOMP release artifacts -->
+ <id>ecomp-releases</id>
+ <name>OpenECOMP - Release Repository</name>
+ <url>${nexusproxy}/${releaseNexusPath}</url>
+ </repository>
+ <repository>
+ <!-- Snapshots repository has ECOMP snapshot artifacts -->
+ <id>ecomp-snapshots</id>
+ <name>OpenECOMP - Snapshot Repository</name>
+ <url>${nexusproxy}/${snapshotNexusPath}</url>
+ </repository>
+ </repositories>
+
+ <build>
+
+ <!-- War files are labeled with build information, not POM version -->
+ <finalName>${project.artifactId}-${build.version}</finalName>
+
+ <plugins>
+ <!-- Compile to Java 1.8 class output format -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>3.0.0</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Build-Number>${build.version}</Build-Number>
+ <Build-Time>${maven.build.timestamp}</Build-Time>
+ </manifestEntries>
+ </archive>
+ <overlays>
+ <overlay>
+ <groupId>org.onap.ccsdk.dashboard</groupId>
+ <artifactId>ccsdk-app-overlay</artifactId>
+ </overlay>
+ <overlay>
+ <groupId>org.onap.portal.sdk</groupId>
+ <artifactId>epsdk-app-overlay</artifactId>
+ <excludes>
+ <exclude>app/fusionapp/**</exclude>
+ <exclude>app/fusion/ase/**</exclude>
+ <exclude>app/fusion/external/angular-1.5/**</exclude>
+ <exclude>app/fusion/external/gis/**</exclude>
+ <exclude>app/fusion/external/leaflet-0.7.3/**</exclude>
+ <exclude>app/fusion/external/lodash/**</exclude>
+ <exclude>app/fusion/external/samples/**</exclude>
+ <exclude>app/fusion/external/showdown/**</exclude>
+ <exclude>app/fusion/notebook-integration/**</exclude>
+ <exclude>static/fusion/sample/**</exclude>
+ <exclude>static/fusion/raptor/**</exclude>
+ </excludes>
+ </overlay>
+ </overlays>
+ </configuration>
+ </plugin>
+ <!-- no deployment needed -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- ECD webapp resources -->
+ <dependency>
+ <groupId>org.onap.ccsdk.dashboard</groupId>
+ <artifactId>ccsdk-app-overlay</artifactId>
+ <version>${ccsdk.version}</version>
+ <type>war</type>
+ </dependency>
+ <!-- ECD webapp controllers -->
+ <dependency>
+ <groupId>org.onap.ccsdk.dashboard</groupId>
+ <artifactId>ccsdk-app-common</artifactId>
+ <version>${ccsdk.version}</version>
+ </dependency>
+ <!-- SDK webapp resources -->
+ <dependency>
+ <groupId>org.onap.portal.sdk</groupId>
+ <artifactId>epsdk-app-overlay</artifactId>
+ <version>${epsdk.version}</version>
+ <type>war</type>
+ </dependency>
+ <!-- SDK webapp controllers -->
+ <dependency>
+ <groupId>org.onap.portal.sdk</groupId>
+ <artifactId>epsdk-app-common</artifactId>
+ <version>${epsdk.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.onap.portal.sdk</groupId>
+ <artifactId>epsdk-analytics</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.onap.portal.sdk</groupId>
+ <artifactId>epsdk-workflow</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.elasticsearch</groupId>
+ <artifactId>elasticsearch</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.quartz-scheduler</groupId>
+ <artifactId>quartz</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.searchbox</groupId>
+ <artifactId>jest</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java b/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
index e532b5f..ecd312a 100644
--- a/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
+++ b/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
@@ -1,163 +1,164 @@
-/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.onap.portalapp.conf;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.onap.portalapp.lm.FusionLicenseManagerImpl;
-import org.onap.portalapp.login.LoginStrategyImpl;
-import org.openecomp.portalapp.controller.core.SingleSignOnController;
-import org.openecomp.portalapp.controller.sample.ElasticSearchController;
-import org.openecomp.portalapp.controller.sample.PostDroolsController;
-import org.openecomp.portalapp.scheduler.LogRegistry;
-import org.openecomp.portalsdk.core.auth.LoginStrategy;
-import org.openecomp.portalsdk.core.conf.AppConfig;
-import org.openecomp.portalsdk.core.conf.Configurable;
-import org.openecomp.portalsdk.core.lm.FusionLicenseManager;
-import org.openecomp.portalsdk.core.lm.FusionLicenseManagerUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
-import org.openecomp.portalsdk.core.scheduler.CoreRegister;
-import org.openecomp.portalsdk.core.scheduler.CronRegistry;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.PostDroolsService;
-import org.openecomp.portalsdk.core.util.CacheManager;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.FilterType;
-import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.Profile;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.web.servlet.ViewResolver;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-
-/**
- * ECOMP Portal SDK sample application. ECOMP Portal SDK core AppConfig class to
- * reuse interceptors, view resolvers and other features defined there.
- */
-@Configuration
-@EnableWebMvc
-@ComponentScan(basePackages = { "org.onap", "org.openecomp" },
- // Exclude unused annotated classes with heavy dependencies.
- excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = { CoreRegister.class,
- CronRegistry.class, ElasticSearchController.class, LogRegistry.class, PostDroolsController.class,
- PostDroolsService.class, SingleSignOnController.class }))
-@Profile("src")
-@EnableAsync
-@EnableScheduling
-public class ExternalAppConfig extends AppConfig implements Configurable {
-
- private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppConfig.class);
-
- @Configuration
- @Import(SystemProperties.class)
- static class InnerConfiguration {
- }
-
- /*
- * (non-Javadoc)
- * @see org.openecomp.portalsdk.core.conf.AppConfig#viewResolver()
- */
- public ViewResolver viewResolver() {
- return super.viewResolver();
- }
-
- /*
- * (non-Javadoc)
- * @see org.openecomp.portalsdk.core.conf.AppConfig#addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry)
- */
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- super.addResourceHandlers(registry);
- }
-
- /*
- * (non-Javadoc)
- * @see org.openecomp.portalsdk.core.conf.AppConfig#dataAccessService()
- */
- @Override
- public DataAccessService dataAccessService() {
- // Echo the JDBC URL to assist developers when starting the app.
- systemProperties();
- System.out.println("ExternalAppConfig: " + SystemProperties.DB_CONNECTIONURL + " is "
- + SystemProperties.getProperty(SystemProperties.DB_CONNECTIONURL));
- return super.dataAccessService();
- }
-
- /**
- * Creates a new list with a single entry that is the external app
- * definitions.xml path.
- *
- * @return List of String, size 1
- */
- @Override
- public List<String> addTileDefinitions() {
- List<String> definitions = new ArrayList<String>();
- // DBC does not need the sample page:
- // definitions.add("/WEB-INF/defs/definitions.xml");
- definitions.add("/WEB-INF/oom-app-definitions.xml");
- if (logger.isDebugEnabled())
- logger.debug(EELFLoggerDelegate.debugLogger, "addTileDefinitions: list is " + definitions);
- return definitions;
- }
-
- /**
- * Adds request interceptors to the specified registry by calling
- * {@link AppConfig#addInterceptors(InterceptorRegistry)}, but excludes
- * certain paths from the session timeout interceptor.
- */
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
- super.setExcludeUrlPathsForSessionTimeout("/login_external", "*/login_external.htm", "login", "/login.htm",
- "/api*", "/single_signon.htm", "/single_signon");
- super.addInterceptors(registry);
- }
-
- /**
- * Creates and returns a new instance of a {@link CacheManager} class.
- *
- * @return New instance of {@link CacheManager}
- */
- @Bean
- public AbstractCacheManager cacheManager() {
- return new CacheManager();
- }
-
- @Bean
- public FusionLicenseManager fusionLicenseManager() {
- return new FusionLicenseManagerImpl();
- }
-
- @Bean
- public FusionLicenseManagerUtils fusionLicenseManagerUtils() {
- return new FusionLicenseManagerUtils();
- }
-
- @Bean
- public LoginStrategy loginStrategy() {
- return new LoginStrategyImpl();
- }
-}
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.onap.portalapp.conf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.onap.portalapp.lm.FusionLicenseManagerImpl;
+import org.onap.portalapp.login.LoginStrategyImpl;
+import org.onap.portalapp.controller.core.SingleSignOnController;
+import org.onap.portalapp.controller.sample.ElasticSearchController;
+import org.onap.portalapp.controller.sample.PostDroolsController;
+import org.onap.portalapp.scheduler.LogRegistry;
+import org.onap.portalsdk.core.auth.LoginStrategy;
+import org.onap.portalsdk.core.conf.AppConfig;
+import org.onap.portalsdk.core.conf.Configurable;
+//import org.onap.portalsdk.core.lm.FusionLicenseManager;
+//import org.onap.portalsdk.core.lm.FusionLicenseManagerUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.objectcache.AbstractCacheManager;
+import org.onap.portalsdk.core.scheduler.CoreRegister;
+import org.onap.portalsdk.core.scheduler.CronRegistry;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.PostDroolsService;
+import org.onap.portalsdk.core.util.CacheManager;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.Profile;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.servlet.ViewResolver;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+
+/**
+ * ECOMP Portal SDK sample application. ECOMP Portal SDK core AppConfig class to
+ * reuse interceptors, view resolvers and other features defined there.
+ */
+@Configuration
+@EnableWebMvc
+@ComponentScan(basePackages = { "org.onap", "org.openecomp" },
+ // Exclude unused annotated classes with heavy dependencies.
+ excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = { CoreRegister.class,
+ CronRegistry.class, ElasticSearchController.class, LogRegistry.class, PostDroolsController.class,
+ PostDroolsService.class, SingleSignOnController.class }))
+@Profile("src")
+@EnableAsync
+@EnableScheduling
+public class ExternalAppConfig extends AppConfig implements Configurable {
+
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppConfig.class);
+
+ @Configuration
+ @Import(SystemProperties.class)
+ static class InnerConfiguration {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.onap.portalsdk.core.conf.AppConfig#viewResolver()
+ */
+ public ViewResolver viewResolver() {
+ return super.viewResolver();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.onap.portalsdk.core.conf.AppConfig#addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry)
+ */
+ @Override
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
+ super.addResourceHandlers(registry);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.onap.portalsdk.core.conf.AppConfig#dataAccessService()
+ */
+ @Override
+ public DataAccessService dataAccessService() {
+ // Echo the JDBC URL to assist developers when starting the app.
+ systemProperties();
+ System.out.println("ExternalAppConfig: " + SystemProperties.DB_CONNECTIONURL + " is "
+ + SystemProperties.getProperty(SystemProperties.DB_CONNECTIONURL));
+ return super.dataAccessService();
+ }
+
+ /**
+ * Creates a new list with a single entry that is the external app
+ * definitions.xml path.
+ *
+ * @return List of String, size 1
+ */
+ @Override
+ public List<String> addTileDefinitions() {
+ List<String> definitions = new ArrayList<String>();
+ // DBC does not need the sample page:
+ // definitions.add("/WEB-INF/defs/definitions.xml");
+ definitions.add("/WEB-INF/oom-app-definitions.xml");
+ if (logger.isDebugEnabled())
+ logger.debug(EELFLoggerDelegate.debugLogger, "addTileDefinitions: list is " + definitions);
+ return definitions;
+ }
+
+ /**
+ * Adds request interceptors to the specified registry by calling
+ * {@link AppConfig#addInterceptors(InterceptorRegistry)}, but excludes
+ * certain paths from the session timeout interceptor.
+ */
+ @Override
+ public void addInterceptors(InterceptorRegistry registry) {
+ super.setExcludeUrlPathsForSessionTimeout("/login_external", "*/login_external.htm", "login", "/login.htm",
+ "/api*", "/single_signon.htm", "/single_signon");
+ super.addInterceptors(registry);
+ }
+
+ /**
+ * Creates and returns a new instance of a {@link CacheManager} class.
+ *
+ * @return New instance of {@link CacheManager}
+ */
+ @Bean
+ public AbstractCacheManager cacheManager() {
+ return new CacheManager();
+ }
+
+ /*
+ @Bean
+ public FusionLicenseManager fusionLicenseManager() {
+ return new FusionLicenseManagerImpl();
+ }
+
+ @Bean
+ public FusionLicenseManagerUtils fusionLicenseManagerUtils() {
+ return new FusionLicenseManagerUtils();
+ }
+ */
+ @Bean
+ public LoginStrategy loginStrategy() {
+ return new LoginStrategyImpl();
+ }
+}
diff --git a/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java b/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
index 347bb51..3edcf23 100644
--- a/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
+++ b/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
@@ -1,47 +1,47 @@
-/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.onap.portalapp.conf;
-
-import org.openecomp.portalsdk.core.conf.AppInitializer;
-
-public class ExternalAppInitializer extends AppInitializer {
-
- @Override
- protected Class<?>[] getRootConfigClasses() {
- return super.getRootConfigClasses();
- }
-
- @Override
- protected Class<?>[] getServletConfigClasses() {
- Class<?> appConfigClass = ExternalAppConfig.class;
- // Show something on stdout to indicate the app is starting.
- System.out.println("ExternalAppInitializer: servlet configuration class is " + appConfigClass.getName());
- return new Class[] { appConfigClass };
- }
-
- /*
- * URL request will direct to the Spring dispatcher for processing
- */
- @Override
- protected String[] getServletMappings() {
- return super.getServletMappings();
- }
-
-}
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.onap.portalapp.conf;
+
+import org.onap.portalsdk.core.conf.AppInitializer;
+
+public class ExternalAppInitializer extends AppInitializer {
+
+ @Override
+ protected Class<?>[] getRootConfigClasses() {
+ return super.getRootConfigClasses();
+ }
+
+ @Override
+ protected Class<?>[] getServletConfigClasses() {
+ Class<?> appConfigClass = ExternalAppConfig.class;
+ // Show something on stdout to indicate the app is starting.
+ System.out.println("ExternalAppInitializer: servlet configuration class is " + appConfigClass.getName());
+ return new Class[] { appConfigClass };
+ }
+
+ /*
+ * URL request will direct to the Spring dispatcher for processing
+ */
+ @Override
+ protected String[] getServletMappings() {
+ return super.getServletMappings();
+ }
+
+}
diff --git a/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java b/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java
index 6432478..a4a1fa6 100644
--- a/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java
+++ b/ccsdk-app-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java
@@ -1,62 +1,62 @@
-/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.onap.portalapp.conf;
-
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.stereotype.Component;
-
-import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable;
-
-@Component
-@Profile("src")
-public class HibernateMappingLocations implements HibernateMappingLocatable {
-
- /*
- * (non-Javadoc)
- *
- * @see org.openecomp.portalsdk.core.conf.HibernateMappingLocatable#
- * getMappingLocations()
- */
- @Override
- public Resource[] getMappingLocations() {
- return new Resource[] {
- // Path is relative to WEB-INF/conf;
- // a leading slash gets stripped so don't bother.
- // new ClassPathResource("../fusion/orm/Fusion.hbm.xml"),
- // This is a COPY to work around a bug in the 1.1.0 release.
- new ClassPathResource("../fusion-110-copy.hbm.xml"),
- new ClassPathResource("../oom-app.hbm.xml")
- };
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.openecomp.portalsdk.core.conf.HibernateMappingLocatable#
- * getPackagesToScan()
- */
- @Override
- public String[] getPackagesToScan() {
- return new String[] { "org.onap", "org.openecomp" };
- }
-
-}
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.onap.portalapp.conf;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.stereotype.Component;
+
+import org.onap.portalsdk.core.conf.HibernateMappingLocatable;
+
+@Component
+@Profile("src")
+public class HibernateMappingLocations implements HibernateMappingLocatable {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.onap.portalsdk.core.conf.HibernateMappingLocatable#
+ * getMappingLocations()
+ */
+ @Override
+ public Resource[] getMappingLocations() {
+ return new Resource[] {
+ // Path is relative to WEB-INF/conf;
+ // a leading slash gets stripped so don't bother.
+ // new ClassPathResource("../fusion/orm/Fusion.hbm.xml"),
+ // This is a COPY to work around a bug in the 1.1.0 release.
+ new ClassPathResource("../fusion-110-copy.hbm.xml"),
+ new ClassPathResource("../oom-app.hbm.xml")
+ };
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.onap.portalsdk.core.conf.HibernateMappingLocatable#
+ * getPackagesToScan()
+ */
+ @Override
+ public String[] getPackagesToScan() {
+ return new String[] { "org.onap", "org.openecomp" };
+ }
+
+}
diff --git a/ccsdk-app-os/src/main/java/org/onap/portalapp/lm/FusionLicenseManagerImpl.java b/ccsdk-app-os/src/main/java/org/onap/portalapp/lm/FusionLicenseManagerImpl.java
index e0da1c9..4eb00c6 100644
--- a/ccsdk-app-os/src/main/java/org/onap/portalapp/lm/FusionLicenseManagerImpl.java
+++ b/ccsdk-app-os/src/main/java/org/onap/portalapp/lm/FusionLicenseManagerImpl.java
@@ -1,98 +1,120 @@
-/*******************************************************************************
- * =============LICENSE_START=========================================================
- *
- * =================================================================================
- * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- *******************************************************************************/
-package org.onap.portalapp.lm;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-
-import org.openecomp.portalsdk.core.lm.FusionLicenseManager;
-
-public class FusionLicenseManagerImpl implements FusionLicenseManager {
-
- private Date expiredDate;
-
- public FusionLicenseManagerImpl() {
- }
-
- /**
- * An implementation of the KeyStoreParam interface that returns the
- * information required to work with the keystore containing the private key.
- */
- @Override
- public void initKeyStoreParam() {
- }
-
- @Override
- public void initCipherParam() {
- }
-
- /**
- * Create/populate the "licenseParm" field.
- */
- @Override
- public void initLicenseParam() {
- }
-
- @Override
- public void doInitWork() {
- }
-
- /**
- * Prompt the user for the location of their license file, get the filename,
- * then try to install the file.
- *
- * @return true if the license installed properly, false otherwise.
- */
- @Override
- public int installLicense() {
- return INVALID_LICENSE;
- }
-
- @Override
- public synchronized int verifyLicense(ServletContext context) {
-
- return INVALID_LICENSE;
- }
-
- @Override
- public void generateLicense(Map<String, String> clientInfoMap, List<String> ipAddressList) throws Exception {
- }
-
- @Override
- public String nvl(String s) {
- return (s == null) ? "" : s;
- }
-
- @Override
- public Date getExpiredDate() {
- return expiredDate;
- }
-
- @Override
- public void setExpiredDate(Date expiredDate) {
- this.expiredDate = expiredDate;
- }
-
-}
+/*******************************************************************************
+ * =============LICENSE_START=========================================================
+ *
+ * =================================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *******************************************************************************/
+package org.onap.portalapp.lm;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+//import org.onap.portalsdk.core.lm.FusionLicenseManager;
+interface FusionLicenseManager {
+ public void initKeyStoreParam();
+
+ public void initCipherParam();
+
+ public void initLicenseParam();
+
+ public int installLicense();
+
+ public int verifyLicense(ServletContext context);
+
+ public void setExpiredDate(Date expiredDate);
+
+ public void doInitWork();
+
+ public void generateLicense(Map<String, String> clientInfoMap, List<String> ipAddressList) throws Exception;
+
+ public String nvl(String s);
+
+ public Date getExpiredDate();
+}
+public class FusionLicenseManagerImpl implements FusionLicenseManager {
+
+ private Date expiredDate;
+
+ public FusionLicenseManagerImpl() {
+ }
+
+ /**
+ * An implementation of the KeyStoreParam interface that returns the
+ * information required to work with the keystore containing the private key.
+ */
+ @Override
+ public void initKeyStoreParam() {
+ }
+
+ @Override
+ public void initCipherParam() {
+ }
+
+ /**
+ * Create/populate the "licenseParm" field.
+ */
+ @Override
+ public void initLicenseParam() {
+ }
+
+ @Override
+ public void doInitWork() {
+ }
+
+ /**
+ * Prompt the user for the location of their license file, get the filename,
+ * then try to install the file.
+ *
+ * @return true if the license installed properly, false otherwise.
+ */
+ @Override
+ public int installLicense() {
+ //return INVALID_LICENSE;
+ return -1;
+ }
+
+ @Override
+ public synchronized int verifyLicense(ServletContext context) {
+
+ //return INVALID_LICENSE;
+ return -1;
+ }
+
+ @Override
+ public void generateLicense(Map<String, String> clientInfoMap, List<String> ipAddressList) throws Exception {
+ }
+
+ @Override
+ public String nvl(String s) {
+ return (s == null) ? "" : s;
+ }
+
+ @Override
+ public Date getExpiredDate() {
+ return expiredDate;
+ }
+
+ @Override
+ public void setExpiredDate(Date expiredDate) {
+ this.expiredDate = expiredDate;
+ }
+
+}
diff --git a/ccsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java b/ccsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java
index 22fca6d..88bce2d 100644
--- a/ccsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java
+++ b/ccsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java
@@ -1,91 +1,91 @@
-/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-
-package org.onap.portalapp.login;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalsdk.core.auth.LoginStrategy;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
-import org.springframework.web.servlet.ModelAndView;
-
-public class LoginStrategyImpl extends LoginStrategy {
-
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LoginStrategyImpl.class);
-
- @Override
- public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
- // 'login' for opensource is same as 'external' login.
- return doExternalLogin(request, response);
- }
-
- @Override
- public String getUserId(HttpServletRequest request) throws PortalAPIException {
- // Check ECOMP Portal cookie
- if (!isLoginCookieExist(request))
- return null;
-
- String userid = null;
- try {
- userid = getUserIdFromCookie(request);
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "getUserId failed", e);
- }
- return userid;
- }
-
- private static String getUserIdFromCookie(HttpServletRequest request) throws Exception {
- String userId = "";
- Cookie[] cookies = request.getCookies();
- Cookie userIdcookie = null;
- if (cookies != null)
- for (Cookie cookie : cookies)
- if (cookie.getName().equals(USER_ID))
- userIdcookie = cookie;
- if (userIdcookie != null) {
- userId = CipherUtil.decrypt(userIdcookie.getValue(),
- PortalApiProperties.getProperty(PortalApiConstants.Decryption_Key));
- }
- return userId;
-
- }
-
- private static boolean isLoginCookieExist(HttpServletRequest request) {
- Cookie ep = getCookie(request, EP_SERVICE);
- return (ep != null);
- }
-
- private static Cookie getCookie(HttpServletRequest request, String cookieName) {
- Cookie[] cookies = request.getCookies();
- if (cookies != null)
- for (Cookie cookie : cookies)
- if (cookie.getName().equals(cookieName))
- return cookie;
-
- return null;
- }
-
-}
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+
+package org.onap.portalapp.login;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalsdk.core.auth.LoginStrategy;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.springframework.web.servlet.ModelAndView;
+
+public class LoginStrategyImpl extends LoginStrategy {
+
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LoginStrategyImpl.class);
+
+ @Override
+ public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ // 'login' for opensource is same as 'external' login.
+ return doExternalLogin(request, response);
+ }
+
+ @Override
+ public String getUserId(HttpServletRequest request) throws PortalAPIException {
+ // Check ECOMP Portal cookie
+ if (!isLoginCookieExist(request))
+ return null;
+
+ String userid = null;
+ try {
+ userid = getUserIdFromCookie(request);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "getUserId failed", e);
+ }
+ return userid;
+ }
+
+ private static String getUserIdFromCookie(HttpServletRequest request) throws Exception {
+ String userId = "";
+ Cookie[] cookies = request.getCookies();
+ Cookie userIdcookie = null;
+ if (cookies != null)
+ for (Cookie cookie : cookies)
+ if (cookie.getName().equals(USER_ID))
+ userIdcookie = cookie;
+ if (userIdcookie != null) {
+ userId = ""; //CipherUtil.decrypt(userIdcookie.getValue(),
+ //PortalApiProperties.getProperty(PortalApiConstants.Decryption_Key));
+ }
+ return userId;
+
+ }
+
+ private static boolean isLoginCookieExist(HttpServletRequest request) {
+ Cookie ep = getCookie(request, EP_SERVICE);
+ return (ep != null);
+ }
+
+ private static Cookie getCookie(HttpServletRequest request, String cookieName) {
+ Cookie[] cookies = request.getCookies();
+ if (cookies != null)
+ for (Cookie cookie : cookies)
+ if (cookie.getName().equals(cookieName))
+ return cookie;
+
+ return null;
+ }
+
+}
diff --git a/ccsdk-app-os/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java b/ccsdk-app-os/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java
index 17fe4ee..fdda960 100644
--- a/ccsdk-app-os/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java
+++ b/ccsdk-app-os/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java
@@ -1,68 +1,68 @@
-/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.onap.portalapp.service;
-
-import java.util.Set;
-
-import org.openecomp.portalapp.service.IAdminAuthExtension;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.domain.User;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-
-@Service("adminAuthExtension")
-@Transactional
-/**
- * Provides empty implementations of the methods in IAdminAuthExtension.
- */
-public class AdminAuthExtension implements IAdminAuthExtension {
-
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminAuthExtension.class);
-
- /*
- * (non-Javadoc)
- * @see org.openecomp.portalapp.service.IAdminAuthExtension#saveUserExtension(org.openecomp.portalsdk.core.domain.User)
- */
- @Override
- public void saveUserExtension(User user) {
- logger.debug("saveUserExtension");
- }
-
- /*
- * (non-Javadoc)
- * @see org.openecomp.portalapp.service.IAdminAuthExtension#editUserExtension(org.openecomp.portalsdk.core.domain.User)
- */
- @Override
- public void editUserExtension(User user) {
- logger.debug("editUserExtension");
- }
-
- /*
- * (non-Javadoc)
- * @see org.openecomp.portalapp.service.IAdminAuthExtension#saveUserRoleExtension(java.util.Set, org.openecomp.portalsdk.core.domain.User)
- */
- @Override
- public void saveUserRoleExtension(Set<Role> roles, User user) {
- logger.debug("saveUserRoleExtension");
- }
-
-}
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.onap.portalapp.service;
+
+import java.util.Set;
+
+import org.onap.portalapp.service.IAdminAuthExtension;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.domain.User;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Service("adminAuthExtension")
+@Transactional
+/**
+ * Provides empty implementations of the methods in IAdminAuthExtension.
+ */
+public class AdminAuthExtension implements IAdminAuthExtension {
+
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminAuthExtension.class);
+
+ /*
+ * (non-Javadoc)
+ * @see org.onap.portalapp.service.IAdminAuthExtension#saveUserExtension(org.onap.portalsdk.core.domain.User)
+ */
+ @Override
+ public void saveUserExtension(User user) {
+ logger.debug("saveUserExtension");
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.onap.portalapp.service.IAdminAuthExtension#editUserExtension(org.onap.portalsdk.core.domain.User)
+ */
+ @Override
+ public void editUserExtension(User user) {
+ logger.debug("editUserExtension");
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.onap.portalapp.service.IAdminAuthExtension#saveUserRoleExtension(java.util.Set, org.onap.portalsdk.core.domain.User)
+ */
+ @Override
+ public void saveUserRoleExtension(Set<Role> roles, User user) {
+ logger.debug("saveUserRoleExtension");
+ }
+
+}
diff --git a/ccsdk-app-os/src/main/resources/portal.properties b/ccsdk-app-os/src/main/resources/portal.properties
index c9bde0a..88ef37c 100644
--- a/ccsdk-app-os/src/main/resources/portal.properties
+++ b/ccsdk-app-os/src/main/resources/portal.properties
@@ -1,45 +1,44 @@
-###############################################################################
-# =============LICENSE_START=========================================================
-#
-# =================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-###############################################################################
-# OS portal.properties
-
-# Properties read by ECOMP Framework library, ecompFW.jar
-
-portal.api.impl.class = org.openecomp.portalapp.service.OnBoardingApiServiceImpl
-portal.api.prefix = /api
-max.idle.time = 5
-user.attribute.name = user_attribute
-
-# URL of the ECOMP Portal REST API
-ecomp_rest_url = http://portal.api.simpledemo.openecomp.org/ecompportal/auxapi
-
-#Use REST API instead of UEB to fetch the functional menu data
-use_rest_for_functional_menu=true
-
-# Don't fetch functional menu via UEB in 1610.
-ueb_listeners_enable = false
-
-# Application key is used by session management
-ueb_app_key = cwMmLOCKSHPJUeVC
-
-# The inbox name property should not be required when the REST API is used,
-# but in 1610 FuncMenuController logs ALARM if it cannot find this key.
-ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST
+###############################################################################
+# =============LICENSE_START=========================================================
+#
+# =================================================================================
+# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+###############################################################################
+# OS portal.properties
+
+# Properties read by ECOMP Framework library, ecompFW.jar
+portal.api.impl.class=org.onap.portalapp.service.OnBoardingApiServiceImpl
+portal.api.prefix = /api
+max.idle.time = 5
+user.attribute.name = user_attribute
+
+# URL of the ECOMP Portal REST API
+ecomp_rest_url = http://portal.api.simpledemo.openecomp.org/ecompportal/auxapi
+
+#Use REST API instead of UEB to fetch the functional menu data
+use_rest_for_functional_menu=true
+
+# Don't fetch functional menu via UEB in 1610.
+ueb_listeners_enable = false
+
+# Application key is used by session management
+ueb_app_key = cwMmLOCKSHPJUeVC
+
+# The inbox name property should not be required when the REST API is used,
+# but in 1610 FuncMenuController logs ALARM if it cannot find this key.
+ecomp_portal_inbox_name = ECOMP-PORTAL-INBOX-TEST
diff --git a/ccsdk-app-os/src/main/webapp/WEB-INF/jsp/login_external.jsp b/ccsdk-app-os/src/main/webapp/WEB-INF/jsp/login_external.jsp
index 935c6aa..a31937c 100644
--- a/ccsdk-app-os/src/main/webapp/WEB-INF/jsp/login_external.jsp
+++ b/ccsdk-app-os/src/main/webapp/WEB-INF/jsp/login_external.jsp
@@ -1,113 +1,113 @@
-<%--
- ================================================================================
- ECOMP Portal SDK
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ================================================================================
---%>
-<%@ page import="org.openecomp.portalsdk.core.util.SystemProperties"%>
-<!DOCTYPE html>
-<%
- // Name is defined by app; do not throw if missing
- final String appDisplayName = SystemProperties.containsProperty(SystemProperties.APP_DISPLAY_NAME)
- ? SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)
- : SystemProperties.APP_DISPLAY_NAME;
-%>
-
-<html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Login</title>
- <style>
- html {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- }
- body {
- padding-top: 15px;
- }
- .logo {
- position: fixed;
- left: 15px;
- top: 15px;
- z-index: -1;
- }
- .loginError {
- font-size: 18px;
- color: red;
- text-align: center;
- }
- .login {
- font-size: 16px;
- display: block;
- margin-left: auto;
- margin-right: auto;
- text-align: center;
- width: 100%;
- }
- .login input[type=submit] {
- font-size: 16px;
- }
- .terms {
- font-size: 10px;
- text-align: center;
- margin-left: auto;
- margin-right: auto;
- }
- .terms a {
- font-size: 10px;
- text-align: center;
- margin-left: auto;
- margin-right: auto;
- }
- </style>
- </head>
- <body>
- <div class="login">
- <img src="app/oom/images/onap_logo_2257x496.png" style="height: 150px;" />
- <h2>
- <%=appDisplayName%>
- </h2>
- <br />
- <form action="login_external" method="POST">
- <label for="loginId">Login ID:</label>
- <input id="loginId" name="loginId" type="text" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;" maxlength="30">
- <br/>
- <br/>
- <label for="password">Password:</label>
- <input id="password" name="password" type="password" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;"
- maxlength="30" >
- <br />
- <br />
- <input id="loginBtn" type="submit" alt="Login" value="Login">
- </form>
- </div>
- <br />
- <br />
- <div class="loginError">${model.error}</div>
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <div id="footer">
- <div class="terms">
- Copyright 2017 Open ECOMP and Linux Foundation.
- </div>
- </div>
- </body>
-</html>
+<%--
+ ================================================================================
+ ECOMP Portal SDK
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ================================================================================
+--%>
+<%@ page import="org.onap.portalsdk.core.util.SystemProperties"%>
+<!DOCTYPE html>
+<%
+ // Name is defined by app; do not throw if missing
+ final String appDisplayName = SystemProperties.containsProperty(SystemProperties.APP_DISPLAY_NAME)
+ ? SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)
+ : SystemProperties.APP_DISPLAY_NAME;
+%>
+
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Login</title>
+ <style>
+ html {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ }
+ body {
+ padding-top: 15px;
+ }
+ .logo {
+ position: fixed;
+ left: 15px;
+ top: 15px;
+ z-index: -1;
+ }
+ .loginError {
+ font-size: 18px;
+ color: red;
+ text-align: center;
+ }
+ .login {
+ font-size: 16px;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+ width: 100%;
+ }
+ .login input[type=submit] {
+ font-size: 16px;
+ }
+ .terms {
+ font-size: 10px;
+ text-align: center;
+ margin-left: auto;
+ margin-right: auto;
+ }
+ .terms a {
+ font-size: 10px;
+ text-align: center;
+ margin-left: auto;
+ margin-right: auto;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="login">
+ <img src="app/oom/images/onap_logo_2257x496.png" style="height: 150px;" />
+ <h2>
+ <%=appDisplayName%>
+ </h2>
+ <br />
+ <form action="login_external" method="POST">
+ <label for="loginId">Login ID:</label>
+ <input id="loginId" name="loginId" type="text" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;" maxlength="30">
+ <br/>
+ <br/>
+ <label for="password">Password:</label>
+ <input id="password" name="password" type="password" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;"
+ maxlength="30" >
+ <br />
+ <br />
+ <input id="loginBtn" type="submit" alt="Login" value="Login">
+ </form>
+ </div>
+ <br />
+ <br />
+ <div class="loginError">${model.error}</div>
+ <br />
+ <br />
+ <br />
+ <br />
+ <br />
+ <br />
+ <div id="footer">
+ <div class="terms">
+ Copyright 2017 Open ECOMP and Linux Foundation.
+ </div>
+ </div>
+ </body>
+</html>