diff --git a/.env.tpl b/.env.tpl index 1d46bf3..fc565bd 100644 --- a/.env.tpl +++ b/.env.tpl @@ -1,2 +1,3 @@ # https://developer.1password.com/docs/cli/secrets-config-files/ -LDAP_ADMIN_PASS="op://Professional-IT Projects/multi-cloud-WebApp-Attendance/password" \ No newline at end of file +export LDAP_ADMIN_PASS="op://Professional-IT Projects/multi-cloud-WebApp-Attendance/password" +export APP_WAR_FILE_VERSION=$(gradle getAppVersion --quiet) || true \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56..b86273d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Dockerfile.wildfly b/Dockerfile.wildfly index 3c3bbd2..488a48c 100644 --- a/Dockerfile.wildfly +++ b/Dockerfile.wildfly @@ -1,5 +1,5 @@ # https://quay.io/repository/wildfly/wildfly?tab=tags -FROM quay.io/wildfly/wildfly:29.0.0.Final-jdk20 +FROM quay.io/wildfly/wildfly:32.0.0.Final-1-jdk21 ARG APP_WAR_FILE_VERSION ENV APP_WAR_FILE_VERSION=$APP_WAR_FILE_VERSION diff --git a/README.md b/README.md index 41cf00c..627f8c9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![Project Status: Active](https://img.shields.io/badge/Project%20Status-Active-brightgreen.svg)](https://github.com/aleon1220/multi-cloud-WebApp-Attendance/projects) +[![Automation engineers wanted](https://img.shields.io/badge/Automation%20engineers%20wanted-Yes-brightgreen.svg)](https://github.com/my-org/my-project/issues/new) +[![Feedback welcome](https://img.shields.io/badge/Feedback%20welcome-Yes-brightgreen.svg)](https://github.com/aleon1220/multi-cloud-WebApp-Attendance/issues/new) + - [Attendance WebApp](#attendance-webapp) - [Introduction](#introduction) - [GitHub Reports](#github-reports) diff --git a/build.gradle.kts b/build.gradle.kts index da0d03d..388e2f2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent import java.net.InetAddress group = "soa.nz.aut" -version = "0.8.0" +version = "0.9.0" description = "Student Attendance WebApp" val warDeploymentName = "AttendanceTrak" // java.sourceCompatibility = JavaVersion.VERSION_17 diff --git a/docker-compose.yml b/docker-compose.yml index 7484256..bb18806 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,4 +19,4 @@ services: image: aleon1220/soa:latest env_file: .env ports: - - 8080:8080 + - 8080:8080 \ No newline at end of file diff --git a/runme.sh b/runme.sh index 54671a0..f1fe733 100755 --- a/runme.sh +++ b/runme.sh @@ -4,10 +4,12 @@ set -e # Array avoids word splitting issues COMMANDS=(help build clean run_smoke_test run_stack test_stack) export APP_WAR_FILE_VERSION=$(gradle getAppVersion --quiet) || true +# build +version="$APP_WAR_FILE_VERSION" command=$1 print_usage() { - printf "Usage: %s [options] Available commands: \n\n" $0 + printf "Usage: %s [options] Available commands: \n\n" "$0" printf "\t %s " "${COMMANDS[@]}" printf "\n\n Script tested in Linux Bash 5.1.16 \n\n" printf "This OS bash version is: \n\n" @@ -16,22 +18,19 @@ print_usage() { # Function to handle invalid command invalid_command() { - printf "Invalid command: %s \n\n" $1 + printf "Invalid command: %s \n\n" "$1" print_usage exit 1 } -# build -export APP_WAR_FILE_VERSION=$(gradle getAppVersion --quiet) || true -version="$APP_WAR_FILE_VERSION" - build() { - gradle clean assemble war --warn || true - docker build --build-arg APP_WAR_FILE_VERSION=$version --tag aleon1220/attendance-webapp:$version --file Dockerfile.wildfly . || true +# gradle clean assemble war --warn || true + gradle clean war --warn || true + docker build --build-arg APP_WAR_FILE_VERSION="$version" --tag aleon1220/attendance-webapp:"$version" --file Dockerfile.wildfly . || true } run_smoke_test() { - clean + clean "$version" build printf "Executing webapp Locally \n\n" || true docker run --interactive --tty --detach --publish 8080:8080 --name $version aleon1220/attendance-webapp:$version || true @@ -43,6 +42,13 @@ run_smoke_test() { } clean() { + # Check if a version argument is provided + if [ -z "$2" ]; then + version="$version" + else + # Version provided, use it directly + version="$2" + fi printf "Executing local CLEAN-UP \n\n" docker kill $version docker rm $version diff --git a/src/main/java/bean/OrgchartController.java b/src/main/java/bean/OrgchartController.java new file mode 100644 index 0000000..851edf0 --- /dev/null +++ b/src/main/java/bean/OrgchartController.java @@ -0,0 +1,64 @@ +package bean; + +import java.io.Serializable; +import jakarta.inject.Named; +//https://jakarta.ee/specifications/platform/9/apidocs/jakarta/faces/bean/viewscoped +import jakarta.faces.view.ViewScoped; +import org.primefaces.extensions.component.orgchart.OrgChartNode; +import org.primefaces.extensions.component.orgchart.DefaultOrgChartNode; +import org.primefaces.extensions.event.OrgChartClickEvent; +import org.primefaces.extensions.event.OrgChartDropEvent; + +@Named +@ViewScoped +public class OrgchartController implements Serializable { + + private static final long serialVersionUID = 1648477595853984820L; + + private OrgChartNode orgChartNode; + + private String direction = "t2b"; + + public OrgchartController() { + super(); + init(); + } + + public void init() { + orgChartNode = new DefaultOrgChartNode("id1", "Cohort March 2023", "2023-03-20"); + orgChartNode.addChild(new DefaultOrgChartNode("id2", "Cloud Basics", "Content2")); + orgChartNode.addChild(new DefaultOrgChartNode("id3", "Programming Java", "Content3")); + orgChartNode.addChild(new DefaultOrgChartNode("id4", "Programming Python", "Content3")); + final OrgChartNode node = new DefaultOrgChartNode("id5", "Iac", "Infra as Code"); + orgChartNode.addChild(node); + node.addChild(new DefaultOrgChartNode("id6", "pulumi", "with java programming language")); + node.addChild(new DefaultOrgChartNode("id7", "terraform", "HCL Hashicorp config language")); + } + + public static void onClick(final OrgChartClickEvent event) { + System.out.println("clicked ID: " + event.getId()); + System.out.println("hierarchy: " + event.getHierarchy().toString()); + } + + public static void onDropOver(final OrgChartDropEvent event) { + System.out.println("hierarchy: " + event.getHierarchy().toString()); + System.out.println("dragged node id " + event.getDraggedNodeId()); + System.out.println("dropped node id " + event.getDroppedZoneId()); + } + + public OrgChartNode getOrgChartNode() { + return orgChartNode; + } + + public void setOrgChartNode(final OrgChartNode orgChartNode) { + this.orgChartNode = orgChartNode; + } + + public String getDirection() { + return direction; + } + + public void setDirection(final String direction) { + this.direction = direction; + } +} \ No newline at end of file diff --git a/src/main/webapp/02-attendance.xhtml b/src/main/webapp/02-attendance.xhtml index 6529020..abc2c6a 100644 --- a/src/main/webapp/02-attendance.xhtml +++ b/src/main/webapp/02-attendance.xhtml @@ -22,7 +22,7 @@ - + @@ -52,16 +52,14 @@ -
- -
+ + + + + + + - - - - - - diff --git a/src/main/webapp/04-lecturerHome.xhtml b/src/main/webapp/04-lecturerHome.xhtml index cdf9018..8fb21da 100644 --- a/src/main/webapp/04-lecturerHome.xhtml +++ b/src/main/webapp/04-lecturerHome.xhtml @@ -28,6 +28,7 @@ + diff --git a/src/main/webapp/05-adminStaff.xhtml b/src/main/webapp/05-adminStaff.xhtml index b59cc55..3340b0c 100644 --- a/src/main/webapp/05-adminStaff.xhtml +++ b/src/main/webapp/05-adminStaff.xhtml @@ -21,6 +21,7 @@ + diff --git a/src/main/webapp/06-Reports.xhtml b/src/main/webapp/06-Reports.xhtml index 64352f3..6a72550 100644 --- a/src/main/webapp/06-Reports.xhtml +++ b/src/main/webapp/06-Reports.xhtml @@ -3,10 +3,11 @@ xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" - xmlns:p="http://primefaces.org/ui"> + xmlns:p="http://primefaces.org/ui" + xmlns:pe="http://primefaces.org/ui/extensions"> - Reporting AttendanceTrak + Reporting AttendTrak @@ -19,6 +20,7 @@ + @@ -27,32 +29,78 @@

