diff --git a/.gitignore b/.gitignore index 66d4db2..f484b5d 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,7 @@ /Semester 2/QuizBusLogic/target/ /Semester 2/lab04_nav1_CalebFontenot/target/ /Semester 2/RecursionDemo/target/ +/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/target/ +/Semester 2/lab5_EL1_F23_CalebFontenot/target/ +/Semester 2/labEL2_CalebFontenot/target/ +/Semester 2/MP2-chapter4_Java20_CalebFontenot/nbproject/private/ diff --git a/Semester 2/MP1_CalebFontenot/nb-configuration.xml b/Semester 2/MP1_CalebFontenot/nb-configuration.xml new file mode 100644 index 0000000..5e1a2de --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/nb-configuration.xml @@ -0,0 +1,20 @@ + + + + + + 10-web + gfv700ee10 + Facelets + + diff --git a/Semester 2/MP1_CalebFontenot/pom.xml b/Semester 2/MP1_CalebFontenot/pom.xml new file mode 100644 index 0000000..dfad21f --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + edu.slcc.asdv.caleb + MP1_CalebFontenot + 1.0-SNAPSHOT + war + MP1_CalebFontenot-1.0-SNAPSHOT + + + 11 + 11 + ${project.build.directory}/endorsed + UTF-8 + false + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + jar + + + + + + + + + \ No newline at end of file diff --git a/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Navigation.java b/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Navigation.java new file mode 100644 index 0000000..c481909 --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Navigation.java @@ -0,0 +1,23 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.Dependent; + +/** + * + * @author caleb + */ +@Named(value="navigation") +@Dependent +public class Navigation { + + /** Creates a new instance of Navigation */ + public Navigation() { + } + +} diff --git a/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_calebfontenot/JakartaRestConfiguration.java b/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_calebfontenot/JakartaRestConfiguration.java new file mode 100644 index 0000000..e98dc05 --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_calebfontenot/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package edu.slcc.asdv.caleb.mp1_calebfontenot; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_calebfontenot/resources/JakartaEE10Resource.java b/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_calebfontenot/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..1aff88d --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_calebfontenot/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package edu.slcc.asdv.caleb.mp1_calebfontenot.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 2/MP1_CalebFontenot/src/main/resources/META-INF/persistence.xml b/Semester 2/MP1_CalebFontenot/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/beans.xml b/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/web.xml b/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fcfcd54 --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 2/MP1_CalebFontenot/src/main/webapp/index.html b/Semester 2/MP1_CalebFontenot/src/main/webapp/index.html new file mode 100644 index 0000000..3368e9c --- /dev/null +++ b/Semester 2/MP1_CalebFontenot/src/main/webapp/index.html @@ -0,0 +1,10 @@ + + + + Start Page + + + +

Hello World!

