From adb6025d5fba654ddb31bb8f2e0661d2ed082a85 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <97711324+KermitHermit121@users.noreply.github.com> Date: Mon, 31 Oct 2022 07:22:54 -0700 Subject: [PATCH 01/85] Post Java Class --- src/main/java/service/Post.java | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/java/service/Post.java diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java new file mode 100644 index 0000000..7e3d5af --- /dev/null +++ b/src/main/java/service/Post.java @@ -0,0 +1,74 @@ +package service; +public class Post { + private int PostId, PlantId, Age; + private String PlantName, Species, Status, NameOfUser, Caption, PhotoUrl; + public Post(int PostId, int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { + this.PostId = PostId; + this.PlantId = PlantId; + this.Age = Age; + this.PlantName = PlantName; + this.Species = Species; + this.Status = Status; + this.NameOfUser = NameOfUser; + this.Caption = Caption; + this.PhotoUrl = PhotoUrl; + } + // all the get methods + public int getPostID() { + return PostId; + } + public int getPlantID() { + return PlantId; + } + public int getAge() { + return Age; + } + public String getPlantName() { + return PlantName; + } + public String getSpecies() { + return Species; + } + public String getStatus() { + return Status; + } + public String getNameOfUser() { + return NameOfUser; + } + public String getCaption() { + return Caption; + } + public String getPhotoUrl() { + return PhotoUrl; + } + // all the set methods + public void getPostID(int PostId) { + this.PostId = PostId; + } + public void getPlantID(int PlantId) { + this.PlantId = PlantId; + } + public void getAge(int age) { + this.Age = Age; + } + public void getPlantName(String PlantName) { + this.PlantName = PlantName; + } + public void getSpecies(String Species) { + this.Species = Species; + } + public void getStatus(String Status) { + this.Status = Status; + } + public void getNameOfUser(String NameOfUser) { + this.NameOfUser = NameOfUser; + } + public void getCaption(String Caption) { + this.Caption = Caption; + } + public void getPhotoUrl(String PhotoUrl) { + this.PhotoUrl = PhotoUrl; + } +} + + From 3b927cec796ca1846b3d44b03cfe2769ca51c70d Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 7 Nov 2022 08:53:19 -0800 Subject: [PATCH 02/85] Maybe making the upload page work --- src/main/java/service/MainController.java | 24 ++++++- src/main/resources/templates/index.html | 3 +- src/main/resources/templates/uploadPage.html | 72 +++++++++++++++++++ .../resources/templates/uploadSuccess.html | 27 +++++++ 4 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/templates/uploadPage.html create mode 100644 src/main/resources/templates/uploadSuccess.html diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index eeb1a1f..6e3ecb5 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -4,8 +4,13 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.Arrays; +import java.util.List; + @Controller public class MainController { @Autowired @@ -19,6 +24,21 @@ public String index() { @GetMapping("/hello") public String hello(@RequestParam(name="name", required=false, defaultValue="World") String name, Model model) { model.addAttribute("name", name); - return "hello"; + return "hello";} + @GetMapping ("/uploadPage") + public String uploadPage(Model m){ + Post post = new Post(); + m.addAttribute("plant"); + return "/uploadPage"; + + List listStatus = Arrays.asList("Alive", "Dead", "Watered", "Un-Watered"); + m.addAttribute("listStatus", listStatus); + + return "uploadPage"; + } + @PostMapping("/uploadPage") + public String submitUploadPage(@ModelAttribute("post") Post post){ + System.out.print(post); + return "uploadSuccess"; } -} \ No newline at end of file +} diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 702abed..96b25f1 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -2,9 +2,10 @@ Getting Started: Serving Web Content - +

Get your greeting here

+

Upload a Plant Post here

diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html new file mode 100644 index 0000000..f8955e7 --- /dev/null +++ b/src/main/resources/templates/uploadPage.html @@ -0,0 +1,72 @@ + + + + PlantBook + + + + + + + + + +

PlantBook

+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
+
+
+ +
+ +
+ + \ No newline at end of file diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html new file mode 100644 index 0000000..1531a97 --- /dev/null +++ b/src/main/resources/templates/uploadSuccess.html @@ -0,0 +1,27 @@ + + + + + Upload Success + + + +
+

Upload Succeeded!

+ Picture> th:
+ E-mail:
+ Password:
+ Gender:
+ Profession:
+ Married?
+ Note:
+
+ + + \ No newline at end of file From 1232737e42294bbcf807baecfb1c0d220c85d8ee Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 9 Nov 2022 07:51:42 -0800 Subject: [PATCH 03/85] fixing upload page to match post --- src/main/java/service/MainController.java | 3 +-- src/main/java/service/Post.java | 11 +++++++++++ src/main/resources/templates/uploadPage.html | 6 +++--- src/main/resources/templates/uploadSuccess.html | 15 ++++++++------- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 6e3ecb5..3b84a57 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -29,11 +29,10 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor public String uploadPage(Model m){ Post post = new Post(); m.addAttribute("plant"); - return "/uploadPage"; List listStatus = Arrays.asList("Alive", "Dead", "Watered", "Un-Watered"); m.addAttribute("listStatus", listStatus); - + m.addAttribute("post", post); return "uploadPage"; } @PostMapping("/uploadPage") diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 7e3d5af..d15c569 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -13,6 +13,17 @@ public Post(int PostId, int PlantId, int Age, String PlantName, String Species, this.Caption = Caption; this.PhotoUrl = PhotoUrl; } + public Post(){ + PostId = 0; + PlantId = 0; + Age = 0; + PlantName = ""; + Species = ""; + Status = ""; + NameOfUser = ""; + Caption = ""; + PhotoUrl = ""; + } // all the get methods public int getPostID() { return PostId; diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index f8955e7..5d4f7be 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -36,7 +36,7 @@

PlantBook

- +

@@ -46,12 +46,12 @@

PlantBook


- +

- +

diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html index 1531a97..4692927 100644 --- a/src/main/resources/templates/uploadSuccess.html +++ b/src/main/resources/templates/uploadSuccess.html @@ -14,13 +14,14 @@

Upload Succeeded!

- Picture> th:
- E-mail:
- Password:
- Gender:
- Profession:
- Married?
- Note:
+ Photo URL:
+ PlantId:
+ Age:
+ Plant Name:
+ Species:
+ Status:
+ Name of User:
+ Caption:
From f5b0e2d276d79a9a0abdde22c610584a60c2ca10 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 14 Nov 2022 07:47:32 -0800 Subject: [PATCH 04/85] fixing the upload success page --- src/main/java/service/Post.java | 5 ++- src/main/resources/templates/uploadPage.html | 35 +++++-------------- .../resources/templates/uploadSuccess.html | 6 ---- 3 files changed, 12 insertions(+), 34 deletions(-) diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index d15c569..ab527c8 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -80,6 +80,9 @@ public void getCaption(String Caption) { public void getPhotoUrl(String PhotoUrl) { this.PhotoUrl = PhotoUrl; } + @Override + public String toString(){ + return "Post [ Photo URL=" + PhotoUrl + ", Plant Type=" + Species + ", Age=" + Age + ", Caption=" + Caption + ", Life Status=" + Status + "]"; + } } - diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index 5d4f7be..c77647a 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -3,27 +3,8 @@ PlantBook - @@ -36,12 +17,12 @@

PlantBook

- +

- +

@@ -55,10 +36,10 @@

PlantBook


- + +
diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html index 4692927..dcf4fcf 100644 --- a/src/main/resources/templates/uploadSuccess.html +++ b/src/main/resources/templates/uploadSuccess.html @@ -4,11 +4,6 @@ Upload Success @@ -23,6 +18,5 @@

Upload Succeeded!

Name of User:
Caption:
- \ No newline at end of file From 9d11c7742f0c513ff09e8675b7bfc96c68dd5ca5 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:27:22 -0800 Subject: [PATCH 05/85] fixing the upload success page --- src/main/resources/templates/uploadSuccess.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html index dcf4fcf..ed09568 100644 --- a/src/main/resources/templates/uploadSuccess.html +++ b/src/main/resources/templates/uploadSuccess.html @@ -9,14 +9,12 @@

Upload Succeeded!

- Photo URL:
- PlantId:
- Age:
- Plant Name:
- Species:
- Status:
- Name of User:
- Caption:
+ Photo URL:
+ Age:
+ Plant Name:
+ Species:
+ Status:
+ Caption:
\ No newline at end of file From 6bf0309ffcbf46adc1bcadb1b8f6ec2d2ebeb880 Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Wed, 16 Nov 2022 07:33:09 -0800 Subject: [PATCH 06/85] Stylized feed page (nav bar) --- src/main/java/service/MainController.java | 3 ++ .../static/Copy-of-Copy-of-Untitled-1.jpg | Bin 0 -> 34501 bytes src/main/resources/templates/feed.html | 51 ++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 src/main/resources/static/Copy-of-Copy-of-Untitled-1.jpg create mode 100644 src/main/resources/templates/feed.html diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index eeb1a1f..6b754cc 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -21,4 +21,7 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor model.addAttribute("name", name); return "hello"; } + + @GetMapping("/feed") + public String feed(){ return "feed"; } } \ No newline at end of file diff --git a/src/main/resources/static/Copy-of-Copy-of-Untitled-1.jpg b/src/main/resources/static/Copy-of-Copy-of-Untitled-1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ee00b51d500003d61d2138260b30bb5bcae09cfa GIT binary patch literal 34501 zcmbq)RZtwjw(a2VPLSX-xVr@jgUjF!1Hmo01$TE35NvRFcXubj-2w!cyqxpy{dnJR z@2=|V{^+V+-Ceczs?~p2|84`YL9+6)02mkm0Onr;{%!z50BHXL9Ss8$69X3y2M?E& zn2?Z|l!1)mUowc$0qOoV5nc%%4ju_!V~~^-$k^UM+rU1=-94lsehhr$53T}>?N4e{L-%A5n!qkpUUzVXuz)z&j zipj?bJms?*sfb@UG^dl?M2`8Vwyt*!0Grt zMHYk0K630i{5EGBPHpANPd?2+ofI;KQd69JuM7=3z9zRIMgc0X=zbm#QatG0j`$4_ zWAQaNZ@tRBrw$j^^MY^GJrx>EQlEjDVpmT+!7<}DUBbWA8`qPa30}Ts80@m85PqSD z5!^N_U25xdsbAZ(LQr_&r5nnCc@Oadg>dLLSZ7cAJmZt8Y@!&vUETKkam?AtU)GuhHj1JQ(Md zXC{MvuBVfy7D7Y5NR>RzafMmP+asd)msZRxn$?S3s&J{y6?>*TRL&pm2;~k;7M7fe-!a9n)lL2A+C`A2FIHfY z%UHNi+D9%Z^@^ok9H1TjJb$sPl#qXlqLTHqEMHl2eBUh0ht$u(=t?BpBJxD>s*rBj z$w8{ZX)cprV~%B%$KaQOysqUmThGZdxAnnafaV>oWWngc*%_6!)_tYODj)92$I<)u z5WFEu8Ku8aD{~+|_YK&d{vgM#yh}?P9V0M|P-KGq2b8r5D-!paLU`@%yhj89; zw4mtm>js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U$ZL%NuqF)On z{{Rt4QWddyoVG>^CwwKs!~iG}00II60s;X81pxs700000009CK zAu$6G5MCr_Kre0CBBn4^Pavl zoeP!NgnR08r9+pp6a34xJ$3A2WJxb&W4(XEdMs?Q=;afqWF4WpRz6lolgQ>{VwP-! zxDEC1tD+?IEgrs40)5Y2%3r|wb428rqhuxHgOUCPkd-r&F2|97CmY5~5Vl$9SSQJ6 zn?z;gx?>X=B8AlT)ZPh6qb-?}G=%bbVu!LjITC1T=z_LIV62E+?r#HmJdP=3MCOpW z54e#TDGae|ss5g)vPta?BAPD)VrPwsQGS@?WD;2-?5v1LV>xlxl^k#L8}UTlyA+8x zXB6|*8tQuLYKeb?rL!+0>atM!u`6P9$V&D`#i8}eus7)n4dsxHGm+ZIStQZGt@hA~ zYpE|JN;w>JLyJPuNV*fT#CS5YCu~aH3DY>|2LfEMtPhc~a{>CWEA^9E_iNckPt0NmcaYUoiG(7b3tZfN5 zvM~4Pi$t~6`z0^roL8P-IK2s)6n!v{f~52XiRdW*w?aNJ~5%Hz^>@3B8aS#d7+eeH=*MlXj(6- z!KG|j$xV@YrbQ*9S`!gA?3Pi6g-v8hp~W(&W?2py%0zyef7GATMMl~G0FvS4q%H=( zaJXAO!uKI@SM3_5M5T<9H^{|F37<&MhOe4 zYvC?Dl3ps2?22#1N|DI!M)Xog(nU37Z4u=DM=Q~BEe=K4(JUfaM&d?q!$O*~!Mm#@i#uM3xEHn4OV|Y~WrfgB5#;Lr00?j1p%ihB&4uBsGqlEKs5) zkE!Tl5S(?S9DjxP_i&c_Gy+! zs~=P|m-T>1@0W + + + + PlantBook: Main Feed + + Bootstrap Example + + + + + + + + + + + +

Say hi to some plants!

+ + + planty + + + \ No newline at end of file From 840e070cf8aa18b8c49e1c7daf941c443190d9a2 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:50:53 -0800 Subject: [PATCH 07/85] upload success page fixing --- src/main/java/service/MainController.java | 4 +++- src/main/resources/templates/uploadPage.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 3b84a57..f5a28ff 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -36,8 +36,10 @@ public String uploadPage(Model m){ return "uploadPage"; } @PostMapping("/uploadPage") - public String submitUploadPage(@ModelAttribute("post") Post post){ + public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ System.out.print(post); + + m.addAttribute("post", post); return "uploadSuccess"; } } diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index c77647a..365dc8f 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -32,7 +32,7 @@

PlantBook


- +

From 668435c52aaea335c2cb1b7b309f348bd488969d Mon Sep 17 00:00:00 2001 From: anaiysaa Date: Wed, 16 Nov 2022 07:51:46 -0800 Subject: [PATCH 08/85] 11/16/22 --- src/main/java/service/plantAPi.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/service/plantAPi.java diff --git a/src/main/java/service/plantAPi.java b/src/main/java/service/plantAPi.java new file mode 100644 index 0000000..510b4ff --- /dev/null +++ b/src/main/java/service/plantAPi.java @@ -0,0 +1,20 @@ +package service; + +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; + +public class plantAPi { + public void api() throws IOException, InterruptedException { + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("https://house-plants.p.rapidapi.com/common/coralberry")) + .header("X-RapidAPI-Key", "e3a6efcf20msh357c2c0f26d706dp1bb9fbjsn3c9ffec76d95") + .header("X-RapidAPI-Host", "house-plants.p.rapidapi.com") + .method("GET", HttpRequest.BodyPublishers.noBody()) + .build(); + HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); + System.out.println(response.body()); + } +} From d26c796d14e96bd86463cf6692e2e5c54e27c7cd Mon Sep 17 00:00:00 2001 From: anaiysaa Date: Wed, 16 Nov 2022 07:51:46 -0800 Subject: [PATCH 09/85] 11/16/22 --- src/main/java/service/plantAPi.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/service/plantAPi.java diff --git a/src/main/java/service/plantAPi.java b/src/main/java/service/plantAPi.java new file mode 100644 index 0000000..510b4ff --- /dev/null +++ b/src/main/java/service/plantAPi.java @@ -0,0 +1,20 @@ +package service; + +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; + +public class plantAPi { + public void api() throws IOException, InterruptedException { + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("https://house-plants.p.rapidapi.com/common/coralberry")) + .header("X-RapidAPI-Key", "e3a6efcf20msh357c2c0f26d706dp1bb9fbjsn3c9ffec76d95") + .header("X-RapidAPI-Host", "house-plants.p.rapidapi.com") + .method("GET", HttpRequest.BodyPublishers.noBody()) + .build(); + HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); + System.out.println(response.body()); + } +} From 8b29a172de0056ca5ff109ad968c1ab2062770e3 Mon Sep 17 00:00:00 2001 From: Jasmine-xnf <81267766+Jasmine-xnf@users.noreply.github.com> Date: Mon, 21 Nov 2022 07:32:59 -0800 Subject: [PATCH 10/85] added @PostMapping to api path --- src/main/java/service/MainController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index eeb1a1f..2d96326 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -20,5 +20,15 @@ public String index() { public String hello(@RequestParam(name="name", required=false, defaultValue="World") String name, Model model) { model.addAttribute("name", name); return "hello"; + + + } + @PostMapping("/api") + public String index() { + return "index"; } + + @PostMapping("/api") + HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); + public respHttpResponse getResponse() {return response;} } \ No newline at end of file From 9a01010f307b7d9c2f98ade99951c58d4ffda715 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 21 Nov 2022 07:50:47 -0800 Subject: [PATCH 11/85] i know that the data is getting inputted but it isnt showing up on the upload success page --- src/main/java/service/Post.java | 11 +++++------ src/main/resources/templates/uploadPage.html | 10 ++++++++++ src/main/resources/templates/uploadSuccess.html | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index ab527c8..9ff2088 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -2,9 +2,9 @@ public class Post { private int PostId, PlantId, Age; private String PlantName, Species, Status, NameOfUser, Caption, PhotoUrl; - public Post(int PostId, int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { - this.PostId = PostId; - this.PlantId = PlantId; + public Post(int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { + + //this.PlantId = PlantId; this.Age = Age; this.PlantName = PlantName; this.Species = Species; @@ -13,9 +13,7 @@ public Post(int PostId, int PlantId, int Age, String PlantName, String Species, this.Caption = Caption; this.PhotoUrl = PhotoUrl; } - public Post(){ - PostId = 0; - PlantId = 0; + public Post(){ Age = 0; PlantName = ""; Species = ""; @@ -24,6 +22,7 @@ public Post(){ Caption = ""; PhotoUrl = ""; } + // all the get methods public int getPostID() { return PostId; diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index 365dc8f..ce6e71c 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -20,6 +20,16 @@

PlantBook


+
+ + +
+
+
+ + +
+
diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html index ed09568..7affb39 100644 --- a/src/main/resources/templates/uploadSuccess.html +++ b/src/main/resources/templates/uploadSuccess.html @@ -11,6 +11,7 @@

Upload Succeeded!

Photo URL:
Age:
+ User Name:
Plant Name:
Species:
Status:
From 3b01cbbe017c0a971e8eb3bd3b6e0d3f78bb7e95 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 23 Nov 2022 07:34:29 -0800 Subject: [PATCH 12/85] 11/23/2022 euh stuff still to be tested.... --- src/main/java/service/MainController.java | 6 +++ src/main/java/service/SqlDB.java | 45 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index eeb1a1f..f8966d3 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -21,4 +21,10 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor model.addAttribute("name", name); return "hello"; } + + public void uploadPost() { + Post test = new Post(null, 600, 16, "Penguins", "Left", "Dead", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); + + SqlDB.uploadPost(test); + } } \ No newline at end of file diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index c7a6976..c23dae1 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -3,6 +3,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +import java.util.ArrayList; +import java.sql.*; @Component public class SqlDB { @@ -24,5 +26,48 @@ public SqlDB(Environment env) { } // TODO: Add methods to talk to your DB here + /* + * Take created post information and add it into the database + * @param line - + */ + public static void uploadPost(Post post){ + Connection connect = DriverManger.getConnection(url); + try { + String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; + String value = getValues(post); + query1 += "VALUES (" + value + ")"; + Statement st = connection.createStatement(); + st.execute(query1, Statement.RETURN_GENERATED_KEYS); + } catch (Exception e) { + System.err.println("Got an error in tags query! "); + System.err.println(e.getMessage()); + } + } + + public ArrayList viewPosts() { + ArrayList posts = new ArrayList<>(); + return posts; + } + + private String getValues(Post post) { + ArrayList temp = new ArrayList<>(); + temp.add(post.getPlantID); + temp.add(post.getAge); + temp.add("N'" + post.getPlantName + "'"); + temp.add("N'" + post.getSpecies + "'"); + temp.add("N'" + post.getStatus + "'"); + temp.add("N'" + post.getNameOfUser + "'"); + temp.add("N'" + post.getCaption + "'"); + temp.add("N'" + post.getPhotoUrl + "'"); + + String result = ""; + for (int i = 0; i < temp.length(); i++) { + result += data; + if (i != temp.length - 2) { + result += ", "; + } + } + return result; + } } \ No newline at end of file From 437f7a62783344c52187ded13e71fdee69714d5b Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Wed, 23 Nov 2022 07:52:28 -0800 Subject: [PATCH 13/85] Stylized feed page (nav bar) --- src/main/resources/templates/feed.html | 31 +++++++++++++++++++++---- src/main/resources/templates/index.html | 2 +- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html index 4fab16f..560c82a 100644 --- a/src/main/resources/templates/feed.html +++ b/src/main/resources/templates/feed.html @@ -23,15 +23,32 @@ body{ font-family: Arial, sans-serif; - background-color: rgb(191, 227, 180, 0.9); } + //background-color: rgb(74, 4, 4, 0.7); } + + .flex-container { + display: flex; + height: 600px; + flex-flow: row wrap; + //background-color: rgb(252, 251, 244); + } + + .flex-container > div { + background-color: #f1f1f1; + width: 100px; + margin: 10px; + text-align: center; + line-height: 75px; + font-size: 30px; +} - - +// +//< style="height:1500px"> -

Say hi to some plants!

+ +

Say hi to some plants!

planty - +
+
1
+
2
+
3
+
\ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 702abed..54ab6a7 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -5,6 +5,6 @@ -

Get your greeting here

+

PlantBook here

From 82b8edf4e1ec05d92c47907fc0385caffda915c3 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Mon, 28 Nov 2022 07:28:08 -0800 Subject: [PATCH 14/85] small comments and little changes --- .vscode/launch.json | 4 +++- gradlew | 0 src/main/java/service/MainController.java | 3 ++- src/main/java/service/Post.java | 8 +++++--- src/main/java/service/SqlDB.java | 6 ++++-- 5 files changed, 14 insertions(+), 7 deletions(-) mode change 100644 => 100755 gradlew diff --git a/.vscode/launch.json b/.vscode/launch.json index f23332c..c9ea6cf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,7 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { "type": "java", "name": "Attach Spring", @@ -15,7 +16,8 @@ "type": "java", "name": "Launch Spring", "request": "launch", - "mainClass": "service.WebServer" + "mainClass": "service.WebServer", + "env": {"DB_HOSTNAME": "hnaprojects.database.windows.net", "DB_DB_NAME": "Plantbook", "DB_USER": "hna-admin", "DB_PASSWORD": "HolyNames123"} } ] } \ No newline at end of file diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index f8966d3..0b19285 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -5,6 +5,7 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.service.Post; @Controller public class MainController { @@ -25,6 +26,6 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor public void uploadPost() { Post test = new Post(null, 600, 16, "Penguins", "Left", "Dead", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); - SqlDB.uploadPost(test); + sqlDB.uploadPost(test); } } \ No newline at end of file diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 7e3d5af..7ca4458 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -1,7 +1,9 @@ package service; + public class Post { private int PostId, PlantId, Age; private String PlantName, Species, Status, NameOfUser, Caption, PhotoUrl; + public Post(int PostId, int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { this.PostId = PostId; this.PlantId = PlantId; @@ -13,6 +15,7 @@ public Post(int PostId, int PlantId, int Age, String PlantName, String Species, this.Caption = Caption; this.PhotoUrl = PhotoUrl; } + // all the get methods public int getPostID() { return PostId; @@ -41,6 +44,7 @@ public String getCaption() { public String getPhotoUrl() { return PhotoUrl; } + // all the set methods public void getPostID(int PostId) { this.PostId = PostId; @@ -69,6 +73,4 @@ public void getCaption(String Caption) { public void getPhotoUrl(String PhotoUrl) { this.PhotoUrl = PhotoUrl; } -} - - +} \ No newline at end of file diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index c23dae1..eab82c1 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -3,7 +3,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; -import java.util.ArrayList; +import java.util.List; import java.sql.*; @Component @@ -21,7 +21,7 @@ public SqlDB(Environment env) { user = env.getProperty("db.user"); password = env.getProperty("db.password"); - connectionUrl = String.format("jdbc:sqlserver://%s:1433;database=%s;user=%s;password=%s;encrypt=true;" + connectionUrl = String.format("jdbc:sqlserver://%s:1433;database=%s;user=%s;password=%s;encrypt=true" + "hostNameInCertificate=*.database.windows.net;loginTimeout=30;", hostName, dbName, user, password); } @@ -33,10 +33,12 @@ public SqlDB(Environment env) { public static void uploadPost(Post post){ Connection connect = DriverManger.getConnection(url); try { + // creating the query String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; String value = getValues(post); query1 += "VALUES (" + value + ")"; + // adding the post to the table Statement st = connection.createStatement(); st.execute(query1, Statement.RETURN_GENERATED_KEYS); } catch (Exception e) { From 575d04d63088f1a5944ec72b22a3980dd168a97b Mon Sep 17 00:00:00 2001 From: plengins <59629025+plengins@users.noreply.github.com> Date: Mon, 28 Nov 2022 07:31:16 -0800 Subject: [PATCH 15/85] Update bootRun.xml --- .idea/runConfigurations/bootRun.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.idea/runConfigurations/bootRun.xml b/.idea/runConfigurations/bootRun.xml index e92b210..098f6be 100644 --- a/.idea/runConfigurations/bootRun.xml +++ b/.idea/runConfigurations/bootRun.xml @@ -1,6 +1,11 @@ + - true + true + true + false \ No newline at end of file From 79efa316678fe27ce1b9059c1d14a969ec953ff6 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 28 Nov 2022 07:51:47 -0800 Subject: [PATCH 16/85] still fixing upload success page --- src/main/java/service/MainController.java | 11 ++++++++--- src/main/java/service/Post.java | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index f5a28ff..e2d03e3 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -31,15 +31,20 @@ public String uploadPage(Model m){ m.addAttribute("plant"); List listStatus = Arrays.asList("Alive", "Dead", "Watered", "Un-Watered"); + //m.addAttribute("post", post); m.addAttribute("listStatus", listStatus); - m.addAttribute("post", post); + return "uploadPage"; } @PostMapping("/uploadPage") public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ + m.addAttribute("Age", post.getAge()); + m.addAttribute("PlantName", post.getPlantName()); + m.addAttribute("Species", post.getSpecies()); + m.addAttribute("NameOfUser", post.getNameOfUser()); + m.addAttribute("Caption", post.getCaption()); + m.addAttribute("PhotoUrl", post.getPhotoUrl()); System.out.print(post); - - m.addAttribute("post", post); return "uploadSuccess"; } } diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 9ff2088..6beeb4c 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -13,7 +13,7 @@ public Post(int Age, String PlantName, String Species, String Status, String Nam this.Caption = Caption; this.PhotoUrl = PhotoUrl; } - public Post(){ + /*public Post(){ Age = 0; PlantName = ""; Species = ""; @@ -22,7 +22,7 @@ public Post(){ Caption = ""; PhotoUrl = ""; } - +*/ // all the get methods public int getPostID() { return PostId; From d6d33094a23261cb83408674f2a244628229f1b5 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Mon, 28 Nov 2022 08:40:43 -0800 Subject: [PATCH 17/85] cleaned up some errors fix "all" error but the one about throwing exception --- src/main/java/service/MainController.java | 3 +-- src/main/java/service/Post.java | 14 ++++++++++- src/main/java/service/SqlDB.java | 30 +++++++++++------------ 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 0b19285..0c0a071 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -5,7 +5,6 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; -import java.service.Post; @Controller public class MainController { @@ -24,7 +23,7 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor } public void uploadPost() { - Post test = new Post(null, 600, 16, "Penguins", "Left", "Dead", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); + Post test = new Post(600, 16, "Penguins", "Left", "Dead", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); sqlDB.uploadPost(test); } diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 7ca4458..4d7c949 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -16,6 +16,18 @@ public Post(int PostId, int PlantId, int Age, String PlantName, String Species, this.PhotoUrl = PhotoUrl; } + public Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { + PostId = 0; + this.PlantId = PlantId; + this.Age = Age; + this.PlantName = PlantName; + this.Species = Species; + this.Status = Status; + this.NameOfUser = NameOfUser; + this.Caption = Caption; + this.PhotoUrl = PhotoUrl; + } + // all the get methods public int getPostID() { return PostId; @@ -44,7 +56,7 @@ public String getCaption() { public String getPhotoUrl() { return PhotoUrl; } - + // all the set methods public void getPostID(int PostId) { this.PostId = PostId; diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index eab82c1..ac218e6 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -3,7 +3,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; -import java.util.List; +import java.util.ArrayList; import java.sql.*; @Component @@ -30,8 +30,8 @@ public SqlDB(Environment env) { * Take created post information and add it into the database * @param line - */ - public static void uploadPost(Post post){ - Connection connect = DriverManger.getConnection(url); + public void uploadPost(Post post) { + Connection connect = DriverManager.getConnection(connectionUrl); try { // creating the query String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; @@ -39,7 +39,7 @@ public static void uploadPost(Post post){ query1 += "VALUES (" + value + ")"; // adding the post to the table - Statement st = connection.createStatement(); + Statement st = connect.createStatement(); st.execute(query1, Statement.RETURN_GENERATED_KEYS); } catch (Exception e) { System.err.println("Got an error in tags query! "); @@ -54,19 +54,19 @@ public ArrayList viewPosts() { private String getValues(Post post) { ArrayList temp = new ArrayList<>(); - temp.add(post.getPlantID); - temp.add(post.getAge); - temp.add("N'" + post.getPlantName + "'"); - temp.add("N'" + post.getSpecies + "'"); - temp.add("N'" + post.getStatus + "'"); - temp.add("N'" + post.getNameOfUser + "'"); - temp.add("N'" + post.getCaption + "'"); - temp.add("N'" + post.getPhotoUrl + "'"); + temp.add(Integer.toString(post.getPlantID())); + temp.add(Integer.toString(post.getAge())); + temp.add("N'" + post.getPlantName() + "'"); + temp.add("N'" + post.getSpecies() + "'"); + temp.add("N'" + post.getStatus() + "'"); + temp.add("N'" + post.getNameOfUser() + "'"); + temp.add("N'" + post.getCaption() + "'"); + temp.add("N'" + post.getPhotoUrl() + "'"); String result = ""; - for (int i = 0; i < temp.length(); i++) { - result += data; - if (i != temp.length - 2) { + for (int i = 0; i < temp.size(); i++) { + result += temp.get(i); + if (i != temp.size() - 2) { result += ", "; } } From e33988ca9cdc37b41a301bf0292ffe47ff939189 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Mon, 28 Nov 2022 08:54:48 -0800 Subject: [PATCH 18/85] finally builds!!! does it work as intended? prob not but it builds! --- src/main/java/service/SqlDB.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index ac218e6..4758c07 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -31,8 +31,10 @@ public SqlDB(Environment env) { * @param line - */ public void uploadPost(Post post) { - Connection connect = DriverManager.getConnection(connectionUrl); + Connection connect = null; try { + connect = DriverManager.getConnection(connectionUrl); + // creating the query String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; String value = getValues(post); From c824a093ac356d99629bcbea4162c69dc7129796 Mon Sep 17 00:00:00 2001 From: Jasmine-xnf <81267766+Jasmine-xnf@users.noreply.github.com> Date: Wed, 7 Dec 2022 07:17:11 -0800 Subject: [PATCH 19/85] updated @PostMapping note: api under maintenance --- src/main/java/service/MainController.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 2d96326..c871297 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -23,12 +23,27 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor } - @PostMapping("/api") + @PostMapping("/") public String index() { return "index"; } + //HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); + //public respHttpResponse getResponse() {return response;} + + @PostMapping("/api") + public String callAPI() { + plantAPi.api(); + } + + /* function httpGet(Url) + { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open( "GET", https://house-plants.p.rapidapi.com/common/coralberry, false ); // false for synchronous request + xmlHttp.send( https://house-plants.p.rapidapi.com/common/coralberry ); + return xmlHttp.responseText; + } + @PostMapping("/api") - HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); - public respHttpResponse getResponse() {return response;} + } \ No newline at end of file From 21dc21ba8538472977e587beab8f9067ec5a76ec Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Wed, 7 Dec 2022 07:19:25 -0800 Subject: [PATCH 20/85] Stylized feed page (nav bar) --- src/main/resources/templates/feed.html | 41 ++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html index 560c82a..a826c44 100644 --- a/src/main/resources/templates/feed.html +++ b/src/main/resources/templates/feed.html @@ -21,6 +21,29 @@ margin-left: auto; } + h2 { + color: rgb(74, 4, 4); + opacity: 1.0; + font-size: 25px; + margin-top: 5px; + margin-bottom: 5px; + margin-right: 25px; + margin-left: auto; + } + + image { + margin-top:0 + margin-bottom:5; + margin-right: 25px; + margin-left: auto; + max-width: 100%; + max-height: 100%; + } + + caption { + + } + body{ font-family: Arial, sans-serif; //background-color: rgb(74, 4, 4, 0.7); } @@ -28,13 +51,17 @@ .flex-container { display: flex; height: 600px; - flex-flow: row wrap; + //flex-flow: row wrap; + flex-basis:content; + justify-content: space-around; + align-items: flex-start; //background-color: rgb(252, 251, 244); + } .flex-container > div { background-color: #f1f1f1; - width: 100px; + width: 150px; margin: 10px; text-align: center; line-height: 75px; @@ -45,7 +72,7 @@ //< style="height:1500px"> - +

Say hi to some plants!

@@ -64,9 +91,11 @@

Say hi to some plants!

planty
-
1
-
2
-
3
+

Post 1

+ planty +
+

Post 2

+

Post 3

\ No newline at end of file From 5e37a4535ce5a35bd5156c2d2c5d240a9cc0ef08 Mon Sep 17 00:00:00 2001 From: Jasmine-xnf <81267766+Jasmine-xnf@users.noreply.github.com> Date: Wed, 7 Dec 2022 07:20:27 -0800 Subject: [PATCH 21/85] updated @PostMapping note: api under maintenance --- src/main/java/service/MainController.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index c871297..eb19c6e 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -28,9 +28,6 @@ public String index() { return "index"; } - //HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); - //public respHttpResponse getResponse() {return response;} - @PostMapping("/api") public String callAPI() { plantAPi.api(); @@ -43,7 +40,8 @@ public String callAPI() { xmlHttp.send( https://house-plants.p.rapidapi.com/common/coralberry ); return xmlHttp.responseText; } - - @PostMapping("/api") + HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); + public respHttpResponse getResponse() {return response;} + */ } \ No newline at end of file From c9a17d028f61992e03fccaace0ee7205eb24473f Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 7 Dec 2022 07:26:47 -0800 Subject: [PATCH 22/85] :)) --- src/main/java/service/MainController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 0c0a071..49200db 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -4,6 +4,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller @@ -22,7 +23,9 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor return "hello"; } + @GetMapping("/upload") // change to post later public void uploadPost() { + // Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) Post test = new Post(600, 16, "Penguins", "Left", "Dead", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); sqlDB.uploadPost(test); From 1c3f177acaf18b336f91ebcbf2aec9e3ae1266c0 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 7 Dec 2022 07:45:47 -0800 Subject: [PATCH 23/85] in the main controller it doesnt like the post isnt filled with anything because the is no default but when there is a default the data doesnt change with what the user entered, also when the default is uncommented it doesnt like line 20 of the upload page but im not sure what had changed because it used to work!!!!! --- src/main/java/service/MainController.java | 2 +- src/main/java/service/Post.java | 4 ++-- src/main/resources/templates/uploadPage.html | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index e2d03e3..7986009 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -27,7 +27,7 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor return "hello";} @GetMapping ("/uploadPage") public String uploadPage(Model m){ - Post post = new Post(); + Post post = new Post(); // needs arguments but if i keep the default then the upload success page doesnt work m.addAttribute("plant"); List listStatus = Arrays.asList("Alive", "Dead", "Watered", "Un-Watered"); diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 6beeb4c..ba9db6d 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -21,8 +21,8 @@ public Post(int Age, String PlantName, String Species, String Status, String Nam NameOfUser = ""; Caption = ""; PhotoUrl = ""; - } -*/ + }*/ + // all the get methods public int getPostID() { return PostId; diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index ce6e71c..3398c30 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -17,7 +17,7 @@

PlantBook

- +

@@ -32,7 +32,7 @@

PlantBook


- +

@@ -46,7 +46,7 @@

PlantBook


-
- planty +planty

Post 1

- planty + planty + Forgot to water him for 3 months :/

Post 2

Post 3

From a9bf67701161eeb0e1bb2ba7bedc1a1c2555ba22 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Mon, 12 Dec 2022 07:45:31 -0800 Subject: [PATCH 25/85] still need to figure out postid need to have postid done in azure --- src/main/java/service/MainController.java | 3 ++- src/main/java/service/SqlDB.java | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 49200db..7ab3c03 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -24,10 +24,11 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor } @GetMapping("/upload") // change to post later - public void uploadPost() { + public String uploadPost() { // Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) Post test = new Post(600, 16, "Penguins", "Left", "Dead", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); sqlDB.uploadPost(test); + return "index"; } } \ No newline at end of file diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index 4758c07..bebc8e6 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -21,7 +21,7 @@ public SqlDB(Environment env) { user = env.getProperty("db.user"); password = env.getProperty("db.password"); - connectionUrl = String.format("jdbc:sqlserver://%s:1433;database=%s;user=%s;password=%s;encrypt=true" + connectionUrl = String.format("jdbc:sqlserver://%s:1433;database=%s;user=%s;password=%s;encrypt=true;" + "hostNameInCertificate=*.database.windows.net;loginTimeout=30;", hostName, dbName, user, password); } @@ -36,9 +36,11 @@ public void uploadPost(Post post) { connect = DriverManager.getConnection(connectionUrl); // creating the query - String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; + String query1 = "INSERT INTO Post ([PostID], [PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; + System.out.println(query1); String value = getValues(post); - query1 += "VALUES (" + value + ")"; + query1 += " VALUES (" + value + ")"; + System.out.println(query1); // adding the post to the table Statement st = connect.createStatement(); @@ -56,11 +58,12 @@ public ArrayList viewPosts() { private String getValues(Post post) { ArrayList temp = new ArrayList<>(); + temp.add(Integer.toString(post.getPostID())); temp.add(Integer.toString(post.getPlantID())); temp.add(Integer.toString(post.getAge())); temp.add("N'" + post.getPlantName() + "'"); temp.add("N'" + post.getSpecies() + "'"); - temp.add("N'" + post.getStatus() + "'"); + temp.add("N'" + post.getStatus() + "'"); temp.add("N'" + post.getNameOfUser() + "'"); temp.add("N'" + post.getCaption() + "'"); temp.add("N'" + post.getPhotoUrl() + "'"); @@ -68,7 +71,7 @@ private String getValues(Post post) { String result = ""; for (int i = 0; i < temp.size(); i++) { result += temp.get(i); - if (i != temp.size() - 2) { + if (i < temp.size() - 1) { result += ", "; } } From 696bc99fa0d27c3a949d0b29adc86f3a470c8f84 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 12 Dec 2022 07:50:20 -0800 Subject: [PATCH 26/85] everything works other than age (it just shows 0 even if the user changed the age) and caption (doesn't show anything at all) --- src/main/java/service/MainController.java | 4 ++-- src/main/java/service/Post.java | 20 +++++++++---------- src/main/resources/templates/uploadPage.html | 2 +- .../resources/templates/uploadSuccess.html | 14 ++++++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 7986009..d57fcaf 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -27,11 +27,11 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor return "hello";} @GetMapping ("/uploadPage") public String uploadPage(Model m){ - Post post = new Post(); // needs arguments but if i keep the default then the upload success page doesnt work + Post post = new Post(); // needs arguments but if i keep the default then the upload success page doesn't work m.addAttribute("plant"); List listStatus = Arrays.asList("Alive", "Dead", "Watered", "Un-Watered"); - //m.addAttribute("post", post); + m.addAttribute("post", post); m.addAttribute("listStatus", listStatus); return "uploadPage"; diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index ba9db6d..d8fb706 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -13,7 +13,7 @@ public Post(int Age, String PlantName, String Species, String Status, String Nam this.Caption = Caption; this.PhotoUrl = PhotoUrl; } - /*public Post(){ + public Post(){ Age = 0; PlantName = ""; Species = ""; @@ -21,7 +21,7 @@ public Post(int Age, String PlantName, String Species, String Status, String Nam NameOfUser = ""; Caption = ""; PhotoUrl = ""; - }*/ + } // all the get methods public int getPostID() { @@ -52,31 +52,31 @@ public String getPhotoUrl() { return PhotoUrl; } // all the set methods - public void getPostID(int PostId) { + public void setPostID(int PostId) { this.PostId = PostId; } - public void getPlantID(int PlantId) { + public void setPlantID(int PlantId) { this.PlantId = PlantId; } - public void getAge(int age) { + public void setAge(int age) { this.Age = Age; } - public void getPlantName(String PlantName) { + public void setPlantName(String PlantName) { this.PlantName = PlantName; } - public void getSpecies(String Species) { + public void setSpecies(String Species) { this.Species = Species; } - public void getStatus(String Status) { + public void setStatus(String Status) { this.Status = Status; } - public void getNameOfUser(String NameOfUser) { + public void setNameOfUser(String NameOfUser) { this.NameOfUser = NameOfUser; } public void getCaption(String Caption) { this.Caption = Caption; } - public void getPhotoUrl(String PhotoUrl) { + public void setPhotoUrl(String PhotoUrl) { this.PhotoUrl = PhotoUrl; } @Override diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index 3398c30..1ed9425 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -17,7 +17,7 @@

PlantBook

- +

diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html index 7affb39..b598fea 100644 --- a/src/main/resources/templates/uploadSuccess.html +++ b/src/main/resources/templates/uploadSuccess.html @@ -9,13 +9,13 @@

Upload Succeeded!

- Photo URL:
- Age:
- User Name:
- Plant Name:
- Species:
- Status:
- Caption:
+ Photo URL:
+ Age:
+ User Name:
+ Plant Name:
+ Species:
+ Status:
+ Caption:
\ No newline at end of file From 731e9d03398c8167bd4a3406afbc5332a0e30cee Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Mon, 12 Dec 2022 07:51:05 -0800 Subject: [PATCH 27/85] Stylized feed page (nav bar) --- src/main/resources/templates/feed.html | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html index dc625cb..806164c 100644 --- a/src/main/resources/templates/feed.html +++ b/src/main/resources/templates/feed.html @@ -27,8 +27,18 @@ font-size: 25px; margin-top: 5px; margin-bottom: 5px; - margin-right: 25px; - margin-left: auto; + margin-left: 20px; + text-align: left; + } + + h3 { + color: rgb(74, 4, 4); + opacity: 1.0; + font-size: 20px; + margin-top: 3px; + margin-bottom: 3px; + margin-left: 15px; + text-align: left; } img { @@ -40,7 +50,8 @@ max-height: 100%; } - caption { + button1 { + } @@ -50,10 +61,12 @@ .flex-container { display: flex; + flex-wrap: wrap; + height: content; flex-direction: row; //flex-flow: row wrap; - flex-basis:content; + flex-basis:100%; justify-content: space-around; align-items: flex-start; //background-color: rgb(252, 251, 244); @@ -94,10 +107,13 @@

Say hi to some plants!

Post 1

planty - Forgot to water him for 3 months :/ +

Forgot to water him for 3 months :/

Post 2

Post 3

+

Post 4

+ planty
+

Post 5

\ No newline at end of file From d9fa4704cb09cc8d570960b04b52bdac4e4776e3 Mon Sep 17 00:00:00 2001 From: anaiysaa Date: Wed, 14 Dec 2022 07:25:57 -0800 Subject: [PATCH 28/85] 11/16/22 --- src/main/java/service/MainController.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index eb19c6e..6c8bff0 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -23,15 +23,6 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor } - @PostMapping("/") - public String index() { - return "index"; - } - - @PostMapping("/api") - public String callAPI() { - plantAPi.api(); - } /* function httpGet(Url) { From 692bbae9eaea8cabb8d51bbf9d2a7fd7966a3822 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 14 Dec 2022 07:49:56 -0800 Subject: [PATCH 29/85] Working Upload Page >:D --- src/main/java/service/Post.java | 4 ++-- src/main/resources/templates/uploadSuccess.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index d8fb706..a4f6e00 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -58,7 +58,7 @@ public void setPostID(int PostId) { public void setPlantID(int PlantId) { this.PlantId = PlantId; } - public void setAge(int age) { + public void setAge(int Age) { this.Age = Age; } public void setPlantName(String PlantName) { @@ -73,7 +73,7 @@ public void setStatus(String Status) { public void setNameOfUser(String NameOfUser) { this.NameOfUser = NameOfUser; } - public void getCaption(String Caption) { + public void setCaption(String Caption) { this.Caption = Caption; } public void setPhotoUrl(String PhotoUrl) { diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html index b598fea..e8ee6d0 100644 --- a/src/main/resources/templates/uploadSuccess.html +++ b/src/main/resources/templates/uploadSuccess.html @@ -9,7 +9,7 @@

Upload Succeeded!

- Photo URL:
+ Photo:
Age:
User Name:
Plant Name:
From 6121358a6be7d38acd34aaa4ce38c2eb6fb45e83 Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Wed, 11 Jan 2023 07:16:33 -0800 Subject: [PATCH 30/85] Stylized feed page (nav bar) --- src/main/resources/templates/feed.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html index 806164c..f68b7dd 100644 --- a/src/main/resources/templates/feed.html +++ b/src/main/resources/templates/feed.html @@ -1,5 +1,6 @@ - + + PlantBook: Main Feed @@ -105,9 +106,10 @@

Say hi to some plants!

planty
-

Post 1

- planty -

Forgot to water him for 3 months :/

+
+

+ +

Post 2

Post 3

From fd7837a313d3f81ec46959ea461d634b98470178 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 11 Jan 2023 07:22:04 -0800 Subject: [PATCH 31/85] added other method headers --- src/main/java/service/SqlDB.java | 43 ++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index bebc8e6..c07acc4 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -37,10 +37,8 @@ public void uploadPost(Post post) { // creating the query String query1 = "INSERT INTO Post ([PostID], [PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; - System.out.println(query1); String value = getValues(post); query1 += " VALUES (" + value + ")"; - System.out.println(query1); // adding the post to the table Statement st = connect.createStatement(); @@ -52,10 +50,51 @@ public void uploadPost(Post post) { } public ArrayList viewPosts() { + Connection connect = null; + ArrayList posts = new ArrayList<>(); + + try { + connect = DriverManager.getConnection(connectionUrl); + + } catch (Exception e) { + System.err.println("Got an error in tags query! "); + System.err.println(e.getMessage()); + } + return posts; } + public void deletePosts(Post post) { + Connection connect = null; + try { + connect = DriverManager.getConnection(connectionUrl); + + // creating the query + String query1 = "DELETE FROM Post WHERE PostID=" + post.getPostID() + + ", PlantID=" + post.getPlantID() + ", Age=" + post.getAge() + + ", PlantName=" + post.getPlantName() + " Species, Status, NameOfUser, Caption, PhotoURL"; + + // deleting the post to the table + Statement st = connect.createStatement(); + st.execute(query1, Statement.RETURN_GENERATED_KEYS); + } catch (Exception e) { + System.err.println("Got an error in tags query! "); + System.err.println(e.getMessage()); + } + } + + public void updatePosts() { + Connection connect = null; + try { + connect = DriverManager.getConnection(connectionUrl); + + } catch (Exception e) { + System.err.println("Got an error in tags query! "); + System.err.println(e.getMessage()); + } + } + private String getValues(Post post) { ArrayList temp = new ArrayList<>(); temp.add(Integer.toString(post.getPostID())); From 3fe95b2aac93200f8071eff2daefad1705565461 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 11 Jan 2023 18:58:27 -0800 Subject: [PATCH 32/85] in azure works ;) but in here tho but did some changes --- src/main/java/service/MainController.java | 2 +- src/main/java/service/Post.java | 2 +- src/main/java/service/SqlDB.java | 23 ++++++++++++----------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 7ab3c03..c4a9326 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -26,7 +26,7 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor @GetMapping("/upload") // change to post later public String uploadPost() { // Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) - Post test = new Post(600, 16, "Penguins", "Left", "Dead", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); + Post test = new Post(459, 987, "hi", "ahhhh", "jgyhtg", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); sqlDB.uploadPost(test); return "index"; diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 4d7c949..31ef620 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -17,7 +17,7 @@ public Post(int PostId, int PlantId, int Age, String PlantName, String Species, } public Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { - PostId = 0; + PostId = 0; // "created" when post is added to the database this.PlantId = PlantId; this.Age = Age; this.PlantName = PlantName; diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index c07acc4..b89bfdb 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -25,7 +25,6 @@ public SqlDB(Environment env) { + "hostNameInCertificate=*.database.windows.net;loginTimeout=30;", hostName, dbName, user, password); } - // TODO: Add methods to talk to your DB here /* * Take created post information and add it into the database * @param line - @@ -36,13 +35,16 @@ public void uploadPost(Post post) { connect = DriverManager.getConnection(connectionUrl); // creating the query - String query1 = "INSERT INTO Post ([PostID], [PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; + String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; String value = getValues(post); - query1 += " VALUES (" + value + ")"; + query1 += "VALUES (" + value + ");"; // adding the post to the table Statement st = connect.createStatement(); st.execute(query1, Statement.RETURN_GENERATED_KEYS); + + //TODO: get PostID and assigned it + } catch (Exception e) { System.err.println("Got an error in tags query! "); System.err.println(e.getMessage()); @@ -84,7 +86,7 @@ public void deletePosts(Post post) { } } - public void updatePosts() { + public void updatePosts() { Connection connect = null; try { connect = DriverManager.getConnection(connectionUrl); @@ -97,15 +99,14 @@ public void updatePosts() { private String getValues(Post post) { ArrayList temp = new ArrayList<>(); - temp.add(Integer.toString(post.getPostID())); temp.add(Integer.toString(post.getPlantID())); temp.add(Integer.toString(post.getAge())); - temp.add("N'" + post.getPlantName() + "'"); - temp.add("N'" + post.getSpecies() + "'"); - temp.add("N'" + post.getStatus() + "'"); - temp.add("N'" + post.getNameOfUser() + "'"); - temp.add("N'" + post.getCaption() + "'"); - temp.add("N'" + post.getPhotoUrl() + "'"); + temp.add(post.getPlantName() + "'"); + temp.add(post.getSpecies() + "'"); + temp.add(post.getStatus() + "'"); + temp.add(post.getNameOfUser() + "'"); + temp.add(post.getCaption() + "'"); + temp.add(post.getPhotoUrl() + "'"); String result = ""; for (int i = 0; i < temp.size(); i++) { From f2f544e717db30826235dd7a649fe5625c8ba2ef Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 23 Jan 2023 07:49:29 -0800 Subject: [PATCH 33/85] making it look pretty D: --- src/main/resources/templates/uploadPage.html | 23 ++++++++++--------- .../resources/templates/uploadSuccess.html | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index 1ed9425..168e169 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -3,46 +3,46 @@ PlantBook - - - +

PlantBook

- +

- +

- +

- - +
+

- +

- - +
+ + *400 character limit

@@ -59,5 +59,6 @@

PlantBook

+
\ No newline at end of file diff --git a/src/main/resources/templates/uploadSuccess.html b/src/main/resources/templates/uploadSuccess.html index e8ee6d0..df5c556 100644 --- a/src/main/resources/templates/uploadSuccess.html +++ b/src/main/resources/templates/uploadSuccess.html @@ -9,7 +9,7 @@

Upload Succeeded!

- Photo:
+ Photo:
Age:
User Name:
Plant Name:
From e3459fc6bf042a923687017421f2724bf614dd06 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 25 Jan 2023 07:18:57 -0800 Subject: [PATCH 34/85] ahhh --- src/main/java/service/SqlDB.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index b89bfdb..be9f8af 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -32,12 +32,15 @@ public SqlDB(Environment env) { public void uploadPost(Post post) { Connection connect = null; try { + System.out.println(connectionUrl); + System.out.println("HN1: " + hostName); connect = DriverManager.getConnection(connectionUrl); // creating the query - String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; - String value = getValues(post); - query1 += "VALUES (" + value + ");"; + String query1 = "INSERT INTO Post ([PostID], [PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; + System.out.println("Current Query:\n" + query1); + query1 += " VALUES (" + getValues(post) + ");"; + System.out.println("Current Query:\n" + query1); // adding the post to the table Statement st = connect.createStatement(); From 6f8247bd3bfce85bc46811478b384d24b007b3a3 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 25 Jan 2023 07:43:59 -0800 Subject: [PATCH 35/85] it works <333 --- src/main/java/service/SqlDB.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index be9f8af..6b393dc 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -32,15 +32,11 @@ public SqlDB(Environment env) { public void uploadPost(Post post) { Connection connect = null; try { - System.out.println(connectionUrl); - System.out.println("HN1: " + hostName); connect = DriverManager.getConnection(connectionUrl); // creating the query String query1 = "INSERT INTO Post ([PostID], [PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; - System.out.println("Current Query:\n" + query1); query1 += " VALUES (" + getValues(post) + ");"; - System.out.println("Current Query:\n" + query1); // adding the post to the table Statement st = connect.createStatement(); @@ -104,12 +100,12 @@ private String getValues(Post post) { ArrayList temp = new ArrayList<>(); temp.add(Integer.toString(post.getPlantID())); temp.add(Integer.toString(post.getAge())); - temp.add(post.getPlantName() + "'"); - temp.add(post.getSpecies() + "'"); - temp.add(post.getStatus() + "'"); - temp.add(post.getNameOfUser() + "'"); - temp.add(post.getCaption() + "'"); - temp.add(post.getPhotoUrl() + "'"); + temp.add("N'" + post.getPlantName() + "'"); + temp.add("N'" + post.getSpecies() + "'"); + temp.add("N'" + post.getStatus() + "'"); + temp.add("N'" + post.getNameOfUser() + "'"); + temp.add("N'" + post.getCaption() + "'"); + temp.add("N'" + post.getPhotoUrl() + "'"); String result = ""; for (int i = 0; i < temp.size(); i++) { From 18adfa8934d879b69a65d54b172718b253f0a91d Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 25 Jan 2023 07:47:45 -0800 Subject: [PATCH 36/85] looking less ghetto! --- src/main/resources/templates/uploadPage.html | 25 +++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index 168e169..4a92f66 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -3,7 +3,20 @@ PlantBook - + @@ -11,7 +24,7 @@ -
+

PlantBook

@@ -21,17 +34,17 @@

PlantBook



- +


- +


- +

@@ -42,7 +55,7 @@

PlantBook


- *400 character limit +
*200 character limit

From aabb5d9bbf003a9609723e610c5b79b60185c3cb Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 25 Jan 2023 07:53:56 -0800 Subject: [PATCH 37/85] :)) --- src/main/java/service/MainController.java | 3 ++- src/main/java/service/Post.java | 18 +++++++++--------- src/main/java/service/SqlDB.java | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index c4a9326..b34e470 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -26,8 +26,9 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor @GetMapping("/upload") // change to post later public String uploadPost() { // Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) - Post test = new Post(459, 987, "hi", "ahhhh", "jgyhtg", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); + Post test = new Post(459, 987, "hi", "kjhgfd", "jgyhtg", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); + sqlDB.uploadPost(test); return "index"; } diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 31ef620..b28762e 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -58,31 +58,31 @@ public String getPhotoUrl() { } // all the set methods - public void getPostID(int PostId) { + public void setPostID(int PostId) { this.PostId = PostId; } - public void getPlantID(int PlantId) { + public void setPlantID(int PlantId) { this.PlantId = PlantId; } - public void getAge(int age) { + public void setAge(int age) { this.Age = Age; } - public void getPlantName(String PlantName) { + public void setPlantName(String PlantName) { this.PlantName = PlantName; } - public void getSpecies(String Species) { + public void setSpecies(String Species) { this.Species = Species; } - public void getStatus(String Status) { + public void setStatus(String Status) { this.Status = Status; } - public void getNameOfUser(String NameOfUser) { + public void setNameOfUser(String NameOfUser) { this.NameOfUser = NameOfUser; } - public void getCaption(String Caption) { + public void setCaption(String Caption) { this.Caption = Caption; } - public void getPhotoUrl(String PhotoUrl) { + public void setPhotoUrl(String PhotoUrl) { this.PhotoUrl = PhotoUrl; } } \ No newline at end of file diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index 6b393dc..78aacc2 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -35,12 +35,12 @@ public void uploadPost(Post post) { connect = DriverManager.getConnection(connectionUrl); // creating the query - String query1 = "INSERT INTO Post ([PostID], [PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; + String query1 = "INSERT INTO Post ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; query1 += " VALUES (" + getValues(post) + ");"; // adding the post to the table Statement st = connect.createStatement(); - st.execute(query1, Statement.RETURN_GENERATED_KEYS); + st.execute(query1, Statement.RETURN_GENERATED_KEYS); // check what this returns //TODO: get PostID and assigned it From 1ad408d7aa261b32b8b4c3c54bf480a70199d404 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 25 Jan 2023 08:00:06 -0800 Subject: [PATCH 38/85] naming of methods in Post --- src/main/java/service/Post.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 7e3d5af..7d2e792 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -42,31 +42,31 @@ public String getPhotoUrl() { return PhotoUrl; } // all the set methods - public void getPostID(int PostId) { + public void setPostID(int PostId) { this.PostId = PostId; } - public void getPlantID(int PlantId) { + public void setPlantID(int PlantId) { this.PlantId = PlantId; } - public void getAge(int age) { + public void setAge(int age) { this.Age = Age; } - public void getPlantName(String PlantName) { + public void setPlantName(String PlantName) { this.PlantName = PlantName; } - public void getSpecies(String Species) { + public void setSpecies(String Species) { this.Species = Species; } - public void getStatus(String Status) { + public void setStatus(String Status) { this.Status = Status; } - public void getNameOfUser(String NameOfUser) { + public void setNameOfUser(String NameOfUser) { this.NameOfUser = NameOfUser; } - public void getCaption(String Caption) { + public void setCaption(String Caption) { this.Caption = Caption; } - public void getPhotoUrl(String PhotoUrl) { + public void setPhotoUrl(String PhotoUrl) { this.PhotoUrl = PhotoUrl; } } From 2260da0b321e44adb45c9659b9708ad887b3ab87 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 25 Jan 2023 08:03:14 -0800 Subject: [PATCH 39/85] null postid --- src/main/java/service/Post.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index b28762e..1813b01 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -1,7 +1,8 @@ package service; public class Post { - private int PostId, PlantId, Age; + private Integer PostId; + private int PlantId, Age; private String PlantName, Species, Status, NameOfUser, Caption, PhotoUrl; public Post(int PostId, int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { @@ -17,7 +18,7 @@ public Post(int PostId, int PlantId, int Age, String PlantName, String Species, } public Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { - PostId = 0; // "created" when post is added to the database + PostId = null; // "created" when post is added to the database this.PlantId = PlantId; this.Age = Age; this.PlantName = PlantName; From f02da00e429e626dde8cfcc810224c650c4fe5c2 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 25 Jan 2023 08:04:17 -0800 Subject: [PATCH 40/85] new constructor & changing variable --- src/main/java/service/Post.java | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 7d2e792..1813b01 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -1,7 +1,10 @@ package service; + public class Post { - private int PostId, PlantId, Age; + private Integer PostId; + private int PlantId, Age; private String PlantName, Species, Status, NameOfUser, Caption, PhotoUrl; + public Post(int PostId, int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { this.PostId = PostId; this.PlantId = PlantId; @@ -13,6 +16,19 @@ public Post(int PostId, int PlantId, int Age, String PlantName, String Species, this.Caption = Caption; this.PhotoUrl = PhotoUrl; } + + public Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) { + PostId = null; // "created" when post is added to the database + this.PlantId = PlantId; + this.Age = Age; + this.PlantName = PlantName; + this.Species = Species; + this.Status = Status; + this.NameOfUser = NameOfUser; + this.Caption = Caption; + this.PhotoUrl = PhotoUrl; + } + // all the get methods public int getPostID() { return PostId; @@ -41,6 +57,7 @@ public String getCaption() { public String getPhotoUrl() { return PhotoUrl; } + // all the set methods public void setPostID(int PostId) { this.PostId = PostId; @@ -69,6 +86,4 @@ public void setCaption(String Caption) { public void setPhotoUrl(String PhotoUrl) { this.PhotoUrl = PhotoUrl; } -} - - +} \ No newline at end of file From 34486ae324d38ed9215ace0ac1e33688066f0a42 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 25 Jan 2023 20:39:25 -0800 Subject: [PATCH 41/85] :) --- src/main/java/service/SqlDB.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index 78aacc2..cc26c35 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -40,7 +40,7 @@ public void uploadPost(Post post) { // adding the post to the table Statement st = connect.createStatement(); - st.execute(query1, Statement.RETURN_GENERATED_KEYS); // check what this returns + st.execute(query1, Statement.RETURN_GENERATED_KEYS); // check what this returns (returns a boolean) //TODO: get PostID and assigned it From b7e151637c107d132e8f627ffac67419a621ff19 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 30 Jan 2023 07:14:10 -0800 Subject: [PATCH 42/85] upload page --- src/main/resources/templates/uploadPage.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index 4a92f66..cac501c 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -5,12 +5,10 @@ - // -//< style="height:1500px"> + + From 4edd1f86d9a6a5ec2439954786863fceff053120 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Mon, 27 Feb 2023 07:17:06 -0800 Subject: [PATCH 65/85] Update MainController.java --- src/main/java/service/MainController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index f8f1ff5..2f3328f 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -64,7 +64,7 @@ public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ public respHttpResponse getResponse() {return response;} */ - /* + @GetMapping("/feed") public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); @@ -76,9 +76,9 @@ public String feed(@RequestParam(name="Clarence", required=false, defaultValue=" posts.add(plant2); model.addAttribute("posts", posts); return "/feed"; - } */ - + } + /* @GetMapping("/feed") // Elizabeth's testing for viewPost (not working) public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); @@ -95,7 +95,7 @@ public String feed(@RequestParam(name="Clarence", required=false, defaultValue=" return "/feed"; } - @GetMapping("/test") + @GetMapping("/test") // this successful prints the wanted array public String test(Model m) { TreeMap post = sqlDB.viewPosts(); @@ -110,5 +110,5 @@ public String test(Model m) { System.out.println(p); } return "index"; - } + } */ } \ No newline at end of file From ad57580d61ccba1790d927868d12768f37e1d53d Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Mon, 30 Jan 2023 07:52:09 -0800 Subject: [PATCH 66/85] Stylized feed page (nav bar) --- src/main/java/service/MainController.java | 15 ++- src/main/resources/templates/feed.html | 123 ++++++++++++++++++++++ 2 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/templates/feed.html diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index f6fb0cd..0634cbc 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -7,6 +7,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.ArrayList; + @Controller public class MainController { @Autowired @@ -35,13 +37,22 @@ public String hello(@RequestParam(name="name", required=false, defaultValue="Wor HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); public respHttpResponse getResponse() {return response;} */ - + @GetMapping("/upload") // change to post later public String uploadPost() { // Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) Post test = new Post(459, 987, "hi", "kjhgfd", "jgyhtg", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); - + @GetMapping("/feed") + public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ + model.addAttribute("Clarence", name); + Post plant = new Post(01, 01, 00, "plantbert", "green", "not green", "Alana", "pretty dead", "dfdhsjkf"); + ArrayList posts = new ArrayList<>(); + posts.add(plant); + model.addAttribute(posts); + return "/feed"; + } + sqlDB.uploadPost(test); return "index"; } diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html new file mode 100644 index 0000000..28f4de7 --- /dev/null +++ b/src/main/resources/templates/feed.html @@ -0,0 +1,123 @@ + + + + + + PlantBook: Main Feed + + Bootstrap Example + + + + + + + // +//< style="height:1500px"> + + + + + +

Say hi to some plants!

+ +planty +
+ +
+

Plant Name

+ +

Caption

+
+ +

Post 2

+

Post 3

+

Post 4

+ planty
+

Post 5

+
+ + \ No newline at end of file From b250b1b293e7a07a9b1f1739ab455bd8b7a90d2a Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Mon, 27 Feb 2023 07:28:43 -0800 Subject: [PATCH 67/85] added a new view method (search by username) --- src/main/java/service/SqlDB.java | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index 13bd7f7..beecb2a 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -52,7 +52,7 @@ public void uploadPost(Post post) { * Retrieve all the posts from the database * @return - returns a TreeMap (key = postID, value = post) */ - public TreeMap viewPosts() { + public TreeMap viewAllPosts() { Connection connect = null; TreeMap posts = new TreeMap<>(); @@ -79,6 +79,35 @@ public TreeMap viewPosts() { return posts; } + public TreeMap viewAllPostsBy(String NameOfUser) { + Connection connect = null; + + TreeMap posts = new TreeMap<>(); + + try { + connect = DriverManager.getConnection(connectionUrl); + Statement st = connect.createStatement(); + ResultSet rs = st.executeQuery("Select * from Post"); + + while (rs.next()) { + Integer postID = rs.getInt("PostID"); + Post post = new Post(postID, rs.getInt("PlantID"), + rs.getInt("Age"), rs.getString("PlantName"), + rs.getString("Species"), rs.getString("Status"), + rs.getString("NameOfUser"), rs.getString("Caption"), + rs.getString("PhotoURL")); + + if (post.getNameOfUser().equals(NameOfUser)) { + posts.put(postID, post); + } + } + } catch (Exception e) { + System.err.println("Got an error in tags query! "); + System.err.println(e.getMessage()); + } + return posts; + } + /* * Find the row with matching postID and delete it from the database * @param line - takes an int for postID From dd5c0aa23740e495fb4aac94c12e1e01591bbad7 Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Mon, 13 Feb 2023 07:27:46 -0800 Subject: [PATCH 68/85] java type --- build.gradle | 2 +- src/main/java/service/MainController.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 1a634c4..e826f18 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { group = 'com.example' version = '0.0.1-SNAPSHOT' -sourceCompatibility = '1.8' +sourceCompatibility = '1.11' configurations { developmentOnly diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 0634cbc..c8fb7a1 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -46,7 +46,9 @@ public String uploadPost() { @GetMapping("/feed") public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); - Post plant = new Post(01, 01, 00, "plantbert", "green", "not green", "Alana", "pretty dead", "dfdhsjkf"); + Post plant1 = new Post(01, 01, 00, "plantbert", "green", "not green", "Alana", "pretty dead", "https://asset.bloomnation.com/c_pad,d_vendor:global:catalog:product:image.png,f_auto,fl_preserve_transparency,q_auto/v1627197230/vendor/2864/catalog/product/2/0/20200304122155_file_5e5ef4a3ccb60_5e5ef7b7cd5fa_600b664eac11a._600b6650be20c..jpg"); + Post plant2 = new Post(02, 02, 00, "Belle-adona", "~~blue belle*&^$#@", "livin' life to the fullest", "Alana", "IM BLUE`*%@^!", "https://www.woodlandtrust.org.uk/media/4272/bluebells-close-up-wtml-1024791-web-upload.jpg"); + ArrayList posts = new ArrayList<>(); posts.add(plant); model.addAttribute(posts); From 360c374ef2bd463d76de37ffb62a2686ae75eb92 Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Mon, 13 Feb 2023 07:51:00 -0800 Subject: [PATCH 69/85] setting up for loop to auto-add posts from database --- src/main/java/service/MainController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index c8fb7a1..5232be9 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -43,6 +43,11 @@ public String uploadPost() { // Post(int PlantId, int Age, String PlantName, String Species, String Status, String NameOfUser, String Caption, String PhotoUrl) Post test = new Post(459, 987, "hi", "kjhgfd", "jgyhtg", "Sophia", "Penguins!", "https://flowermag.com/wp-content/uploads/2018/02/shasta-daisies-becky-1000x669.jpg"); + + sqlDB.uploadPost(test); + return "index"; + } + @GetMapping("/feed") public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); From 3d1aacc22865a960e6d14dad1748e14e704f8d29 Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Wed, 15 Feb 2023 07:48:50 -0800 Subject: [PATCH 70/85] ready for database upload button redirects --- .idea/runConfigurations/bootRun.xml | 5 ++++- src/main/java/service/MainController.java | 6 ++++++ src/main/resources/templates/feed.html | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.idea/runConfigurations/bootRun.xml b/.idea/runConfigurations/bootRun.xml index 098f6be..96a8654 100644 --- a/.idea/runConfigurations/bootRun.xml +++ b/.idea/runConfigurations/bootRun.xml @@ -3,7 +3,10 @@
From f640313e401aada04f6fe97367af80797f758c39 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Mon, 27 Feb 2023 07:32:04 -0800 Subject: [PATCH 71/85] comment? --- src/main/java/service/SqlDB.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index beecb2a..f14ba92 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -79,6 +79,11 @@ public TreeMap viewAllPosts() { return posts; } + /* + * Retrieve all the posts from the database by a certain user + * @param line - takes the name of user that you would like to see all post by that user + * @return - returns a TreeMap (key = postID, value = post) + */ public TreeMap viewAllPostsBy(String NameOfUser) { Connection connect = null; From 576e59c5b9890ed0f7acc127b4b6bf87c7a98844 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 1 Mar 2023 11:18:55 -0800 Subject: [PATCH 72/85] Update SqlDB.java --- src/main/java/service/SqlDB.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index f14ba92..3c7a350 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -122,9 +122,21 @@ public void deletePosts(int postID) { try { connect = DriverManager.getConnection(connectionUrl); - String query1 = "DELETE FROM Post WHERE PostID=" + postID; + String query1 = "DELETE FROM DeletedPost WHERE PostID=" + postID; Statement st = connect.createStatement(); + ResultSet rs = st.executeQuery(query1); + + Post post = new Post(rs.getInt("PostID"), rs.getInt("PlantID"), + rs.getInt("Age"), rs.getString("PlantName"), + rs.getString("Species"), rs.getString("Status"), + rs.getString("NameOfUser"), rs.getString("Caption"), + rs.getString("PhotoURL")); + + // creating the query + String query2 = "INSERT INTO DeletedPost ([PlantID], [Age], [PlantName], [Species], [Status], [NameOfUser], [Caption], [PhotoURL])"; + query1 += " VALUES (" + getValues(post) + ");"; + st.execute(query1, Statement.RETURN_GENERATED_KEYS); } catch (Exception e) { System.err.println("Got an error in tags query! "); From 009113291e35f73e2734173612e25358e6b7eb81 Mon Sep 17 00:00:00 2001 From: alanaaaa Date: Wed, 8 Mar 2023 07:50:47 -0800 Subject: [PATCH 73/85] fixed errors and got access to feed page --- src/main/java/service/MainController.java | 31 ++++++++++++++++------- src/main/resources/templates/feed.html | 2 +- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 8d637d1..99c949d 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -64,7 +64,7 @@ public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ public respHttpResponse getResponse() {return response;} */ - +/* @GetMapping("/feed") public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); @@ -72,30 +72,43 @@ public String feed(@RequestParam(name="Clarence", required=false, defaultValue=" Post plant2 = new Post(02, 02, 00, "Belle-adona", "~~blue belle*&^$#@", "livin' life to the fullest", "Alana", "IM BLUE`*%@^!", "https://www.woodlandtrust.org.uk/media/4272/bluebells-close-up-wtml-1024791-web-upload.jpg"); ArrayList posts = new ArrayList<>(); - posts.add(plant); + posts.add(plant1); + posts.add(plant2); model.addAttribute(posts); + ArrayList posts = new ArrayList(); - posts = sqlDB.viewPosts(); + //posts = sqlDB.viewPosts(); posts.add(plant1); posts.add(plant2); model.addAttribute("posts", posts); - return "/feed"; + + //return "/feed"; } + */ + - /* @GetMapping("/feed") // Elizabeth's testing for viewPost (not working) public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); - TreeMap post = sqlDB.viewPosts(); + + Post plant1 = new Post(01, 01, 00, "plantbert", "green", "not green", "Alana", "pretty dead", "https://asset.bloomnation.com/c_pad,d_vendor:global:catalog:product:image.png,f_auto,fl_preserve_transparency,q_auto/v1627197230/vendor/2864/catalog/product/2/0/20200304122155_file_5e5ef4a3ccb60_5e5ef7b7cd5fa_600b664eac11a._600b6650be20c..jpg"); + Post plant2 = new Post(02, 02, 00, "Belle-adona", "~~blue belle*&^$#@", "livin' life to the fullest", "Alana", "IM BLUE`*%@^!", "https://www.woodlandtrust.org.uk/media/4272/bluebells-close-up-wtml-1024791-web-upload.jpg"); ArrayList posts = new ArrayList<>(); - for (int i = 0; i < 1; i++) { + posts.add(plant1); + posts.add(plant2); + model.addAttribute(posts); + + TreeMap post = sqlDB.viewPosts(); + for (int i = 1; i < 2; i++) {// the starting postID value in the database is 1 (lowest value there) Post plant = post.get(i); posts.add(plant); - System.out.println(plant.PlantName, plant.PhotoUrl, plant.Caption); + System.out.print(plant.PlantName); + System.out.print(plant.PhotoUrl); + System.out.println(plant.Caption); } model.addAttribute("posts", posts); @@ -117,5 +130,5 @@ public String test(Model m) { System.out.println(p); } return "index"; - } */ + } } \ No newline at end of file diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html index d20cc2a..173e70a 100644 --- a/src/main/resources/templates/feed.html +++ b/src/main/resources/templates/feed.html @@ -109,7 +109,7 @@

Say hi to some plants!

Plant Name

- +

Caption

From f02905956a00e169fb64856234a11fc2ddc1c565 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 8 Mar 2023 07:55:06 -0800 Subject: [PATCH 74/85] :)) --- src/main/java/service/MainController.java | 8 ++++++++ src/main/java/service/SqlDB.java | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 2f3328f..a299a1b 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -53,6 +53,14 @@ public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ return "uploadSuccess"; } + @GetMapping ("/delete") + public String delete(Model m){ + Post post = new Post(); // needs arguments but if i keep the default then the upload success page doesn't work + sqlDB.deletePosts(6); + + return "index"; + } + /* function httpGet(Url) { var xmlHttp = new XMLHttpRequest(); diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index 3c7a350..ae758e4 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -122,10 +122,11 @@ public void deletePosts(int postID) { try { connect = DriverManager.getConnection(connectionUrl); - String query1 = "DELETE FROM DeletedPost WHERE PostID=" + postID; + String query1 = "DELETE FROM Post WHERE PostID=" + postID; Statement st = connect.createStatement(); - ResultSet rs = st.executeQuery(query1); + /* for later if we ever wanna implement a deleted table + ResultSet rs = st.execute(query1); Post post = new Post(rs.getInt("PostID"), rs.getInt("PlantID"), rs.getInt("Age"), rs.getString("PlantName"), @@ -138,6 +139,7 @@ public void deletePosts(int postID) { query1 += " VALUES (" + getValues(post) + ");"; st.execute(query1, Statement.RETURN_GENERATED_KEYS); + */ } catch (Exception e) { System.err.println("Got an error in tags query! "); System.err.println(e.getMessage()); From 36d7c47980af3bedee0121bd358b361fd90081ed Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 8 Mar 2023 07:57:40 -0800 Subject: [PATCH 75/85] removed a line --- src/main/java/service/MainController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index f25b016..cf987ca 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -55,7 +55,6 @@ public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ @GetMapping ("/delete") public String delete(Model m){ - Post post = new Post(); // needs arguments but if i keep the default then the upload success page doesn't work sqlDB.deletePosts(6); return "index"; From 1c86df790c589efae13e6ab1fc3647ec4a036b14 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 8 Mar 2023 08:11:35 -0800 Subject: [PATCH 76/85] cleaned up code :)) --- src/main/java/service/MainController.java | 48 +---------------------- src/main/java/service/SqlDB.java | 8 ++-- 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index cf987ca..17f17e5 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -71,32 +71,6 @@ public String delete(Model m){ public respHttpResponse getResponse() {return response;} */ -/* - @GetMapping("/feed") - public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ - model.addAttribute("Clarence", name); - Post plant1 = new Post(01, 01, 00, "plantbert", "green", "not green", "Alana", "pretty dead", "https://asset.bloomnation.com/c_pad,d_vendor:global:catalog:product:image.png,f_auto,fl_preserve_transparency,q_auto/v1627197230/vendor/2864/catalog/product/2/0/20200304122155_file_5e5ef4a3ccb60_5e5ef7b7cd5fa_600b664eac11a._600b6650be20c..jpg"); - Post plant2 = new Post(02, 02, 00, "Belle-adona", "~~blue belle*&^$#@", "livin' life to the fullest", "Alana", "IM BLUE`*%@^!", "https://www.woodlandtrust.org.uk/media/4272/bluebells-close-up-wtml-1024791-web-upload.jpg"); - - ArrayList posts = new ArrayList<>(); - posts.add(plant1); - posts.add(plant2); - model.addAttribute(posts); - - - ArrayList posts = new ArrayList(); - //posts = sqlDB.viewPosts(); - posts.add(plant1); - posts.add(plant2); - model.addAttribute("posts", posts); - - //return "/feed"; - } - - */ - - - @GetMapping("/feed") // Elizabeth's testing for viewPost (not working) public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); @@ -109,9 +83,8 @@ public String feed(@RequestParam(name="Clarence", required=false, defaultValue=" posts.add(plant2); model.addAttribute(posts); - TreeMap post = sqlDB.viewPosts(); - for (int i = 1; i < 2; i++) {// the starting postID value in the database is 1 (lowest value there) - Post plant = post.get(i); + TreeMap post = sqlDB.viewAllPosts(); + for (Post plant : post.values()) { // the starting index in P posts.add(plant); System.out.print(plant.PlantName); System.out.print(plant.PhotoUrl); @@ -121,21 +94,4 @@ public String feed(@RequestParam(name="Clarence", required=false, defaultValue=" model.addAttribute("posts", posts); return "/feed"; } - - @GetMapping("/test") // this successful prints the wanted array - public String test(Model m) { - TreeMap post = sqlDB.viewPosts(); - - ArrayList posts = new ArrayList<>(); - for (int i = 0; i < post.size(); i++) { - Post plant = post.get(i); - posts.add(plant); - - } - - for(Post p : posts) { - System.out.println(p); - } - return "index"; - } } \ No newline at end of file diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index ae758e4..b0d75d7 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -28,7 +28,7 @@ public SqlDB(Environment env) { /* * Take created post information and add it into the database - * @param line - takes Post object + * @param line - takes Post object that you want to add to the database */ public void uploadPost(Post post) { Connection connect = null; @@ -62,7 +62,7 @@ public TreeMap viewAllPosts() { Statement st = connect.createStatement(); ResultSet rs = st.executeQuery("Select * from Post"); - while (rs.next()) { + while (rs.next()) { // loop through the data table until no more Integer postID = rs.getInt("PostID"); Post post = new Post(postID, rs.getInt("PlantID"), rs.getInt("Age"), rs.getString("PlantName"), @@ -94,7 +94,7 @@ public TreeMap viewAllPostsBy(String NameOfUser) { Statement st = connect.createStatement(); ResultSet rs = st.executeQuery("Select * from Post"); - while (rs.next()) { + while (rs.next()) { // loop through the data table until no more Integer postID = rs.getInt("PostID"); Post post = new Post(postID, rs.getInt("PlantID"), rs.getInt("Age"), rs.getString("PlantName"), @@ -125,7 +125,7 @@ public void deletePosts(int postID) { String query1 = "DELETE FROM Post WHERE PostID=" + postID; Statement st = connect.createStatement(); - /* for later if we ever wanna implement a deleted table + /* for later if we ever want to implement a deleted table, currently giving an error ResultSet rs = st.execute(query1); Post post = new Post(rs.getInt("PostID"), rs.getInt("PlantID"), From d455fa5bd612757ec6431a6c251d263a187d86e7 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 8 Mar 2023 10:42:50 -0800 Subject: [PATCH 77/85] fixed a comment --- src/main/java/service/MainController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 17f17e5..9f62b6a 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -84,7 +84,7 @@ public String feed(@RequestParam(name="Clarence", required=false, defaultValue=" model.addAttribute(posts); TreeMap post = sqlDB.viewAllPosts(); - for (Post plant : post.values()) { // the starting index in P + for (Post plant : post.values()) { // enhanced for to loop through all the post and put into an array posts.add(plant); System.out.print(plant.PlantName); System.out.print(plant.PhotoUrl); From d3e9c777a3934881cd193a55d5fd95859df84854 Mon Sep 17 00:00:00 2001 From: AerialAstrea Date: Wed, 8 Mar 2023 10:52:23 -0800 Subject: [PATCH 78/85] code clean up --- src/main/java/service/MainController.java | 37 +++++++++-------------- src/main/java/service/Post.java | 4 +-- src/main/java/service/SqlDB.java | 2 +- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index 9f62b6a..1a13f7a 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -53,38 +53,20 @@ public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ return "uploadSuccess"; } - @GetMapping ("/delete") + @GetMapping ("/delete") // delete testing, works (just need to implement button) public String delete(Model m){ sqlDB.deletePosts(6); return "index"; } - /* function httpGet(Url) - { - var xmlHttp = new XMLHttpRequest(); - xmlHttp.open( "GET", https://house-plants.p.rapidapi.com/common/coralberry, false ); // false for synchronous request - xmlHttp.send( https://house-plants.p.rapidapi.com/common/coralberry ); - return xmlHttp.responseText; - } - HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); - public respHttpResponse getResponse() {return response;} - */ - - @GetMapping("/feed") // Elizabeth's testing for viewPost (not working) + @GetMapping("/feed") public String feed(@RequestParam(name="Clarence", required=false, defaultValue="planty") String name, Model model){ model.addAttribute("Clarence", name); - - Post plant1 = new Post(01, 01, 00, "plantbert", "green", "not green", "Alana", "pretty dead", "https://asset.bloomnation.com/c_pad,d_vendor:global:catalog:product:image.png,f_auto,fl_preserve_transparency,q_auto/v1627197230/vendor/2864/catalog/product/2/0/20200304122155_file_5e5ef4a3ccb60_5e5ef7b7cd5fa_600b664eac11a._600b6650be20c..jpg"); - Post plant2 = new Post(02, 02, 00, "Belle-adona", "~~blue belle*&^$#@", "livin' life to the fullest", "Alana", "IM BLUE`*%@^!", "https://www.woodlandtrust.org.uk/media/4272/bluebells-close-up-wtml-1024791-web-upload.jpg"); - ArrayList posts = new ArrayList<>(); - posts.add(plant1); - posts.add(plant2); - model.addAttribute(posts); - TreeMap post = sqlDB.viewAllPosts(); - for (Post plant : post.values()) { // enhanced for to loop through all the post and put into an array + TreeMap data = sqlDB.viewAllPosts(); + for (Post plant : data.values()) { // enhanced for to loop through all the post and put into an array posts.add(plant); System.out.print(plant.PlantName); System.out.print(plant.PhotoUrl); @@ -94,4 +76,15 @@ public String feed(@RequestParam(name="Clarence", required=false, defaultValue=" model.addAttribute("posts", posts); return "/feed"; } + + /* function httpGet(Url) + { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open( "GET", https://house-plants.p.rapidapi.com/common/coralberry, false ); // false for synchronous request + xmlHttp.send( https://house-plants.p.rapidapi.com/common/coralberry ); + return xmlHttp.responseText; + } + HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); + public respHttpResponse getResponse() {return response;} + */ } \ No newline at end of file diff --git a/src/main/java/service/Post.java b/src/main/java/service/Post.java index 60bcc3b..e5b0397 100644 --- a/src/main/java/service/Post.java +++ b/src/main/java/service/Post.java @@ -41,7 +41,7 @@ public Post(int PlantId, int Age, String PlantName, String Species, String Statu this.PhotoUrl = PhotoUrl; } - // all the get methods + // all the getter methods public int getPostID() { return PostId; } @@ -70,7 +70,7 @@ public String getPhotoUrl() { return PhotoUrl; } - // all the set methods + // all the setter methods public void setPostID(int PostId) { this.PostId = PostId; } diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index b0d75d7..e661b27 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -56,7 +56,7 @@ public TreeMap viewAllPosts() { Connection connect = null; TreeMap posts = new TreeMap<>(); - + try { connect = DriverManager.getConnection(connectionUrl); Statement st = connect.createStatement(); From 15f25eab3a9dafc0ba4b821a5a02cc29ca3b0f74 Mon Sep 17 00:00:00 2001 From: blossoo <106000067+blossoo@users.noreply.github.com> Date: Wed, 15 Mar 2023 07:30:01 -0700 Subject: [PATCH 79/85] delete post button wip --- src/main/resources/templates/feed.html | 1 + src/main/resources/templates/uploadPage.html | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html index 173e70a..5915d81 100644 --- a/src/main/resources/templates/feed.html +++ b/src/main/resources/templates/feed.html @@ -118,6 +118,7 @@

Caption

Post 4

planty

Post 5

+
\ No newline at end of file diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index cac501c..752f2e0 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -69,6 +69,13 @@

PlantBook

+ // delete post button WIP +
From 9e6286895f55d7324c50a16a5dd217d3dc534eee Mon Sep 17 00:00:00 2001 From: blossoo <106000067+blossoo@users.noreply.github.com> Date: Wed, 15 Mar 2023 07:48:45 -0700 Subject: [PATCH 80/85] delete red p2{ color: red; --- src/main/resources/templates/uploadPage.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index 752f2e0..f8422e7 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -12,8 +12,7 @@ border: 5px solid DarkOliveGreen; box-sizing: border-box; } - p2{ - color: red;} + From f7f4e28e6bf55e7707ca0204165a6426b588b85e Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 15 Mar 2023 07:49:29 -0700 Subject: [PATCH 81/85] blob store for images --- .idea/runConfigurations/bootRun.xml | 10 +++++++++- build.gradle | 3 +++ src/main/java/service/MainController.java | 15 ++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.idea/runConfigurations/bootRun.xml b/.idea/runConfigurations/bootRun.xml index e92b210..4eec1e6 100644 --- a/.idea/runConfigurations/bootRun.xml +++ b/.idea/runConfigurations/bootRun.xml @@ -1,6 +1,12 @@ + - true + true + true + false \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1a634c4..3f6f8ad 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,9 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'com.microsoft.sqlserver:mssql-jdbc' + implementation 'com.azure:azure-sdk-bom:1.2.9' + implementation 'com.azure:azure-storage-blob:12.7.0' + implementation group: 'com.microsoft.azure', name: 'azure-storage', version: '8.0.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' diff --git a/src/main/java/service/MainController.java b/src/main/java/service/MainController.java index d57fcaf..5679d82 100644 --- a/src/main/java/service/MainController.java +++ b/src/main/java/service/MainController.java @@ -7,7 +7,9 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -37,7 +39,7 @@ public String uploadPage(Model m){ return "uploadPage"; } @PostMapping("/uploadPage") - public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ + public String submitUploadPage(@ModelAttribute("post") Post post, Model m, @RequestParam MultipartFile f ){ m.addAttribute("Age", post.getAge()); m.addAttribute("PlantName", post.getPlantName()); m.addAttribute("Species", post.getSpecies()); @@ -45,6 +47,17 @@ public String submitUploadPage(@ModelAttribute("post") Post post, Model m){ m.addAttribute("Caption", post.getCaption()); m.addAttribute("PhotoUrl", post.getPhotoUrl()); System.out.print(post); + BlobServiceClient b = new BlobServiceClient(); + String url; + try{ + url = b.BlobServiceClient(f); + }catch(IOException e){ + e.printStackTrace(); + url = "didnt work"; + } + post.setPhotoUrl(url); + return "uploadSuccess"; + } } From 77a959514c9028d4537a528b00f142d07ad5a94c Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Wed, 15 Mar 2023 07:51:31 -0700 Subject: [PATCH 82/85] blob store for images --- src/main/java/service/BlobServiceClient.java | 39 ++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/java/service/BlobServiceClient.java diff --git a/src/main/java/service/BlobServiceClient.java b/src/main/java/service/BlobServiceClient.java new file mode 100644 index 0000000..1e39ac5 --- /dev/null +++ b/src/main/java/service/BlobServiceClient.java @@ -0,0 +1,39 @@ +package service; + +import java.io.*; +import java.util.Map; +import java.util.stream.Stream; +import com.azure.core.util.Configuration; +import com.azure.storage.blob.BlobClient; +import com.azure.storage.blob.BlobContainerClient; +import com.azure.storage.blob.BlobContainerClientBuilder; +import com.microsoft.azure.storage.CloudStorageAccount; +import com.microsoft.azure.storage.*; +import com.microsoft.azure.storage.blob.*; + +import org.springframework.web.multipart.MultipartFile; + +public class BlobServiceClient { + public String BlobServiceClient (MultipartFile f) throws IOException{ + try { + String constr = System.getenv("StorageExplorerConnectionString"); + CloudStorageAccount storageAccount = CloudStorageAccount.parse(constr); + + CloudBlobClient blobClient = storageAccount.createCloudBlobClient(); + + CloudBlobContainer container = blobClient.getContainerReference("plantbook"); + + CloudBlockBlob blob = container.getBlockBlobReference(f.getOriginalFilename()); + + blob.upload(new BufferedInputStream(f.getInputStream()), f.getInputStream().available()); + System.out.println("ok"); + + return blob.getUri().toString(); + } + catch (Exception e){ + System.err.println("error"); + System.err.println(e.getMessage()); + } + return "ok"; + } +} \ No newline at end of file From 91dc8ca6daae673ffd415f5d1712e9b0ca58991c Mon Sep 17 00:00:00 2001 From: blossoo <106000067+blossoo@users.noreply.github.com> Date: Mon, 20 Mar 2023 07:21:12 -0700 Subject: [PATCH 83/85] Update uploadPage.html --- src/main/resources/templates/uploadPage.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/uploadPage.html b/src/main/resources/templates/uploadPage.html index f8422e7..aadd18b 100644 --- a/src/main/resources/templates/uploadPage.html +++ b/src/main/resources/templates/uploadPage.html @@ -68,7 +68,7 @@

PlantBook

- // delete post button WIP + // delete post button WIP temp loco until feed is more organized
From 7b79fc9794e349202dead02d42d0a5c20b217dc3 Mon Sep 17 00:00:00 2001 From: KermitHermit121 <112117889+ljackson23@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:50:12 -0700 Subject: [PATCH 85/85] set environment variables for database --- src/main/java/service/SqlDB.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/service/SqlDB.java b/src/main/java/service/SqlDB.java index e661b27..3f8b95e 100644 --- a/src/main/java/service/SqlDB.java +++ b/src/main/java/service/SqlDB.java @@ -32,6 +32,7 @@ public SqlDB(Environment env) { */ public void uploadPost(Post post) { Connection connect = null; + System.out.print(connectionUrl); try { connect = DriverManager.getConnection(connectionUrl);