Reports Attendance Tracking

- Info: example primefaces panel signup to the attendance web App + Info: Reports for admin staff

- +
+ + + +
- Sign Up -

Attendance System Sign Up

+ Absence Report +

AttendTrak Absent Report. use https://www.primefaces.org/showcase/ui/chartjs/pie.xhtml

+ - Username - - Password - - Confirm Password - - email - + Total absence + 2 students + student 01 + john.doe + student 02 + juana.marquez
- -
-
- submit changes -
-
-
+

Class Attendance Summary Report

+

Provides an overview of attendance for a specific class within a chosen timeframe.

+
    +
  • Total enrolled students: 150
  • +
  • Average attendance percentage: 85%
  • +
  • Attendance breakdown:
  • +
      +
    • Present: 120 students
    • +
    • Absent: 20 students
    • +
    • Late: 10 students
    • +
    +
  • Total attendance percentage: 90%
  • +
  • Average attendance: 27 students per class
  • +
  • Trends:
  • +
      +
    • Weekly spikes after holidays
    • +
    • Monthly drops during exam weeks
    • +
    +
+ +

Comparative Attendance Report

+

Compares attendance data across multiple classes or cohorts.

+
    +
  • Class A: 80% average attendance
  • +
  • Class B: 95% average attendance
  • +
  • Class C: 70% average attendance
  • +
  • Assessment of teaching methods:
  • +
      +
    • Class B shows the highest attendance; consider sharing their practices with other classes.
    • +
    +
