From 9ccf6082a81e990c30a575cb16ee57a8d1d050bd Mon Sep 17 00:00:00 2001 From: Lucas Li Date: Wed, 2 Oct 2024 13:02:47 -0700 Subject: [PATCH 1/2] update the pom file and adding webapp folder --- client/wfprev-war/pom.xml | 427 ++++++++++++------ .../src/main/webapp/WEB-INF/urlrewrite.xml | 9 + client/wfprev-war/src/main/webapp/config.jsp | 39 ++ client/wfprev-war/src/main/webapp/index.html | 12 + 4 files changed, 337 insertions(+), 150 deletions(-) create mode 100644 client/wfprev-war/src/main/webapp/WEB-INF/urlrewrite.xml create mode 100644 client/wfprev-war/src/main/webapp/config.jsp create mode 100644 client/wfprev-war/src/main/webapp/index.html diff --git a/client/wfprev-war/pom.xml b/client/wfprev-war/pom.xml index 60933e4c8..7d580d999 100644 --- a/client/wfprev-war/pom.xml +++ b/client/wfprev-war/pom.xml @@ -1,69 +1,250 @@ - + 4.0.0 ca.bc.gov.nrs.wfprev wfprev-parent - 1.0.0-SNAPSHOT + 1.3.0 wfprev-war war wfprev-war http://maven.apache.org - ${env.BUILD_NUMBER} + #{BUILD_NUMBER}# UTF-8 $ - v18.10.0 - 8.19.4 + v18.10.0 + 8.19.4 ${user.home}/.node src/main/angular https://bwa.nrs.gov.bc.ca/int/artifactory/api/npm/nrs-virtual-npm/ - true + + + ci + + false + + + + + com.github.eirslett + frontend-maven-plugin + 1.11.3 + + ${node.version} + ${npm.version} + ${typescript.path} + ${node.path} + + + + install node and npm for ci + initialize + + install-node-and-npm + + + + npm install for ci + initialize + + npm + + + install -no-package-lock --registry=${npm.url} + + + + npm run-script test-and-coverage + test + + npm + + + run-script test-and-coverage + + + + + + + + + package + + true + + + + + maven-war-plugin + 3.3.1 + + false + WEB-INF/web.xml + + + ${basedir}/target/angular + + assets/**/*.* + *.* + + + + src/main/webapp + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + ${java-target-version} + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.1 + + ${java-source-version} + ${java-target-version} + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.5.5 + + + create-distribution + prepare-package + + single + + + src/cd/assemblies + + + + + + com.github.eirslett + frontend-maven-plugin + 1.11.3 + + ${node.version} + ${npm.version} + ${typescript.path} + ${node.path} + + + + install node and npm + initialize + + install-node-and-npm + + + + npm install + initialize + + npm + + + install -no-package-lock --puppeteer_skip_chromium_download=true --registry=${npm.url} + + + + npm run-script mavenbuild + compile + + npm + + + run-script mavenbuild + + + + + + + + + - - ca.bc.gov.nrs.wfone.common - wfone-common-webade-oauth2 - - - ca.bc.gov.nrs.wfone.common - wfone-common-webade-oauth2-test + javax.ws.rs + javax.ws.rs-api - - org.springframework - spring-core + org.glassfish.jersey.core + jersey-common + + - org.springframework - spring-beans + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.2 + - org.springframework - spring-aop + org.glassfish.jaxb + jaxb-runtime + 2.3.2 + + - org.springframework - spring-context + ca.bc.gov.nrs.wfone.common + wfone-common-webade-oauth2 - org.springframework - spring-web + ca.bc.gov.nrs.wfone.common + wfone-common-webade-oauth2-test + + org.springframework spring-webmvc - + - javax.servlet - javax.servlet-api - provided + org.springframework + spring-jdbc @@ -71,24 +252,32 @@ org.springframework.security spring-security-core + org.springframework.security spring-security-web + + + org.springframework + spring-web + + + org.springframework.security spring-security-config - - org.springframework.security.oauth - spring-security-oauth2 + org.tuckey + urlrewritefilter - org.tuckey - urlrewritefilter + javax.servlet + javax.servlet-api + provided @@ -101,21 +290,66 @@ jcl-over-slf4j - org.apache.logging.log4j - log4j-slf4j-impl + org.slf4j + slf4j-log4j12 - org.apache.logging.log4j - log4j-api + log4j + log4j - org.apache.logging.log4j - log4j-core + log4j + apache-log4j-extras - + + + com.oracle.weblogic + ojdbc7 + test + + + + + org.eclipse.jetty + jetty-server + test + + + org.eclipse.jetty + jetty-annotations + test + + + org.eclipse.jetty + jetty-webapp + test + + + org.eclipse.jetty + jetty-jndi + test + + + org.eclipse.jetty + jetty-plus + test + + + org.eclipse.jetty + jetty-jsp + test + + + + junit + junit + test + + + - + src/main/resources @@ -123,114 +357,7 @@ - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java-source-version} - ${java-target-version} - - - - - com.github.eirslett - frontend-maven-plugin - - ${node.version} - ${npm.version} - ${typescript.path} - ${node.path} - - - - install node and npm - initialize - - install-node-and-npm - - - - npm install - initialize - - npm - - - install --legacy-peer-deps --no-package-lock --registry=${npm.url} - - - - npm run-script mavenbuild - compile - - npm - - - run-script mavenbuild - - - - + diff --git a/client/wfprev-war/src/main/webapp/WEB-INF/urlrewrite.xml b/client/wfprev-war/src/main/webapp/WEB-INF/urlrewrite.xml new file mode 100644 index 000000000..d0e5ee200 --- /dev/null +++ b/client/wfprev-war/src/main/webapp/WEB-INF/urlrewrite.xml @@ -0,0 +1,9 @@ + + + + + (\.html|\.js|\.png|\.gif|\.jpg|\.css|\.svg|\.ico|\.pdf) + ^/(.*)$ + /index.html + + \ No newline at end of file diff --git a/client/wfprev-war/src/main/webapp/config.jsp b/client/wfprev-war/src/main/webapp/config.jsp new file mode 100644 index 000000000..8ec4fa3f7 --- /dev/null +++ b/client/wfprev-war/src/main/webapp/config.jsp @@ -0,0 +1,39 @@ +<%@ page import="org.springframework.context.ApplicationContext" %> +<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %> +<%@ page import="java.util.Properties" %> + +<% + ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(application); + Properties properties = (Properties) context.getBean("applicationProperties"); + + if (properties != null) { + String baseUrl = properties.getProperty("base.url", ""); + + String json = "{"; + + // General Application Section + json = json.concat("\"application\":{"); + json = json.concat("\"acronym\":\"").concat(properties.getProperty("project.acronym", "")).concat("\"").concat(","); + json = json.concat("\"version\":\"").concat(properties.getProperty("application.version", "")).concat("\"").concat(","); + json = json.concat("\"buildNumber\":\"").concat(properties.getProperty("build.number", "")).concat("\"").concat(","); + json = json.concat("\"environment\":\"").concat(properties.getProperty("default.application.environment", "")).concat("\"").concat(","); + json = json.concat("\"baseUrl\":\"").concat(baseUrl).concat("\""); + json = json.concat("},"); + + // REST API Section (assuming you still want to keep the REST API properties) + json = json.concat("\"rest\":{"); + json = json.concat("},"); + + // WebADE OAuth Section (if still needed) + json = json.concat("\"webade\":{"); + json = json.concat("\"oauth2Url\":\"").concat(properties.getProperty("webade-oauth2.authorize.url", "")).concat("\"").concat(","); + json = json.concat("\"clientId\":\"").concat("WFPREV_UI").concat("\""); + json = json.concat("}"); + + json = json.concat("}"); + + out.write(json); + } else { + out.write("{}"); + } +%> diff --git a/client/wfprev-war/src/main/webapp/index.html b/client/wfprev-war/src/main/webapp/index.html new file mode 100644 index 000000000..672c1a9df --- /dev/null +++ b/client/wfprev-war/src/main/webapp/index.html @@ -0,0 +1,12 @@ + + + + +Wildfire Resources + + + + This is the index. + + + \ No newline at end of file From e8d83e80c562d2f11c1ebb7eb661816234cf5dc1 Mon Sep 17 00:00:00 2001 From: Lucas Li Date: Wed, 2 Oct 2024 13:04:54 -0700 Subject: [PATCH 2/2] update the pom file and adding webapp folder --- client/wfprev-war/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/wfprev-war/pom.xml b/client/wfprev-war/pom.xml index 7d580d999..e907d54ef 100644 --- a/client/wfprev-war/pom.xml +++ b/client/wfprev-war/pom.xml @@ -5,7 +5,7 @@ ca.bc.gov.nrs.wfprev wfprev-parent - 1.3.0 + 1.0.0-SNAPSHOT wfprev-war war