+ + diff --git a/Semester 2/RecursionDemo/pom.xml b/Semester 2/RecursionDemo/pom.xml deleted file mode 100644 index 4f49854..0000000 --- a/Semester 2/RecursionDemo/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - edu.slcc.asdv.caleb - RecursionDemo - 1.0-SNAPSHOT - jar - - UTF-8 - 20 - 20 - edu.slcc.asdv.caleb.recursiondemo.RecursionDemo - - \ No newline at end of file diff --git a/Semester 2/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java b/Semester 2/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java deleted file mode 100644 index 2ed88ca..0000000 --- a/Semester 2/RecursionDemo/src/main/java/edu/slcc/asdv/caleb/recursiondemo/RecursionDemo.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - */ -package edu.slcc.asdv.caleb.recursiondemo; - -/** - * - * @author caleb - */ -public class RecursionDemo { - - static void printNTimes(int nTimes, String message) - { - for (int i = 0; i < nTimes; ++i) { - System.out.println(message); - } - } - - static void printNTimesRecursion(int nTimes, String message) - { - if (nTimes == 0) { - return; - } - System.out.println(message); - printNTimesRecursion(--nTimes, message); - } - - public static long factorial(int n) - { - long fact; - if (n == 1) - return 1; - fact = n * factorial(n - 1); - return fact; - } - - public static void main(String[] args) - { - System.out.println(factorial(20)); - printNTimesRecursion(1, "Hello Recursion"); - } -} diff --git a/Semester 2/lab04_nav1_CalebFontenot/faces-config.NavData b/Semester 2/lab04_nav1_CalebFontenot/faces-config.NavData new file mode 100644 index 0000000..298bfc5 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot/faces-config.NavData @@ -0,0 +1,6 @@ + + + + + + diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleController.java b/Semester 2/lab04_nav1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleController.java index 13c11ef..4ac674f 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleController.java +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleController.java @@ -7,6 +7,7 @@ package edu.slcc.asdv.beans; import jakarta.inject.Named; import jakarta.enterprise.context.RequestScoped; +import java.io.Serializable; /** * @@ -14,7 +15,7 @@ import jakarta.enterprise.context.RequestScoped; */ @Named(value="simpleController") @RequestScoped -public class SimpleController { +public class SimpleController implements Serializable { private String message; diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleController2.java b/Semester 2/lab04_nav1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleController2.java new file mode 100644 index 0000000..dd56821 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleController2.java @@ -0,0 +1,23 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.Dependent; + +/** + * + * @author caleb + */ +@Named(value="simpleController2") +@Dependent +public class SimpleController2 extends SimpleController { + + /** Creates a new instance of SimpleController2 */ + public SimpleController2() { + } + +} diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/WEB-INF/faces-config.xml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/WEB-INF/faces-config.xml index 04063f8..83e69e7 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/WEB-INF/faces-config.xml +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/WEB-INF/faces-config.xml @@ -49,5 +49,9 @@ - + + messageHandler + edu.slcc.asdv.beans.SimpleController2 + request + diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/error-message.xhtml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/error-message.xhtml index cfb9a6a..5911d51 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/error-message.xhtml +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/error-message.xhtml @@ -6,6 +6,7 @@ Facelet Title + #{simpleController}

Error Message Page

Message is too short

diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/index.xhtml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/index.xhtml index 1eb56d6..209351f 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/index.xhtml +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/index.xhtml @@ -7,7 +7,8 @@ - +
+
diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-1.xhtml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-1.xhtml index 5ebbe75..896d9ec 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-1.xhtml +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-1.xhtml @@ -6,6 +6,7 @@ Result Page 1 + #{simpleController}

Result Page 1

Your Message: "#{simpleController.getMessage()}"

diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-2.xhtml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-2.xhtml index 5e5a078..8a831b6 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-2.xhtml +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-2.xhtml @@ -6,6 +6,7 @@ Result Page 2 + #{simpleController}

Result Page 2

Your Message: "#{simpleController.getMessage()}"

diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-3.xhtml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-3.xhtml index adfda41..513f2dd 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-3.xhtml +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/result-page-3.xhtml @@ -6,6 +6,7 @@ Result Page 3 + #{simpleController}

Result Page 3

Your Message: "#{simpleController.getMessage()}"

diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/start-page-1.xhtml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/start-page-1.xhtml index c220846..ee5f316 100644 --- a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/start-page-1.xhtml +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/start-page-1.xhtml @@ -7,6 +7,7 @@ + #{simpleController}
Your Message:
diff --git a/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/start-page-2.xhtml b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/start-page-2.xhtml new file mode 100644 index 0000000..81987b2 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot/src/main/webapp/start-page-2.xhtml @@ -0,0 +1,17 @@ + + + + + Facelet Title + + + + #{messageHandler}
+ Your Message: + +
+ +
+
+ diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/7_navigation1.pdf b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/7_navigation1.pdf new file mode 100644 index 0000000..cf23fc8 Binary files /dev/null and b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/7_navigation1.pdf differ diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/faces-config.NavData b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/faces-config.NavData new file mode 100644 index 0000000..298bfc5 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/faces-config.NavData @@ -0,0 +1,6 @@ + + + + + + diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/nb-configuration.xml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/nb-configuration.xml new file mode 100644 index 0000000..f89ff8d --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 10-web + gfv700ee10 + Facelets + JDK_11__System_ + + diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/pom.xml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/pom.xml new file mode 100644 index 0000000..301c349 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + edu.slcc.asdv.caleb + lab04_nav1_CalebFontenot + 1.0-SNAPSHOT + war + lab04_nav1_CalebFontenot-1.0-SNAPSHOT + + + 11 + 11 + ${project.build.directory}/endorsed + UTF-8 + false + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + jar + + + + + + + + + \ No newline at end of file diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/SimpleController.java b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/SimpleController.java new file mode 100644 index 0000000..a43286a --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/SimpleController.java @@ -0,0 +1,40 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.RequestScoped; +import java.io.Serializable; + +/** + * + * @author caleb + */ +@Named(value="simpleController") +@RequestScoped +public class SimpleController implements Serializable { + + private String message; + + public String getMessage() + { + return message; + } + + public void setMessage(String message) + { + this.message = message; + } + + public String doNavigation() { + if (this.message.trim().length() < 2) { + return "too-short"; + } else { + int randInt = (int) (Math.random() * 3 +1); + return "message-page.xhtml"; + } + } +} diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/SimpleController2.java b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/SimpleController2.java new file mode 100644 index 0000000..030f138 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/SimpleController2.java @@ -0,0 +1,19 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.Dependent; + +/** + * + * @author caleb + */ +@Named(value="simpleController2") + +public class SimpleController2 extends SimpleController { + +} diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/Utilities.java b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/Utilities.java new file mode 100644 index 0000000..4e293b5 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/beans/Utilities.java @@ -0,0 +1,23 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.Dependent; + +/** + * + * @author caleb + */ +@Named(value="utilities") +@Dependent +public class Utilities { + + /** Creates a new instance of Utilities */ + public Utilities() { + } + +} diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/caleb/lab04_nav1_calebfontenot/JakartaRestConfiguration.java b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/caleb/lab04_nav1_calebfontenot/JakartaRestConfiguration.java new file mode 100644 index 0000000..98fc145 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/caleb/lab04_nav1_calebfontenot/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package edu.slcc.asdv.caleb.lab04_nav1_calebfontenot; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/caleb/lab04_nav1_calebfontenot/resources/JakartaEE10Resource.java b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/caleb/lab04_nav1_calebfontenot/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..a439788 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/java/edu/slcc/asdv/caleb/lab04_nav1_calebfontenot/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package edu.slcc.asdv.caleb.lab04_nav1_calebfontenot.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/resources/META-INF/persistence.xml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/beans.xml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..d581aa7 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/faces-config.xml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000..96b2ae4 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,58 @@ + + + + + + + /start-page-1.xhtml + + + too-short + error-message.xhtml + + + + page1 + message-page.xhtml + + + + page2 + message-page.xhtml + + + + page3 + message-page.xhtml + + + + + diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/web.xml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fcfcd54 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/error-message.xhtml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/error-message.xhtml new file mode 100644 index 0000000..5911d51 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/error-message.xhtml @@ -0,0 +1,13 @@ + + + + + Facelet Title + + + #{simpleController}
+

Error Message Page

+

Message is too short

+
+ diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/index.xhtml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/index.xhtml new file mode 100644 index 0000000..209351f --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/index.xhtml @@ -0,0 +1,14 @@ + + + + + Explicit Navigation + + + +
+ +
+
+ diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/message-page.xhtml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/message-page.xhtml new file mode 100644 index 0000000..8f00ff1 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/message-page.xhtml @@ -0,0 +1,13 @@ + + + + + Facelet Title + + +

Message Page

+
+ Your message:

#{simpleController2.getMessage()}

+
+ diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/start-page-1.xhtml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/start-page-1.xhtml new file mode 100644 index 0000000..ee5f316 --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/start-page-1.xhtml @@ -0,0 +1,17 @@ + + + + + Facelet Title + + + + #{simpleController}
+ Your Message: + +
+ +
+
+ diff --git a/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/start-page-2.xhtml b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/start-page-2.xhtml new file mode 100644 index 0000000..b8a495f --- /dev/null +++ b/Semester 2/lab04_nav1_CalebFontenot_war_1.0-SNAPSHOT2/src/main/webapp/start-page-2.xhtml @@ -0,0 +1,17 @@ + + + + + Facelet Title + + + + #{simpleController2}
+ Your Message: + +
+ +
+
+ diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/10-EL-1.pdf b/Semester 2/lab5_EL1_F23_CalebFontenot/10-EL-1.pdf new file mode 100644 index 0000000..393e135 Binary files /dev/null and b/Semester 2/lab5_EL1_F23_CalebFontenot/10-EL-1.pdf differ diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/nb-configuration.xml b/Semester 2/lab5_EL1_F23_CalebFontenot/nb-configuration.xml new file mode 100644 index 0000000..f89ff8d --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 10-web + gfv700ee10 + Facelets + JDK_11__System_ + + diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/pom.xml b/Semester 2/lab5_EL1_F23_CalebFontenot/pom.xml new file mode 100644 index 0000000..b3b4c0e --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + edu.slcc.asdv.caleb + lab5_EL1_F23_CalebFontenot + 1.0-SNAPSHOT + war + lab5_EL1_F23_CalebFontenot-1.0-SNAPSHOT + + + 11 + 11 + ${project.build.directory}/endorsed + UTF-8 + false + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + jar + + + + + + + + + \ No newline at end of file diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java new file mode 100644 index 0000000..77ffc9d --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java @@ -0,0 +1,28 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import edu.slcc.asdv.pojos.Company; +import edu.slcc.asdv.pojos.Employee; +import edu.slcc.asdv.pojos.Name; +import jakarta.inject.Named; +import jakarta.enterprise.context.RequestScoped; + +/** + * + * @author caleb + */ +@Named(value = "employeeBean") +@RequestScoped +public class EmployeeBean extends Employee { + + public EmployeeBean() + { + super(new Name("Jan", "Databaseux"), + new Company("DBaseSoft.com", + "Developing Database Solutions") + ); + } +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java new file mode 100644 index 0000000..c8723fa --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java @@ -0,0 +1,39 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.RequestScoped; + +/** + * + * @author caleb + */ +@Named(value = "simpleBean") +@RequestScoped +public class SimpleBean { + + private String[] colors = { + "red", "orange", "yellow" + }; + + public String getMessage() + { + return ("Hello, Friend"); + } + + public String[] getColors() + { + return colors; + } + + /** + * Creates a new instance of SimpleBean + */ + public SimpleBean() + { + } + +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java new file mode 100644 index 0000000..3cd181d --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java @@ -0,0 +1,37 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +package edu.slcc.asdv.beans; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Named; +import java.util.Date; + +/** + * + * @author caleb + */ +@Named(value="testBean1") +@ApplicationScoped +public class TestBean1 { + + private Date creationTime = new Date(); + + private String greeting = "Hello"; + + public String getGreeting() + { + return greeting; + } + + public Date getCreationTime() + { + return creationTime; + } + public double getRandomNumber() { + return (Math.random()); + } + +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5_el1_f23_calebfontenot/JakartaRestConfiguration.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5_el1_f23_calebfontenot/JakartaRestConfiguration.java new file mode 100644 index 0000000..6ef07b5 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5_el1_f23_calebfontenot/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package edu.slcc.asdv.caleb.lab5_el1_f23_calebfontenot; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5_el1_f23_calebfontenot/resources/JakartaEE10Resource.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5_el1_f23_calebfontenot/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..5f6c48c --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5_el1_f23_calebfontenot/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package edu.slcc.asdv.caleb.lab5_el1_f23_calebfontenot.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java new file mode 100644 index 0000000..907d43a --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java @@ -0,0 +1,40 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.pojos; + +/** + * + * @author caleb + */ +public class Company { + private String companyName, business; + + public Company(String companyName, String business) + { + this.companyName = companyName; + this.business = business; + } + + public String getCompanyName() + { + return companyName; + } + + public void setCompanyName(String companyName) + { + this.companyName = companyName; + } + + public String getBusiness() + { + return business; + } + + public void setBusiness(String business) + { + this.business = business; + } + +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java new file mode 100644 index 0000000..5c80935 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java @@ -0,0 +1,50 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.pojos; + +/** + * + * @author caleb + */ +public class Employee { + + private Name name; + private Company company; + + public Employee(Name name, Company company) + { + this.name = name; + this.company = company; + } + + /** + * Get the value of company + * + * @return the value of company + */ + public Company getCompany() + { + return company; + } + + + /** + * Get the value of name + * + * @return the value of name + */ + public Name getName() + { + return name; + } + public String processEmployee() { + if (Math.random() < 0.5) { + return ("accepted"); + } else { + return ("rejected"); + } + } + +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java new file mode 100644 index 0000000..303eb13 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java @@ -0,0 +1,41 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.pojos; + +/** + * + * @author caleb + */ +public class Name { + private String firstName, lastName; + + public Name(String firstName, String lastName) + { + this.firstName = firstName; + this.lastName = lastName; + } + public String getFirstName() + { + return firstName; + } + + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + public String getLastName() + { + return lastName; + } + + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + + +} diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/resources/META-INF/persistence.xml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/beans.xml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/web.xml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fcfcd54 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/accepted.xhtml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/accepted.xhtml new file mode 100644 index 0000000..25a62b1 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/accepted.xhtml @@ -0,0 +1,19 @@ + + + + + Employee Accepted + + +

Employee Accepted

+
+
    +
  • Employee's first name #{employeeBean.name.firstName}
  • +
  • Employee's last name #{employeeBean.name.lastName}
  • +
  • Name of employee's company: #{employeeBean.company.companyName}
  • +
  • Business area of employee's company: #{employeeBean.company.business}
  • +
+
+
+ diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/index.html b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/index.html new file mode 100644 index 0000000..3368e9c --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/index.html @@ -0,0 +1,10 @@ + + + + Start Page + + + +

Hello World!

+ + diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/index.xhtml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/index.xhtml new file mode 100644 index 0000000..5be4df9 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/index.xhtml @@ -0,0 +1,33 @@ + + + + + Test Page + + + Message: #{simpleBean.message} +
+ First color: #{simpleBean.colors[0]} +
+ ----------------------------------------------------------- +
+ Creation time: #{testBean1.creationTime} +
+ Greeting: #{testBean1.greeting} +
+ Random number: #{testBean1.randomNumber} +
+ ----------------------------------------------------------- +
+ Employee's first name #{employeeBean.name.firstName}
+ Employee's last name #{employeeBean.name.lastName}
+ Name of employee's company: #{employeeBean.company.companyName}
+ Business area of employee's company: #{employeeBean.company.business}
+ ----------------------------------------------------------- +
+ + + +
+ diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/rejected.xhtml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/rejected.xhtml new file mode 100644 index 0000000..fc829d3 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/rejected.xhtml @@ -0,0 +1,19 @@ + + + + + Employee Rejected + + +

Employee Rejected

+
+
    +
  • Employee's first name #{employeeBean.name.firstName}
  • +
  • Employee's last name #{employeeBean.name.lastName}
  • +
  • Name of employee's company: #{employeeBean.company.companyName}
  • +
  • Business area of employee's company: #{employeeBean.company.business}
  • +
+
+
+ diff --git a/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/submitting-properties.xhtml b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/submitting-properties.xhtml new file mode 100644 index 0000000..fcda308 --- /dev/null +++ b/Semester 2/lab5_EL1_F23_CalebFontenot/src/main/webapp/submitting-properties.xhtml @@ -0,0 +1,25 @@ + + + + + Submitting Properties + + +
+ + + Your first name: + + Your last name: + + Name of your company: + + Business area of your company: + + + + +
+
+ diff --git a/Semester 2/labEL2_CalebFontenot/nb-configuration.xml b/Semester 2/labEL2_CalebFontenot/nb-configuration.xml new file mode 100644 index 0000000..f89ff8d --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 10-web + gfv700ee10 + Facelets + JDK_11__System_ + + diff --git a/Semester 2/labEL2_CalebFontenot/pom.xml b/Semester 2/labEL2_CalebFontenot/pom.xml new file mode 100644 index 0000000..37f2749 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + edu.slcc.asdv.caleb + labEL2_CalebFontenot + 1.0-SNAPSHOT + war + labEL2_CalebFontenot-1.0-SNAPSHOT + + + 11 + 11 + ${project.build.directory}/endorsed + UTF-8 + false + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + jar + + + + + + + + + \ No newline at end of file diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java new file mode 100644 index 0000000..77ffc9d --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/EmployeeBean.java @@ -0,0 +1,28 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import edu.slcc.asdv.pojos.Company; +import edu.slcc.asdv.pojos.Employee; +import edu.slcc.asdv.pojos.Name; +import jakarta.inject.Named; +import jakarta.enterprise.context.RequestScoped; + +/** + * + * @author caleb + */ +@Named(value = "employeeBean") +@RequestScoped +public class EmployeeBean extends Employee { + + public EmployeeBean() + { + super(new Name("Jan", "Databaseux"), + new Company("DBaseSoft.com", + "Developing Database Solutions") + ); + } +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Purchases.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Purchases.java new file mode 100644 index 0000000..3e61672 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/Purchases.java @@ -0,0 +1,67 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import edu.slcc.asdv.bl.Utils; +import jakarta.inject.Named; +import java.util.List; +import jakarta.enterprise.context.RequestScoped; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author caleb + */ +@Named(value = "purchases") +@RequestScoped +public class Purchases { + + private String[] cheapItems = {"Gum", "Yo-yo", "Pencil"}; + private List mediumItems = new ArrayList<>(); + private Map valuableItems = new HashMap<>(); + private boolean isEverythingOK = true; + + public Map getValuableItems() + { + return valuableItems; + } + + public List getMediumItems() + { + return mediumItems; + } + + public String[] getCheapItems() + { + return cheapItems; + } + + /** + * Creates a new instance of Purchases + */ + public Purchases() + { + mediumItems.add("iPod"); + mediumItems.add("GameBoy"); + mediumItems.add("Cell Phone"); + valuableItems.put("low", "Porche"); + valuableItems.put("medium", "Yacht"); + valuableItems.put("high", "Oracle, Training Course"); + } + + public String purchaseItems() + { + isEverythingOK = Utils.doBusinessLogic(this); + isEverythingOK = Utils.doDataAccessLogic(this); + if (isEverythingOK) { + return "purchase-success"; + } else { + return "purchase-failure"; + } + + } +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java new file mode 100644 index 0000000..c8723fa --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/SimpleBean.java @@ -0,0 +1,39 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.RequestScoped; + +/** + * + * @author caleb + */ +@Named(value = "simpleBean") +@RequestScoped +public class SimpleBean { + + private String[] colors = { + "red", "orange", "yellow" + }; + + public String getMessage() + { + return ("Hello, Friend"); + } + + public String[] getColors() + { + return colors; + } + + /** + * Creates a new instance of SimpleBean + */ + public SimpleBean() + { + } + +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java new file mode 100644 index 0000000..3cd181d --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/beans/TestBean1.java @@ -0,0 +1,37 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +package edu.slcc.asdv.beans; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Named; +import java.util.Date; + +/** + * + * @author caleb + */ +@Named(value="testBean1") +@ApplicationScoped +public class TestBean1 { + + private Date creationTime = new Date(); + + private String greeting = "Hello"; + + public String getGreeting() + { + return greeting; + } + + public Date getCreationTime() + { + return creationTime; + } + public double getRandomNumber() { + return (Math.random()); + } + +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/bl/Utils.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/bl/Utils.java new file mode 100644 index 0000000..4787f18 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/bl/Utils.java @@ -0,0 +1,22 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.bl; + +import edu.slcc.asdv.beans.Purchases; +/** + * + * @author caleb + */ +public class Utils { + public static boolean doBusinessLogic(Purchases bean) { + // Business logic not implemented + return (Math.random() > 0.1); + } + + public static boolean doDataAccessLogic(Purchases bean) { + // Business logic not implemented + return (Math.random() > 0.1); + } +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/JakartaRestConfiguration.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/JakartaRestConfiguration.java new file mode 100644 index 0000000..0217999 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package edu.slcc.asdv.caleb.label2_calebfontenot; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/resources/JakartaEE10Resource.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..a68b759 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/label2_calebfontenot/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package edu.slcc.asdv.caleb.label2_calebfontenot.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java new file mode 100644 index 0000000..907d43a --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Company.java @@ -0,0 +1,40 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.pojos; + +/** + * + * @author caleb + */ +public class Company { + private String companyName, business; + + public Company(String companyName, String business) + { + this.companyName = companyName; + this.business = business; + } + + public String getCompanyName() + { + return companyName; + } + + public void setCompanyName(String companyName) + { + this.companyName = companyName; + } + + public String getBusiness() + { + return business; + } + + public void setBusiness(String business) + { + this.business = business; + } + +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java new file mode 100644 index 0000000..5c80935 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Employee.java @@ -0,0 +1,50 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.pojos; + +/** + * + * @author caleb + */ +public class Employee { + + private Name name; + private Company company; + + public Employee(Name name, Company company) + { + this.name = name; + this.company = company; + } + + /** + * Get the value of company + * + * @return the value of company + */ + public Company getCompany() + { + return company; + } + + + /** + * Get the value of name + * + * @return the value of name + */ + public Name getName() + { + return name; + } + public String processEmployee() { + if (Math.random() < 0.5) { + return ("accepted"); + } else { + return ("rejected"); + } + } + +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java new file mode 100644 index 0000000..303eb13 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/java/edu/slcc/asdv/pojos/Name.java @@ -0,0 +1,41 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.pojos; + +/** + * + * @author caleb + */ +public class Name { + private String firstName, lastName; + + public Name(String firstName, String lastName) + { + this.firstName = firstName; + this.lastName = lastName; + } + public String getFirstName() + { + return firstName; + } + + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + public String getLastName() + { + return lastName; + } + + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + + +} diff --git a/Semester 2/labEL2_CalebFontenot/src/main/resources/META-INF/persistence.xml b/Semester 2/labEL2_CalebFontenot/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/beans.xml b/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/web.xml b/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fcfcd54 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/index.html b/Semester 2/labEL2_CalebFontenot/src/main/webapp/index.html new file mode 100644 index 0000000..3368e9c --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/index.html @@ -0,0 +1,10 @@ + + + + Start Page + + + +

Hello World!

+ + diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/index.xhtml b/Semester 2/labEL2_CalebFontenot/src/main/webapp/index.xhtml new file mode 100644 index 0000000..5366e41 --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/index.xhtml @@ -0,0 +1,21 @@ + + + + + Facelet Title + + + ----------------------------------------------------------------
+ + + + ----------------------------------------------------------------
+ + + + ----------------------------------------------------------------
+
+ diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/purchase-failure.xhtml b/Semester 2/labEL2_CalebFontenot/src/main/webapp/purchase-failure.xhtml new file mode 100644 index 0000000..992cf7a --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/purchase-failure.xhtml @@ -0,0 +1,36 @@ + + + + + Sucess + + +

Successful Purchase

+

Your account was succesfully charged. + Thanks for shopping with us!

+
    +
  • Cheap Items +
      +
    1. #{purchases.cheapItems[0]}
    2. +
    3. #{purchases.cheapItems[1]}
    4. +
    5. #{purchases.cheapItems[2]}
    6. +
    +
  • +
  • Medium Items +
      +
    1. #{purchases.mediumItems[0]}
    2. +
    3. #{purchases.mediumItems[1]}
    4. +
    5. #{purchases.mediumItems[2]}
    6. +
    +
  • +
  • Valuable Items +
      +
    • Low: #{purchases.valuableItems["Low"]}
    • +
    • Medium #{purchases.valuableItems["Medium"]}
    • +
    • High #{purchases.valuableItems["High"]}
    • +
    +
  • +
+
+ diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/purchase-success.xhtml b/Semester 2/labEL2_CalebFontenot/src/main/webapp/purchase-success.xhtml new file mode 100644 index 0000000..e35b22c --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/purchase-success.xhtml @@ -0,0 +1,35 @@ + + + + + Failure + + +

Failure

+

Insufficient balance. Go away, cheapskate.

+
    +
  • Cheap Items +
      +
    1. #{purchases.cheapItems[0]}
    2. +
    3. #{purchases.cheapItems[1]}
    4. +
    5. #{purchases.cheapItems[2]}
    6. +
    +
  • +
  • Medium Items +
      +
    1. #{purchases.mediumItems[0]}
    2. +
    3. #{purchases.mediumItems[1]}
    4. +
    5. #{purchases.mediumItems[2]}
    6. +
    +
  • +
  • Valuable Items +
      +
    • Low: #{purchases.valuableItems["low"]}
    • +
    • Medium: #{purchases.valuableItems["medium"]}
    • +
    • High: #{purchases.valuableItems["high"]}
    • +
    +
  • +
+
+ diff --git a/Semester 2/labEL2_CalebFontenot/src/main/webapp/using-collections.xhtml b/Semester 2/labEL2_CalebFontenot/src/main/webapp/using-collections.xhtml new file mode 100644 index 0000000..b3bb41c --- /dev/null +++ b/Semester 2/labEL2_CalebFontenot/src/main/webapp/using-collections.xhtml @@ -0,0 +1,35 @@ + + + + + Using Collections + + +

Using collections

+
+ + +

Cheap Items from Array

+ + + + +

Inexpensive Items from List

+ + + + +

Valuable Items from Map

+ Low: + + Medium: + + High: + + +
+
+
+
+