+ +

Absence Reason Report

+

Categorizes absences by reason.

+
    +
  • Illness: 40%
  • +
  • Family emergency: 40%
  • +
  • Approved absence: 20%
  • +
\ No newline at end of file diff --git a/src/main/webapp/07-StudentManagement.xhtml b/src/main/webapp/07-StudentManagement.xhtml index e555ab6..8df1c41 100644 --- a/src/main/webapp/07-StudentManagement.xhtml +++ b/src/main/webapp/07-StudentManagement.xhtml @@ -26,6 +26,7 @@ + diff --git a/src/main/webapp/08-ClassManagement.xhtml b/src/main/webapp/08-ClassManagement.xhtml index 525f714..6a4657e 100644 --- a/src/main/webapp/08-ClassManagement.xhtml +++ b/src/main/webapp/08-ClassManagement.xhtml @@ -26,6 +26,7 @@ + diff --git a/src/main/webapp/09-UserManagement.xhtml b/src/main/webapp/09-UserManagement.xhtml index 29052f0..4fb4893 100644 --- a/src/main/webapp/09-UserManagement.xhtml +++ b/src/main/webapp/09-UserManagement.xhtml @@ -23,6 +23,7 @@ + diff --git a/src/main/webapp/support.xhtml b/src/main/webapp/support.xhtml index 7d418cd..6c576cf 100644 --- a/src/main/webapp/support.xhtml +++ b/src/main/webapp/support.xhtml @@ -20,7 +20,7 @@ - + @@ -37,5 +37,4 @@

For detailed documentation, visit the PrimeFaces Showcase Support page.

-