-
-
-
-
-
-
-
- | Configuration Id |
- Configuration Name |
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Welcome To The Configuration App
+
+
Current Configurations (All)
+
+
+
+
+
+ | Config ID |
+ Config Name |
+ Config Date |
+
+
+
+
+
To Add a Configuration
+
+
+
+
To Delete a Configuration for a Selected Month
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/configurationapp/src/main/resources/static/js/jquery.spring-friendly.js b/configurationapp/src/main/resources/static/js/jquery.spring-friendly.js
new file mode 100755
index 0000000..c786bdd
--- /dev/null
+++ b/configurationapp/src/main/resources/static/js/jquery.spring-friendly.js
@@ -0,0 +1,73 @@
+// From https://github.com/jquery/jquery/blob/master/src/serialize.js
+// Overrides data serialization to allow Spring MVC to correctly map input parameters : column[0][data] now becomes column[0].data
+(function($) {
+ var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+ function customBuildParams(prefix, obj, traditional, add) {
+ var name;
+
+ if (jQuery.isArray(obj)) {
+ // Serialize array item.
+ jQuery.each(obj, function(i, v) {
+ if (traditional || rbracket.test(prefix)) {
+ // Treat each array item as a scalar.
+ add(prefix, v);
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric
+ // index.
+ customBuildParams(prefix + "["
+ + (typeof v === "object" ? i : "") + "]", v,
+ traditional, add);
+ }
+ });
+
+ } else if (!traditional && jQuery.type(obj) === "object") {
+ // Serialize object item.
+ for (name in obj) {
+ // This is where the magic happens
+ customBuildParams(prefix + "." + name, obj[name], traditional,
+ add);
+ }
+
+ } else {
+ // Serialize scalar item.
+ add(prefix, obj);
+ }
+ }
+
+ $.param = function(a, traditional) {
+ var prefix, s = [], add = function(key, value) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : (value == null ? ""
+ : value);
+ s[s.length] = encodeURIComponent(key) + "="
+ + encodeURIComponent(value);
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if (traditional === undefined) {
+ traditional = jQuery.ajaxSettings
+ && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form
+ // elements.
+ if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
+ // Serialize the form elements
+ jQuery.each(a, function() {
+ add(this.name, this.value);
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for (prefix in a) {
+ customBuildParams(prefix, a[prefix], traditional, add);
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join("&").replace(r20, "+");
+ };
+})(jQuery);
\ No newline at end of file
diff --git a/configurationapp/src/test/com/att/BootstrapTest.java b/configurationapp/src/test/com/att/BootstrapTest.java
new file mode 100644
index 0000000..77e2305
--- /dev/null
+++ b/configurationapp/src/test/com/att/BootstrapTest.java
@@ -0,0 +1,48 @@
+package com.att;
+
+/**
+ *
java.com.att.BootstrapTest
+ * Description :
+ *
+ * @author gcanter
+ * on 2019-06-24
+ */
+
+
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
+import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+
+import org.springframework.http.HttpStatus;
+
+import io.restassured.RestAssured;
+import io.restassured.response.Response;
+
+public class BootstrapTest {
+
+ private static final String API_ROOT = "http://localhost:9000";
+
+
+ // test to see if connection to http://localhost:9000 is working and returns all data
+ @Test
+ public void whenGetAllConfigs_thenOK() {
+ final Response response = RestAssured.get(API_ROOT);
+ assertEquals(HttpStatus.OK.value(), response.getStatusCode());
+ }
+
+ // Test to see if app returns just 1 single record
+
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/configurationapp/src/test/com/att/SpringContextIntegrationTest.java b/configurationapp/src/test/com/att/SpringContextIntegrationTest.java
new file mode 100644
index 0000000..2495f44
--- /dev/null
+++ b/configurationapp/src/test/com/att/SpringContextIntegrationTest.java
@@ -0,0 +1,24 @@
+package com.att;
+
+/**
+ *
java.com.att.SpringContextIntegrationTest
+ * Description : Tests the Spring Context Integration to see if it loads. I always include it in
+ * all of my Spring Boot projects as the first test *
+ * @author gcanter
+ * on 2019-06-24
+ */
+
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class SpringContextIntegrationTest {
+
+ @Test
+ public void contextLoads() {
+ }
+}
diff --git a/configurationapp/target/classes/application.properties b/configurationapp/target/classes/application.properties
new file mode 100644
index 0000000..e17ca3f
--- /dev/null
+++ b/configurationapp/target/classes/application.properties
@@ -0,0 +1,17 @@
+server.port=9000
+spring.mvc.favicon.enabled=false
+
+logging.level.root=WARN
+logging.level.org.springframework.web=DEBUG
+logging.level.org.hibernate=ERROR
+
+spring.h2.console.enabled=true
+
+spring.datasource.url=jdbc:h2:mem:testdb
+
+#spring.datasource.url=jdbc:h2:file:/data/demo
+
+spring.datasource.driverClassName=org.h2.Driver
+spring.datasource.username=sa
+spring.datasource.password=
+spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
\ No newline at end of file
diff --git a/configurationapp/target/classes/data.sql b/configurationapp/target/classes/data.sql
new file mode 100644
index 0000000..9ce4cf4
--- /dev/null
+++ b/configurationapp/target/classes/data.sql
@@ -0,0 +1,4 @@
+INSERT INTO CONFIGVALUES (config_Name, config_Date) VALUES ('A', '022019');
+INSERT INTO CONFIGVALUES (config_Name, config_Date) VALUES ('B', '022019');
+INSERT INTO CONFIGVALUES (config_Name, config_Date) VALUES ('C', '032019');
+INSERT INTO CONFIGVALUES (config_Name, config_Date) VALUES ('D', '042019');
\ No newline at end of file
diff --git a/configurationapp/target/classes/static/index.html b/configurationapp/target/classes/static/index.html
new file mode 100755
index 0000000..ee79762
--- /dev/null
+++ b/configurationapp/target/classes/static/index.html
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
DataTables
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Welcome To The Configuration App
+
+
Current Configurations (All)
+
+
+
+
+
+ | Config ID |
+ Config Name |
+ Config Date |
+
+
+
+
+
+
To Add a Configuration
+
+
+
+
To Delete a Configuration for a Selected Month
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/configurationapp/target/classes/static/js/app.js b/configurationapp/target/classes/static/js/app.js
new file mode 100644
index 0000000..9ba6a11
--- /dev/null
+++ b/configurationapp/target/classes/static/js/app.js
@@ -0,0 +1,27 @@
+(function() {
+ function App() {
+
+ }
+
+ App.prototype.getData = function() {
+ $.ajax('',{
+
+ }).then(function(data) {
+
+ })
+ };
+
+ App.prototype.init = function() {
+ $('#configTable').DataTable({
+ scrollY: 300,
+ paging: true,
+ sorting: true,
+ ordering: true,
+ select: true,
+ searching: false,
+ info: false
+ });
+ };
+
+ window.app = new App;
+})($);
diff --git a/configurationapp/target/classes/static/js/jquery.spring-friendly.js b/configurationapp/target/classes/static/js/jquery.spring-friendly.js
new file mode 100755
index 0000000..c786bdd
--- /dev/null
+++ b/configurationapp/target/classes/static/js/jquery.spring-friendly.js
@@ -0,0 +1,73 @@
+// From https://github.com/jquery/jquery/blob/master/src/serialize.js
+// Overrides data serialization to allow Spring MVC to correctly map input parameters : column[0][data] now becomes column[0].data
+(function($) {
+ var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+ function customBuildParams(prefix, obj, traditional, add) {
+ var name;
+
+ if (jQuery.isArray(obj)) {
+ // Serialize array item.
+ jQuery.each(obj, function(i, v) {
+ if (traditional || rbracket.test(prefix)) {
+ // Treat each array item as a scalar.
+ add(prefix, v);
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric
+ // index.
+ customBuildParams(prefix + "["
+ + (typeof v === "object" ? i : "") + "]", v,
+ traditional, add);
+ }
+ });
+
+ } else if (!traditional && jQuery.type(obj) === "object") {
+ // Serialize object item.
+ for (name in obj) {
+ // This is where the magic happens
+ customBuildParams(prefix + "." + name, obj[name], traditional,
+ add);
+ }
+
+ } else {
+ // Serialize scalar item.
+ add(prefix, obj);
+ }
+ }
+
+ $.param = function(a, traditional) {
+ var prefix, s = [], add = function(key, value) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : (value == null ? ""
+ : value);
+ s[s.length] = encodeURIComponent(key) + "="
+ + encodeURIComponent(value);
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if (traditional === undefined) {
+ traditional = jQuery.ajaxSettings
+ && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form
+ // elements.
+ if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
+ // Serialize the form elements
+ jQuery.each(a, function() {
+ add(this.name, this.value);
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for (prefix in a) {
+ customBuildParams(prefix, a[prefix], traditional, add);
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join("&").replace(r20, "+");
+ };
+})(jQuery);
\ No newline at end of file
diff --git a/configurationapp/target/configurationapp.jar.original b/configurationapp/target/configurationapp.jar.original
new file mode 100644
index 0000000000000000000000000000000000000000..a2dfe08362959357d443a41e9e2d5ac216966f96
GIT binary patch
literal 8128
zcmb7J2{@GP*B@gaM2uYtr9rkK5t4l!`x0dtV~^}aO4hQZ>_kLkPqxS|ge)mrWZxp$
zw-&_znY=Q*)%U&kT+cPnb6w|m&b^#-?sNZcb!A*U2#AP?2$XBrs~Wt?@Z~iK1d_l3
zfuO)YLRMRnTTxYx7a^&tC?~6>&4ZA$yDxba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ndZX^4%5Z^3Q)lD{vZ3l$m7FkY=REMw(d2wk14Rz@AkP74x7O~l4013y@vK_0OD)U%>SFqIIJGK^2eO(_8Qs;
z0qbFZO&WPn@i-xr+N
zI(}F3?d$jk=r|Oxz`XptutQ;c3RVG#t^9Yp{JwHiAin>L^8GzuT^S$nco2vY_yqvo
Jdx{S8^*=UA^1A>4
literal 0
HcmV?d00001
diff --git a/configurationapp/target/maven-archiver/pom.properties b/configurationapp/target/maven-archiver/pom.properties
new file mode 100644
index 0000000..02b9c6b
--- /dev/null
+++ b/configurationapp/target/maven-archiver/pom.properties
@@ -0,0 +1,4 @@
+#Created by Apache Maven 3.6.0
+groupId=com.att
+artifactId=configurationapp
+version=0.0.1-SNAPSHOT
diff --git a/configurationapp/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/configurationapp/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
new file mode 100644
index 0000000..4e0519f
--- /dev/null
+++ b/configurationapp/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -0,0 +1,5 @@
+com/att/dao/configurations/ConfigurationDao.class
+com/att/ConfigurationApp.class
+com/att/web/configuarations/ConfigurationController.class
+com/att/dao/configurations/ConfigurationDao$IdProvider.class
+com/att/data/configurations/ConfigValue.class
diff --git a/configurationapp/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/configurationapp/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644
index 0000000..6aa7b0a
--- /dev/null
+++ b/configurationapp/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -0,0 +1,4 @@
+/Users/gcanter/dev/springboot/configurationapp/src/main/java/com/att/dao/configurations/ConfigurationDao.java
+/Users/gcanter/dev/springboot/configurationapp/src/main/java/com/att/ConfigurationApp.java
+/Users/gcanter/dev/springboot/configurationapp/src/main/java/com/att/data/configurations/ConfigValue.java
+/Users/gcanter/dev/springboot/configurationapp/src/main/java/com/att/web/configuarations/ConfigurationController.java
From 03f09857b1898f729659f747498fc077536ce076 Mon Sep 17 00:00:00 2001
From: gregcanter <5223851+gregcanter@users.noreply.github.com>
Date: Tue, 25 Jun 2019 10:19:07 -0400
Subject: [PATCH 4/5] Can now add a configuration and have it immediately
shown.
---
.../controllers/ConfigvaluesController.java | 28 ++++++++++++++++++-
.../src/main/resources/static/index.html | 27 ++++++++----------
2 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java b/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java
index 3a3f3b8..139b748 100644
--- a/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java
+++ b/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java
@@ -28,7 +28,8 @@ public DataTablesOutput list (@Valid DataTablesInput input) {
return configvaluesRepository.findAll(input);
}
- @Transactional
+ // DELETION OF CONFIGS BY CONFIG DATE VALUE
+ @Transactional // REQUIRED by Spring or will get Entity errors
@RequestMapping(value = "/delete/{ConfigDate}", method = RequestMethod.POST)
public RedirectView deleteConfig (@RequestParam String ConfigDate) {
configvaluesRepository.deleteAllByConfigDate(ConfigDate);
@@ -36,6 +37,31 @@ public RedirectView deleteConfig (@RequestParam String ConfigDate) {
RedirectView redirectView = new RedirectView();
redirectView.setUrl(("http://localhost:9000/index.html"));
return redirectView;
+ }
+
+ // ADDITION OF A CONFIG
+ @Transactional // REQUIRED by Spring or will get Entity errors
+ @RequestMapping(value = "/add/{ConfigDate1}/{ConfigName1}", method = RequestMethod.POST)
+ public RedirectView addConfig (@RequestParam String ConfigDate1, String ConfigName1) {
+ int newID = (((int) configvaluesRepository.count()) + 1);
+ Configvalues configvalues = Configvalues.builder()
+ .configID(newID)
+ .configName(ConfigName1)
+ .configDate(ConfigDate1)
+ .build();
+ configvaluesRepository.save(configvalues);
+
+ System.out.println(" ########## ADDED FOR " + configvalues.toString() + " ############## ");
+ RedirectView redirectView = new RedirectView();
+ redirectView.setUrl(("http://localhost:9000/index.html"));
+ return redirectView;
+
+
+
+
+
+
+
// // DELETE to delete a single config in a month
diff --git a/configurationapp/src/main/resources/static/index.html b/configurationapp/src/main/resources/static/index.html
index ee79762..c5dc3f9 100755
--- a/configurationapp/src/main/resources/static/index.html
+++ b/configurationapp/src/main/resources/static/index.html
@@ -49,33 +49,30 @@ Current Configurations (All)
To Add a Configuration
-
To Delete a Configuration for a Selected Month
From 4206cee45aabdad131f0fa48faf8989536c6643b Mon Sep 17 00:00:00 2001
From: gregcanter <5223851+gregcanter@users.noreply.github.com>
Date: Tue, 25 Jun 2019 10:32:28 -0400
Subject: [PATCH 5/5] Added ability to delete a single configuration.
---
.../com/att/Init/ConfigvaluesInitializer.java | 3 -
.../controllers/ConfigvaluesController.java | 171 +++---------------
.../repositories/ConfigvaluesRepository.java | 7 -
.../src/main/resources/static/index.html | 18 +-
.../target/classes/static/index.html | 45 +++--
5 files changed, 74 insertions(+), 170 deletions(-)
diff --git a/configurationapp/src/main/java/com/att/Init/ConfigvaluesInitializer.java b/configurationapp/src/main/java/com/att/Init/ConfigvaluesInitializer.java
index 83c50c8..54dc887 100755
--- a/configurationapp/src/main/java/com/att/Init/ConfigvaluesInitializer.java
+++ b/configurationapp/src/main/java/com/att/Init/ConfigvaluesInitializer.java
@@ -24,9 +24,6 @@ public ConfigvaluesInitializer(ConfigvaluesRepository configvaluesRepository) {
@PostConstruct
public void init() {
log.info("generating {} random employees", NUMBER_TO_GENERATE);
- // TODO CLEAN-UP THIS
- //Random randomGenerator = new Random();
- //Faker faker = new Faker();
ArrayList arrayList = new ArrayList();
arrayList.add("A");
diff --git a/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java b/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java
index 139b748..98ca938 100644
--- a/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java
+++ b/configurationapp/src/main/java/com/att/controllers/ConfigvaluesController.java
@@ -22,7 +22,7 @@ public ConfigvaluesController(ConfigvaluesRepository configvaluesRepository) {
// SHOW ALL VALUES
@RequestMapping(value = "/api/configvalues", method = RequestMethod.GET)
- public DataTablesOutput list (@Valid DataTablesInput input) {
+ public DataTablesOutput list(@Valid DataTablesInput input) {
// configvaluesRepository.deleteAllByConfigDate("102019");
// System.out.println(" DELETION IN AFFECT ");
return configvaluesRepository.findAll(input);
@@ -31,7 +31,7 @@ public DataTablesOutput list (@Valid DataTablesInput input) {
// DELETION OF CONFIGS BY CONFIG DATE VALUE
@Transactional // REQUIRED by Spring or will get Entity errors
@RequestMapping(value = "/delete/{ConfigDate}", method = RequestMethod.POST)
- public RedirectView deleteConfig (@RequestParam String ConfigDate) {
+ public RedirectView deleteConfig(@RequestParam String ConfigDate) {
configvaluesRepository.deleteAllByConfigDate(ConfigDate);
System.out.println(" ########## DELETION IN AFFECT FOR " + ConfigDate.toString() + " ############## ");
RedirectView redirectView = new RedirectView();
@@ -39,148 +39,33 @@ public RedirectView deleteConfig (@RequestParam String ConfigDate) {
return redirectView;
}
- // ADDITION OF A CONFIG
- @Transactional // REQUIRED by Spring or will get Entity errors
- @RequestMapping(value = "/add/{ConfigDate1}/{ConfigName1}", method = RequestMethod.POST)
- public RedirectView addConfig (@RequestParam String ConfigDate1, String ConfigName1) {
- int newID = (((int) configvaluesRepository.count()) + 1);
- Configvalues configvalues = Configvalues.builder()
- .configID(newID)
- .configName(ConfigName1)
- .configDate(ConfigDate1)
- .build();
- configvaluesRepository.save(configvalues);
-
- System.out.println(" ########## ADDED FOR " + configvalues.toString() + " ############## ");
- RedirectView redirectView = new RedirectView();
- redirectView.setUrl(("http://localhost:9000/index.html"));
- return redirectView;
-
-
-
-
-
-
-
-
+ // ADDITION OF A CONFIG
+ @Transactional // REQUIRED by Spring or will get Entity errors
+ @RequestMapping(value = "/add/{ConfigDate1}/{ConfigName1}", method = RequestMethod.POST)
+ public RedirectView addConfig(@RequestParam String ConfigDate1, String ConfigName1) {
+ int newID = (((int) configvaluesRepository.count()) + 1);
+ Configvalues configvalues = Configvalues.builder()
+ .configID(newID)
+ .configName(ConfigName1)
+ .configDate(ConfigDate1)
+ .build();
+ configvaluesRepository.save(configvalues);
+
+ System.out.println(" ########## ADDED FOR " + configvalues.toString() + " ############## ");
+ RedirectView redirectView = new RedirectView();
+ redirectView.setUrl(("http://localhost:9000/index.html"));
+ return redirectView;
-// // DELETE to delete a single config in a month
-// @RequestMapping(value="/api/delete/{ConfigDate}") // http://localhost:9000
-// // /configuration/delete/?ConfigDate=012019
-// public @ResponseBody String deleteConfig(@RequestParam String ConfigDate) {
-// configvaluesRepository.deleteAllByConfigDate(ConfigDate);
-// return ("Deletion of " + ConfigDate + " is complete");
}
-
-
-
-
-
-
-
-
-
-
-
- // TODO CLEAN THIS UP
-// @RequestMapping(value = "/api/configvalues", method = RequestMethod.POST)
-// public DataTablesOutput listPost (@Valid DataTablesInput input) {
-// return configvaluesRepository.findAll(input);
-// }
-
+ // DELETION OF A SINGLE CONFIG BY CONFIG ID VALUE
+ @Transactional // REQUIRED by Spring or will get Entity errors
+ @RequestMapping(value = "/deleteSingle/{ConfigID}", method = RequestMethod.POST)
+ public RedirectView deleteSingleConfig(@RequestParam Integer ConfigID) {
+ configvaluesRepository.deleteById(ConfigID);
+ System.out.println(" ########## *SINGLE* DELETION IN AFFECT FOR " + ConfigID.toString() + " ############## ");
+ RedirectView redirectView = new RedirectView();
+ redirectView.setUrl(("http://localhost:9000/index.html"));
+ return redirectView;
+ }
}
-
-// TODO: DELETE ALL THE BELOW THAT IS NOT NEEDED
-//
-// @Autowired
-// private ConfigValueRepository configValueRepository;
-//
-// public ConfigValueController (ConfigValueRepository configValueRepository) {
-// this.configValueRepository = configValueRepository;
-// }
-//
-//// // GET to show all values
-//// @GetMapping // http://localhost:9000/configuration
-//// public Iterable findAll() {
-//// return configValueRepository.findAll();
-//// }
-////
-//
-//
-//
-// @RequestMapping(value = "/findAll", method = RequestMethod.GET)
-// public DataTablesOutput list(@Valid DataTablesInput input) {
-// return configValueRepository.findAll(input);
-// }
-//
-// @RequestMapping(value = "/findAll", method = RequestMethod.POST)
-// public DataTablesOutput listPost(@Valid DataTablesInput input) {
-// return configValueRepository.findAll(input);
-// }
-//
-//
-//
-//
-// // GET to show all values by date
-// @GetMapping("/showall/{configDate}") // http://localhost:9000/configuration/showall/042019
-// public List findByConfigDate(@PathVariable String configDate) {
-// return configValueRepository.findByConfigDate(configDate);
-// }
-//
-// // GET to show all values by date
-// @Transactional
-// @GetMapping("/showall2/{configID}") // http://localhost:9000/configuration/showall/3
-// public List findByConfigID(@PathVariable int configID) {
-// return configValueRepository.findByConfigID(configID);
-// }
-//
-//
-
-//
-//
-// // DELETE to delete all values of a month
-// @Transactional
-// @GetMapping("/deleteDate/{configDate}") //http://localhost:9000/configuration/deleteDate/042019
-// public void deleteMonth(@PathVariable String configDate) {
-// configValueRepository.deleteConfigValuesByConfigDate(configDate);
-//// configValueRepository.findByConfigDate(configDate);
-//// System.out.println("Found for deletion date " + configDate.toString());
-// configValueRepository.deleteConfigValuesByConfigDate(configDate);
-// System.out.println("Deleted date "+ configDate.toString());
-// }
-//
-// // Add items for a time period
-// @PostMapping("/create")
-// @ResponseStatus(HttpStatus.CREATED)
-// public ConfigValue create(@RequestBody ConfigValue configValue) {
-// //ConfigValue configValue1 = configValueRepository.save(configValue);
-// //return configValue1;
-// return configValueRepository.save(configValue);
-// }
-//
-//// @ResponseBody
-//// public List getConfigurationsForYearMonth(
-//// @PathVariable("yearMonthNumber") String yearMonth) {
-////
-//// return new ArrayList<>();
-//// }
-//
-// // DELETE to delete all values
-//// @RequestMapping(value="/{yearMonthNumber}", method=RequestMethod.DELETE)
-//// public void deleteConfigurationsForYearMonth(@PathVariable("yearMonthNumber") String yearMonth) {
-//// try {
-////
-//// } catch (Exception ex) {
-////
-//// }
-//// }
-////
-//// // PUT to create 1 entry/ 1 config
-//// @RequestMapping(value="/{yearMonthNumber}", method={ RequestMethod.POST, RequestMethod.PUT })
-//// public void addConfigurationForYearMonth(
-//// @PathVariable("yearMonthNumber") String yearMonth,
-//// @RequestBody ConfigValue value) {
-////
-//// }
-//}
diff --git a/configurationapp/src/main/java/com/att/repositories/ConfigvaluesRepository.java b/configurationapp/src/main/java/com/att/repositories/ConfigvaluesRepository.java
index af88ced..e9d6f25 100644
--- a/configurationapp/src/main/java/com/att/repositories/ConfigvaluesRepository.java
+++ b/configurationapp/src/main/java/com/att/repositories/ConfigvaluesRepository.java
@@ -17,12 +17,5 @@
@Repository
public interface ConfigvaluesRepository extends DataTablesRepository {
-
- // TODO - CLEAN THIS UP
-// List findByConfigID( int ConfigID);
-// List findByConfigDate( String configDate);
-// void deleteConfigValuesByConfigDate( String configDate);
void deleteAllByConfigDate(String configDate);
-// void deleteByConfigID(int configID);
-
}
diff --git a/configurationapp/src/main/resources/static/index.html b/configurationapp/src/main/resources/static/index.html
index c5dc3f9..fc8e983 100755
--- a/configurationapp/src/main/resources/static/index.html
+++ b/configurationapp/src/main/resources/static/index.html
@@ -75,7 +75,7 @@ To Add a Configuration