summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms/widget-ms/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-widget-ms/widget-ms/src/main')
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/resources/application-properties28
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties22
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/resources/templates/Upload.html35
3 files changed, 39 insertions, 46 deletions
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/resources/application-properties b/ecomp-portal-widget-ms/widget-ms/src/main/resources/application-properties
deleted file mode 100644
index 8f8207c2..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/resources/application-properties
+++ /dev/null
@@ -1,28 +0,0 @@
-## General App Properties
-server.contextPath=/widget
-server.port=8082
-spring.http.multipart.max-file-size=128MB
-spring.http.multipart.max-request-size=128MB
-microservice.widget.location=/tmp
-
-## App DB Properties
-spring.datasource.url=jdbc:mariadb://localhost:3306/ecomp_portal_1702&connectTimeout=2000
-spring.datasource.username=widget-user
-spring.datasource.password=widget-pass
-spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
-spring.database.driver.classname=org.mariadb.jdbc.Driver
-spring.jpa.show-sql=false
-spring.jpa.properties.hibernate.format_sql=false
-
-## Basic Authentication Properties
-security.user.name=widget_user
-security.user.password=ENC(IjywcRnI9+nuVEh9+OFFiRWAjBT1n718)
-
-## Certificate Properties
-#server.ssl.key-store=classpath:widget-keystore.p12
-#server.ssl.key-store-password=ENC(DiIYnAMab4u7rEW2yKhF9zBL00uU55q8)
-#server.ssl.keyStoreType=PKCS12
-#server.ssl.keyAlias=widget-microservice
-
-## Jasypt Properties
-jasypt.encryptor.password=EncryptionKey
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties b/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties
index 5116f966..8f8207c2 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties
@@ -3,16 +3,12 @@ server.contextPath=/widget
server.port=8082
spring.http.multipart.max-file-size=128MB
spring.http.multipart.max-request-size=128MB
+microservice.widget.location=/tmp
## App DB Properties
-#
-#db.connectionURL = jdbc:mariadb:failover://mtanjv9pord01.aic.cip.att.com:3306/portal
-#db.userName = m02549
-#db.password = 9zDXMxxzUG1ay5Dny1Eazw==
-#db.encrypt_flag = true
-spring.datasource.url=jdbc:mariadb://vm-ep-dev8.client.research.att.com:3306/portal_2_1_att
-spring.datasource.username=portal_user
-spring.datasource.password=P0rt@l_user
+spring.datasource.url=jdbc:mariadb://localhost:3306/ecomp_portal_1702&connectTimeout=2000
+spring.datasource.username=widget-user
+spring.datasource.password=widget-pass
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.database.driver.classname=org.mariadb.jdbc.Driver
spring.jpa.show-sql=false
@@ -20,15 +16,7 @@ spring.jpa.properties.hibernate.format_sql=false
## Basic Authentication Properties
security.user.name=widget_user
-security.user.password=widget_pass
-
-## Initalization setting
-initialization.default.widgets=true
-initialization.widgetData.url=http://www.ecomp.att.com:8080/ecompportal-att/commonWidgets
-
-## Account Basic Authentication Properties
-account.user.name=portal
-account.user.password=6APqvG4AU2rfLgCvMdySwQ==
+security.user.password=ENC(IjywcRnI9+nuVEh9+OFFiRWAjBT1n718)
## Certificate Properties
#server.ssl.key-store=classpath:widget-keystore.p12
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/resources/templates/Upload.html b/ecomp-portal-widget-ms/widget-ms/src/main/resources/templates/Upload.html
index a5e7c632..01e0564b 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/resources/templates/Upload.html
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/resources/templates/Upload.html
@@ -1,12 +1,45 @@
<html>
+<script>
+var validFileExtensions = [".zip"];
+function validateInput(form) {
+ var arrInputs = form.getElementsByTagName("input");
+ for (var i = 0; i < arrInputs.length; i++) {
+ var oInput = arrInputs[i];
+ if (oInput.type == "file") {
+ var fileName = oInput.value;
+ if (fileName.length > 0) {
+ var valid = false;
+ for (var j = 0; j < validFileExtensions.length; j++) {
+ var inputExtension = validFileExtensions[j];
+ if (fileName.substr(fileName.length - inputExtension.length, inputExtension.length).toLowerCase() == inputExtension.toLowerCase()) {
+ valid = true;
+ break;
+ }
+ }
+ if (!valid) {
+ document.getElementById("error").style.display="";
+ setTimeout(function(){ document.getElementById("error").style.display="none";}, 3000);
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+</script>
<body>
<div align="center">
- <form method="post" action="doUpload/widget-resources" enctype="multipart/form-data">
+ <form method="post" action="doUpload/widget-resources" onSubmit="return validateInput(this);" enctype="multipart/form-data">
<table border="0">
<tr>
<td>Pick file:</td>
<td><input type="file" name="fileUpload" size="50" /></td>
</tr>
+ <tr colspan="2">
+ <td><span style="display:none;color:red" id="error">File must be zip.</span></td>
+
+ </tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Upload" /></td>
</tr>