commit 4b503323df3b7c68a3a25e225d6b5820957c41ef Author: start.vaadin.com Date: Sat May 18 14:42:12 2024 +0000 Generated project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dae6077 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +/target/ +.idea/ +.vscode/ +.settings +.project +.classpath + +*.iml +.DS_Store + +# The following files are generated/updated by vaadin-maven-plugin +node_modules/ +frontend/generated/ +pnpmfile.js +vite.generated.ts + +# Browser drivers for local integration tests +drivers/ +# Error screenshots generated by TestBench for failed integration tests +error-screenshots/ +webpack.generated.js diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000..8895dd4 --- /dev/null +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import java.io.*; +import java.net.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is + * provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl + * property to use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download + * url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a + // custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..c1dd12f Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..8c79a83 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..cf1ab25 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/README.md b/README.md new file mode 100644 index 0000000..9e1f12a --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# Munera + +This project can be used as a starting point to create your own Vaadin application with Spring Boot. +It contains all the necessary configuration and some placeholder files to get you started. + +## Running the application + +The project is a standard Maven project. To run it from the command line, +type `mvnw` (Windows), or `./mvnw` (Mac & Linux), then open +http://localhost:8080 in your browser. + +You can also import the project to your IDE of choice as you would with any +Maven project. Read more on [how to import Vaadin projects to different IDEs](https://vaadin.com/docs/latest/guide/step-by-step/importing) (Eclipse, IntelliJ IDEA, NetBeans, and VS Code). + +## Deploying to Production + +To create a production build, call `mvnw clean package -Pproduction` (Windows), +or `./mvnw clean package -Pproduction` (Mac & Linux). +This will build a JAR file with all the dependencies and front-end resources, +ready to be deployed. The file can be found in the `target` folder after the build completes. + +Once the JAR file is built, you can run it using +`java -jar target/munera-1.0-SNAPSHOT.jar` + +## Project structure + +- `MainLayout.java` in `src/main/java` contains the navigation setup (i.e., the + side/top bar and the main menu). This setup uses + [App Layout](https://vaadin.com/docs/components/app-layout). +- `views` package in `src/main/java` contains the server-side Java views of your application. +- `views` folder in `src/main/frontend` contains the client-side JavaScript views of your application. +- `themes` folder in `src/main/frontend` contains the custom CSS styles. + +## Useful links + +- Read the documentation at [vaadin.com/docs](https://vaadin.com/docs). +- Follow the tutorial at [vaadin.com/docs/latest/tutorial/overview](https://vaadin.com/docs/latest/tutorial/overview). +- Create new projects at [start.vaadin.com](https://start.vaadin.com/). +- Search UI components and their usage examples at [vaadin.com/docs/latest/components](https://vaadin.com/docs/latest/components). +- View use case applications that demonstrate Vaadin capabilities at [vaadin.com/examples-and-demos](https://vaadin.com/examples-and-demos). +- Build any UI without custom CSS by discovering Vaadin's set of [CSS utility classes](https://vaadin.com/docs/styling/lumo/utility-classes). +- Find a collection of solutions to common use cases at [cookbook.vaadin.com](https://cookbook.vaadin.com/). +- Find add-ons at [vaadin.com/directory](https://vaadin.com/directory). +- Ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/vaadin) or join our [Discord channel](https://discord.gg/MYFq5RTbBn). +- Report issues, create pull requests in [GitHub](https://github.com/vaadin). diff --git a/frontend/themes/munera/main-layout.css b/frontend/themes/munera/main-layout.css new file mode 100644 index 0000000..1664c21 --- /dev/null +++ b/frontend/themes/munera/main-layout.css @@ -0,0 +1,20 @@ +vaadin-scroller[slot="drawer"] { + padding: var(--lumo-space-s); +} + +vaadin-side-nav-item vaadin-icon { + padding: 0; +} + +[slot="drawer"]:is(header, footer) { + display: flex; + align-items: center; + gap: var(--lumo-space-s); + padding: var(--lumo-space-s) var(--lumo-space-m); + min-height: var(--lumo-size-xl); + box-sizing: border-box; +} + +[slot="drawer"]:is(header, footer):is(:empty) { + display: none; +} diff --git a/frontend/themes/munera/styles.css b/frontend/themes/munera/styles.css new file mode 100644 index 0000000..a857cce --- /dev/null +++ b/frontend/themes/munera/styles.css @@ -0,0 +1,2 @@ +@import url('./main-layout.css'); +@import url('./views/expenses-view.css'); \ No newline at end of file diff --git a/frontend/themes/munera/theme.json b/frontend/themes/munera/theme.json new file mode 100644 index 0000000..0f7a81f --- /dev/null +++ b/frontend/themes/munera/theme.json @@ -0,0 +1,3 @@ +{ + "lumoImports" : [ "typography", "color", "spacing", "badge", "utility" ] +} \ No newline at end of file diff --git a/frontend/themes/munera/views/expenses-view.css b/frontend/themes/munera/views/expenses-view.css new file mode 100644 index 0000000..95936cd --- /dev/null +++ b/frontend/themes/munera/views/expenses-view.css @@ -0,0 +1,44 @@ +.expenses-view { + display: flex; + flex-direction: column; + height: 100%; +} + +.expenses-view vaadin-split-layout { + width: 100%; + height: 100%; +} + +.expenses-view vaadin-grid { + height: 100%; +} + +.expenses-view .editor-layout { + display: flex; + flex-direction: column; + width: 400px; +} + +.expenses-view .editor { + flex-grow: 1; + padding: var(--lumo-space-l); +} + +.expenses-view .editor vaadin-checkbox { + padding-top: var(--lumo-space-m); +} + +.expenses-view .button-layout { + width: 100%; + flex-wrap: wrap; + background-color: var(--lumo-contrast-5pct); + padding-bottom: var(--lumo-space-s); + padding-top: var(--lumo-space-s); + padding-left: var(--lumo-space-l); + padding-right: var(--lumo-space-l); + gap: var(--lumo-space-m); +} + +.expenses-view .grid-wrapper { + width: 100%; +} diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..5643201 --- /dev/null +++ b/mvnw @@ -0,0 +1,316 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..23b7079 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,188 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..b0c9858 --- /dev/null +++ b/pom.xml @@ -0,0 +1,199 @@ + + + 4.0.0 + + com.application.munera + munera + munera + 1.0-SNAPSHOT + jar + + + 21 + 24.3.12 + + + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + + + Vaadin Directory + https://maven.vaadin.com/vaadin-addons + + false + + + + + + + + com.vaadin + vaadin-bom + ${vaadin.version} + pom + import + + + + + + + com.vaadin + + vaadin + + + com.vaadin + vaadin-spring-boot-starter + + + org.parttio + line-awesome + 2.0.0 + + + + org.postgresql + postgresql + runtime + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-devtools + true + + + org.springframework.boot + spring-boot-starter-test + test + + + com.vaadin + vaadin-testbench-junit5 + test + + + + + spring-boot:run + + + org.springframework.boot + spring-boot-maven-plugin + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.version} + + + + prepare-frontend + + + + + + + + + + + production + + + + com.vaadin + vaadin-core + + + com.vaadin + vaadin-dev + + + + + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.version} + + + + build-frontend + + compile + + + + + + + + + it + + + + org.springframework.boot + spring-boot-maven-plugin + + + start-spring-boot + pre-integration-test + + start + + + + stop-spring-boot + post-integration-test + + stop + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + + false + true + + + + + + + + diff --git a/src/main/java/com/application/munera/Application.java b/src/main/java/com/application/munera/Application.java new file mode 100644 index 0000000..44f6a3b --- /dev/null +++ b/src/main/java/com/application/munera/Application.java @@ -0,0 +1,42 @@ +package com.application.munera; + +import com.application.munera.data.SamplePersonRepository; +import com.vaadin.flow.component.page.AppShellConfigurator; +import com.vaadin.flow.theme.Theme; +import javax.sql.DataSource; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.sql.init.SqlDataSourceScriptDatabaseInitializer; +import org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties; +import org.springframework.context.annotation.Bean; + +/** + * The entry point of the Spring Boot application. + * + * Use the @PWA annotation make the application installable on phones, tablets + * and some desktop browsers. + * + */ +@SpringBootApplication +@Theme(value = "munera") +public class Application implements AppShellConfigurator { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + @Bean + SqlDataSourceScriptDatabaseInitializer dataSourceScriptDatabaseInitializer(DataSource dataSource, + SqlInitializationProperties properties, SamplePersonRepository repository) { + // This bean ensures the database is only initialized when empty + return new SqlDataSourceScriptDatabaseInitializer(dataSource, properties) { + @Override + public boolean initializeDatabase() { + if (repository.count() == 0L) { + return super.initializeDatabase(); + } + return false; + } + }; + } +} diff --git a/src/main/java/com/application/munera/data/AbstractEntity.java b/src/main/java/com/application/munera/data/AbstractEntity.java new file mode 100644 index 0000000..43fb5af --- /dev/null +++ b/src/main/java/com/application/munera/data/AbstractEntity.java @@ -0,0 +1,52 @@ +package com.application.munera.data; + +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Version; + +@MappedSuperclass +public abstract class AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idgenerator") + // The initial value is to account for data.sql demo data ids + @SequenceGenerator(name = "idgenerator", initialValue = 1000) + private Long id; + + @Version + private int version; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public int getVersion() { + return version; + } + + @Override + public int hashCode() { + if (getId() != null) { + return getId().hashCode(); + } + return super.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof AbstractEntity that)) { + return false; // null or not an AbstractEntity class + } + if (getId() != null) { + return getId().equals(that.getId()); + } + return super.equals(that); + } +} diff --git a/src/main/java/com/application/munera/data/SamplePerson.java b/src/main/java/com/application/munera/data/SamplePerson.java new file mode 100644 index 0000000..6e57a5c --- /dev/null +++ b/src/main/java/com/application/munera/data/SamplePerson.java @@ -0,0 +1,69 @@ +package com.application.munera.data; + +import jakarta.persistence.Entity; +import jakarta.validation.constraints.Email; +import java.time.LocalDate; + +@Entity +public class SamplePerson extends AbstractEntity { + + private String firstName; + private String lastName; + @Email + private String email; + private String phone; + private LocalDate dateOfBirth; + private String occupation; + private String role; + private boolean important; + + 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; + } + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + public LocalDate getDateOfBirth() { + return dateOfBirth; + } + public void setDateOfBirth(LocalDate dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + public String getOccupation() { + return occupation; + } + public void setOccupation(String occupation) { + this.occupation = occupation; + } + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } + public boolean isImportant() { + return important; + } + public void setImportant(boolean important) { + this.important = important; + } + +} diff --git a/src/main/java/com/application/munera/data/SamplePersonRepository.java b/src/main/java/com/application/munera/data/SamplePersonRepository.java new file mode 100644 index 0000000..978789d --- /dev/null +++ b/src/main/java/com/application/munera/data/SamplePersonRepository.java @@ -0,0 +1,12 @@ +package com.application.munera.data; + + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +public interface SamplePersonRepository + extends + JpaRepository, + JpaSpecificationExecutor { + +} diff --git a/src/main/java/com/application/munera/data/package-info.java b/src/main/java/com/application/munera/data/package-info.java new file mode 100644 index 0000000..e9fca46 --- /dev/null +++ b/src/main/java/com/application/munera/data/package-info.java @@ -0,0 +1,4 @@ +@NonNullApi +package com.application.munera.data; + +import org.springframework.lang.NonNullApi; diff --git a/src/main/java/com/application/munera/services/SamplePersonService.java b/src/main/java/com/application/munera/services/SamplePersonService.java new file mode 100644 index 0000000..42912ae --- /dev/null +++ b/src/main/java/com/application/munera/services/SamplePersonService.java @@ -0,0 +1,44 @@ +package com.application.munera.services; + +import com.application.munera.data.SamplePerson; +import com.application.munera.data.SamplePersonRepository; +import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; + +@Service +public class SamplePersonService { + + private final SamplePersonRepository repository; + + public SamplePersonService(SamplePersonRepository repository) { + this.repository = repository; + } + + public Optional get(Long id) { + return repository.findById(id); + } + + public SamplePerson update(SamplePerson entity) { + return repository.save(entity); + } + + public void delete(Long id) { + repository.deleteById(id); + } + + public Page list(Pageable pageable) { + return repository.findAll(pageable); + } + + public Page list(Pageable pageable, Specification filter) { + return repository.findAll(filter, pageable); + } + + public int count() { + return (int) repository.count(); + } + +} diff --git a/src/main/java/com/application/munera/services/package-info.java b/src/main/java/com/application/munera/services/package-info.java new file mode 100644 index 0000000..e0a00b2 --- /dev/null +++ b/src/main/java/com/application/munera/services/package-info.java @@ -0,0 +1,4 @@ +@NonNullApi +package com.application.munera.services; + +import org.springframework.lang.NonNullApi; diff --git a/src/main/java/com/application/munera/views/MainLayout.java b/src/main/java/com/application/munera/views/MainLayout.java new file mode 100644 index 0000000..78bd1d6 --- /dev/null +++ b/src/main/java/com/application/munera/views/MainLayout.java @@ -0,0 +1,74 @@ +package com.application.munera.views; + +import com.application.munera.views.expenses.ExpensesView; +import com.vaadin.flow.component.applayout.AppLayout; +import com.vaadin.flow.component.applayout.DrawerToggle; +import com.vaadin.flow.component.html.Footer; +import com.vaadin.flow.component.html.H1; +import com.vaadin.flow.component.html.Header; +import com.vaadin.flow.component.html.Span; +import com.vaadin.flow.component.orderedlayout.Scroller; +import com.vaadin.flow.component.sidenav.SideNav; +import com.vaadin.flow.component.sidenav.SideNavItem; +import com.vaadin.flow.router.PageTitle; +import com.vaadin.flow.theme.lumo.LumoUtility; +import org.vaadin.lineawesome.LineAwesomeIcon; + +/** + * The main view is a top-level placeholder for other views. + */ +public class MainLayout extends AppLayout { + + private H1 viewTitle; + + public MainLayout() { + setPrimarySection(Section.DRAWER); + addDrawerContent(); + addHeaderContent(); + } + + private void addHeaderContent() { + DrawerToggle toggle = new DrawerToggle(); + toggle.setAriaLabel("Menu toggle"); + + viewTitle = new H1(); + viewTitle.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE); + + addToNavbar(true, toggle, viewTitle); + } + + private void addDrawerContent() { + Span appName = new Span("Munera"); + appName.addClassNames(LumoUtility.FontWeight.SEMIBOLD, LumoUtility.FontSize.LARGE); + Header header = new Header(appName); + + Scroller scroller = new Scroller(createNavigation()); + + addToDrawer(header, scroller, createFooter()); + } + + private SideNav createNavigation() { + SideNav nav = new SideNav(); + + nav.addItem(new SideNavItem("Expenses", ExpensesView.class, LineAwesomeIcon.COLUMNS_SOLID.create())); + + return nav; + } + + private Footer createFooter() { + Footer layout = new Footer(); + + return layout; + } + + @Override + protected void afterNavigation() { + super.afterNavigation(); + viewTitle.setText(getCurrentPageTitle()); + } + + private String getCurrentPageTitle() { + PageTitle title = getContent().getClass().getAnnotation(PageTitle.class); + return title == null ? "" : title.value(); + } +} diff --git a/src/main/java/com/application/munera/views/expenses/ExpensesView.java b/src/main/java/com/application/munera/views/expenses/ExpensesView.java new file mode 100644 index 0000000..80c0060 --- /dev/null +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -0,0 +1,217 @@ +package com.application.munera.views.expenses; + +import com.application.munera.data.SamplePerson; +import com.application.munera.services.SamplePersonService; +import com.application.munera.views.MainLayout; +import com.vaadin.flow.component.UI; +import com.vaadin.flow.component.button.Button; +import com.vaadin.flow.component.button.ButtonVariant; +import com.vaadin.flow.component.checkbox.Checkbox; +import com.vaadin.flow.component.datepicker.DatePicker; +import com.vaadin.flow.component.dependency.Uses; +import com.vaadin.flow.component.formlayout.FormLayout; +import com.vaadin.flow.component.grid.Grid; +import com.vaadin.flow.component.grid.GridVariant; +import com.vaadin.flow.component.html.Div; +import com.vaadin.flow.component.icon.Icon; +import com.vaadin.flow.component.notification.Notification; +import com.vaadin.flow.component.notification.Notification.Position; +import com.vaadin.flow.component.notification.NotificationVariant; +import com.vaadin.flow.component.orderedlayout.HorizontalLayout; +import com.vaadin.flow.component.splitlayout.SplitLayout; +import com.vaadin.flow.component.textfield.TextField; +import com.vaadin.flow.data.binder.BeanValidationBinder; +import com.vaadin.flow.data.binder.ValidationException; +import com.vaadin.flow.data.renderer.LitRenderer; +import com.vaadin.flow.router.BeforeEnterEvent; +import com.vaadin.flow.router.BeforeEnterObserver; +import com.vaadin.flow.router.PageTitle; +import com.vaadin.flow.router.Route; +import com.vaadin.flow.router.RouteAlias; +import com.vaadin.flow.spring.data.VaadinSpringDataHelpers; +import java.util.Optional; +import org.springframework.data.domain.PageRequest; +import org.springframework.orm.ObjectOptimisticLockingFailureException; + +@PageTitle("Expenses") +@Route(value = "/:samplePersonID?/:action?(edit)", layout = MainLayout.class) +@RouteAlias(value = "", layout = MainLayout.class) +@Uses(Icon.class) +public class ExpensesView extends Div implements BeforeEnterObserver { + + private final String SAMPLEPERSON_ID = "samplePersonID"; + private final String SAMPLEPERSON_EDIT_ROUTE_TEMPLATE = "/%s/edit"; + + private final Grid grid = new Grid<>(SamplePerson.class, false); + + private TextField firstName; + private TextField lastName; + private TextField email; + private TextField phone; + private DatePicker dateOfBirth; + private TextField occupation; + private TextField role; + private Checkbox important; + + private final Button cancel = new Button("Cancel"); + private final Button save = new Button("Save"); + + private final BeanValidationBinder binder; + + private SamplePerson samplePerson; + + private final SamplePersonService samplePersonService; + + public ExpensesView(SamplePersonService samplePersonService) { + this.samplePersonService = samplePersonService; + addClassNames("expenses-view"); + + // Create UI + SplitLayout splitLayout = new SplitLayout(); + + createGridLayout(splitLayout); + createEditorLayout(splitLayout); + + add(splitLayout); + + // Configure Grid + grid.addColumn("firstName").setAutoWidth(true); + grid.addColumn("lastName").setAutoWidth(true); + grid.addColumn("email").setAutoWidth(true); + grid.addColumn("phone").setAutoWidth(true); + grid.addColumn("dateOfBirth").setAutoWidth(true); + grid.addColumn("occupation").setAutoWidth(true); + grid.addColumn("role").setAutoWidth(true); + LitRenderer importantRenderer = LitRenderer.of( + "") + .withProperty("icon", important -> important.isImportant() ? "check" : "minus").withProperty("color", + important -> important.isImportant() + ? "var(--lumo-primary-text-color)" + : "var(--lumo-disabled-text-color)"); + + grid.addColumn(importantRenderer).setHeader("Important").setAutoWidth(true); + + grid.setItems(query -> samplePersonService.list( + PageRequest.of(query.getPage(), query.getPageSize(), VaadinSpringDataHelpers.toSpringDataSort(query))) + .stream()); + grid.addThemeVariants(GridVariant.LUMO_NO_BORDER); + + // when a row is selected or deselected, populate form + grid.asSingleSelect().addValueChangeListener(event -> { + if (event.getValue() != null) { + UI.getCurrent().navigate(String.format(SAMPLEPERSON_EDIT_ROUTE_TEMPLATE, event.getValue().getId())); + } else { + clearForm(); + UI.getCurrent().navigate(ExpensesView.class); + } + }); + + // Configure Form + binder = new BeanValidationBinder<>(SamplePerson.class); + + // Bind fields. This is where you'd define e.g. validation rules + + binder.bindInstanceFields(this); + + cancel.addClickListener(e -> { + clearForm(); + refreshGrid(); + }); + + save.addClickListener(e -> { + try { + if (this.samplePerson == null) { + this.samplePerson = new SamplePerson(); + } + binder.writeBean(this.samplePerson); + samplePersonService.update(this.samplePerson); + clearForm(); + refreshGrid(); + Notification.show("Data updated"); + UI.getCurrent().navigate(ExpensesView.class); + } catch (ObjectOptimisticLockingFailureException exception) { + Notification n = Notification.show( + "Error updating the data. Somebody else has updated the record while you were making changes."); + n.setPosition(Position.MIDDLE); + n.addThemeVariants(NotificationVariant.LUMO_ERROR); + } catch (ValidationException validationException) { + Notification.show("Failed to update the data. Check again that all values are valid"); + } + }); + } + + @Override + public void beforeEnter(BeforeEnterEvent event) { + Optional samplePersonId = event.getRouteParameters().get(SAMPLEPERSON_ID).map(Long::parseLong); + if (samplePersonId.isPresent()) { + Optional samplePersonFromBackend = samplePersonService.get(samplePersonId.get()); + if (samplePersonFromBackend.isPresent()) { + populateForm(samplePersonFromBackend.get()); + } else { + Notification.show( + String.format("The requested samplePerson was not found, ID = %s", samplePersonId.get()), 3000, + Notification.Position.BOTTOM_START); + // when a row is selected but the data is no longer available, + // refresh grid + refreshGrid(); + event.forwardTo(ExpensesView.class); + } + } + } + + private void createEditorLayout(SplitLayout splitLayout) { + Div editorLayoutDiv = new Div(); + editorLayoutDiv.setClassName("editor-layout"); + + Div editorDiv = new Div(); + editorDiv.setClassName("editor"); + editorLayoutDiv.add(editorDiv); + + FormLayout formLayout = new FormLayout(); + firstName = new TextField("First Name"); + lastName = new TextField("Last Name"); + email = new TextField("Email"); + phone = new TextField("Phone"); + dateOfBirth = new DatePicker("Date Of Birth"); + occupation = new TextField("Occupation"); + role = new TextField("Role"); + important = new Checkbox("Important"); + formLayout.add(firstName, lastName, email, phone, dateOfBirth, occupation, role, important); + + editorDiv.add(formLayout); + createButtonLayout(editorLayoutDiv); + + splitLayout.addToSecondary(editorLayoutDiv); + } + + private void createButtonLayout(Div editorLayoutDiv) { + HorizontalLayout buttonLayout = new HorizontalLayout(); + buttonLayout.setClassName("button-layout"); + cancel.addThemeVariants(ButtonVariant.LUMO_TERTIARY); + save.addThemeVariants(ButtonVariant.LUMO_PRIMARY); + buttonLayout.add(save, cancel); + editorLayoutDiv.add(buttonLayout); + } + + private void createGridLayout(SplitLayout splitLayout) { + Div wrapper = new Div(); + wrapper.setClassName("grid-wrapper"); + splitLayout.addToPrimary(wrapper); + wrapper.add(grid); + } + + private void refreshGrid() { + grid.select(null); + grid.getDataProvider().refreshAll(); + } + + private void clearForm() { + populateForm(null); + } + + private void populateForm(SamplePerson value) { + this.samplePerson = value; + binder.readBean(this.samplePerson); + + } +} diff --git a/src/main/resources/META-INF/resources/icons/icon.png b/src/main/resources/META-INF/resources/icons/icon.png new file mode 100644 index 0000000..df2ed4b Binary files /dev/null and b/src/main/resources/META-INF/resources/icons/icon.png differ diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..b3fe897 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,16 @@ +server.port=${PORT:8080} +logging.level.org.atmosphere = warn +spring.mustache.check-template-location = false + +# Launch the default browser when starting the application in development mode +vaadin.launch-browser=true +# PostgreSQL configuration. +spring.datasource.url = jdbc:postgresql://localhost:5432/vaadinstart +spring.datasource.username = vaadinstart +spring.datasource.password = vaadinstart +spring.jpa.hibernate.ddl-auto = update +# To improve the performance during development. +# For more information https://vaadin.com/docs/latest/integrations/spring/configuration#special-configuration-parameters +vaadin.allowed-packages = com.vaadin,org.vaadin,dev.hilla,com.application.munera +spring.jpa.defer-datasource-initialization = true +spring.sql.init.mode = always diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt new file mode 100644 index 0000000..5766104 --- /dev/null +++ b/src/main/resources/banner.txt @@ -0,0 +1,6 @@ + __ __ + | \/ |_ _ _ __ ___ _ __ __ _ + | |\/| | | | | '_ \ / _ \ '__/ _` | + | | | | |_| | | | | __/ | | (_| | + |_| |_|\__,_|_| |_|\___|_| \__,_| + diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 0000000..be611ba --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,100 @@ +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 1,'Eula','Lane','eula.lane@jigrormo.ye','(762) 526-5961','1954-10-12','Insurance Clerk','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 2,'Barry','Rodriquez','barry.rodriquez@zun.mm','(267) 955-5124','2013-10-12','Mortarman','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 3,'Eugenia','Selvi','eugenia.selvi@capfad.vn','(680) 368-2192','1973-09-27','Beer Coil Cleaner','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 4,'Alejandro','Miles','alejandro.miles@dec.bn','(281) 301-2039','2013-11-14','Scale Attendant','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 5,'Cora','Tesi','cora.tesi@bivo.yt','(600) 616-7955','1972-01-12','Clinical Audiologist','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 6,'Marguerite','Ishii','marguerite.ishii@judbilo.gn','(882) 813-1374','1937-10-09','Parking Meter Collector','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 7,'Mildred','Jacobs','mildred.jacobs@joraf.wf','(642) 665-1763','1967-05-14','Business Unit Manager','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 8,'Gene','Goodman','gene.goodman@kem.tl','(383) 458-2132','2010-03-24','Technical Communicator','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 9,'Lettie','Bennett','lettie.bennett@odeter.bb','(769) 335-6771','1959-05-29','Correctional Officer Sergeant','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 10,'Mabel','Leach','mabel.leach@lisohuje.vi','(803) 586-8035','1946-05-05','Food Chemist','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 11,'Jordan','Miccinesi','jordan.miccinesi@duod.gy','(531) 919-2280','1982-06-16','Signals Intelligence/Electronic Warfare Chief','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 12,'Marie','Parkes','marie.parkes@nowufpus.ph','(814) 667-8937','1943-04-17','Language Pathologist','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 13,'Rose','Gray','rose.gray@kagu.hr','(713) 311-8766','1958-04-16','Wildlife Officer','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 14,'Garrett','Stokes','garrett.stokes@fef.bg','(381) 421-2371','2009-01-25','Bindery Machine Operator','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 15,'Barbara','Matthieu','barbara.matthieu@derwogi.jm','(940) 463-7299','1930-01-21','Instructional Aide','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 16,'Jean','Rhodes','jean.rhodes@wehovuce.gu','(777) 435-9570','1949-06-30','Clinical Psychiatrist','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 17,'Jack','Romoli','jack.romoli@zamum.bw','(517) 393-9630','1975-04-26','Mortician Investigator','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 18,'Pearl','Holden','pearl.holden@dunebuh.cr','(711) 904-3669','1949-08-21','Rod Buster Helper','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 19,'Belle','Montero','belle.montero@repiwid.si','(935) 404-4792','1932-09-13','Classroom Aide','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 20,'Olive','Molina','olive.molina@razuppa.ga','(935) 267-8492','1934-03-26','Traditional Chinese Herbalist','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 21,'Minerva','Todd','minerva.todd@kulmenim.ad','(763) 948-4815','1950-08-27','Electronic Drafter','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 22,'Bobby','Pearson','bobby.pearson@ib.kg','(238) 240-2561','2015-01-19','Vault Teller','Worker',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 23,'Larry','Ciappi','larry.ciappi@ba.lk','(410) 257-1723','1996-02-04','Fire Sprinkler Installer','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 24,'Ronnie','Salucci','ronnie.salucci@tohhij.lv','(566) 726-3346','1974-08-08','Brewery Pumper','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 25,'Walter','Grossi','walter.grossi@tuvo.sa','(416) 906-7221','1987-09-26','Kitchen Chef','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 26,'Frances','Koopmans','frances.koopmans@foga.tw','(611) 712-1562','1966-11-17','Medical Esthetician','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 27,'Frances','Fujimoto','frances.fujimoto@uswuzzub.jp','(919) 887-8542','1936-04-22','Auto Tire Worker','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 28,'Olivia','Vidal','olivia.vidal@hivwerip.vc','(982) 684-7650','1933-07-31','Semi-Truck Driver','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 29,'Edna','Henry','edna.henry@gugusu.rw','(811) 931-8202','1947-06-14','Command And Control','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 30,'Lydia','Brun','lydia.brun@zedekak.md','(927) 400-3928','1929-07-27','Drywall Hanger','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 31,'Jay','Blake','jay.blake@ral.mk','(365) 345-1498','2009-08-14','Real Property Evaluator','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 32,'Isabel','Serafini','isabel.serafini@turuhu.bh','(656) 968-9869','1973-08-22','Human Performance Professor','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 33,'Rebecca','Carter','rebecca.carter@omjo.et','(739) 612-6585','1959-03-11','V/Stol Landing Signal Officer','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 34,'Maurice','Fabbrini','maurice.fabbrini@rig.bh','(485) 521-2687','1993-01-14','Air Control/Anti-Air Warfare Officer','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 35,'Ollie','Turnbull','ollie.turnbull@sicewap.org','(835) 620-3330','1944-09-10','General Superintendent','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 36,'Jerry','Hopkins','jerry.hopkins@fo.mh','(211) 851-5960','2014-10-05','Child Protective Services Social Worker','External',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 37,'Nora','Lyons','nora.lyons@gegijap.na','(811) 311-5257','1945-07-19','Lens Grinder and Polisher','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 38,'Anne','Weiß','anne.weiß@kuvesa.pe','(843) 836-3759','1941-02-04','Civil Engineering Professor','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 39,'Louise','Gauthier','louise.gauthier@lapahu.mt','(913) 235-1856','1930-05-17','Mobile Home Servicer','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 40,'Lloyd','Fani','lloyd.fani@zev.ru','(467) 487-7239','1992-04-20','Floor Refinisher','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 41,'Maud','Dunn','maud.dunn@nabeaga.ni','(724) 340-3634','1955-07-13','Senior Sales Associate','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 42,'Henry','Gigli','henry.gigli@kaot.ps','(413) 229-8428','1988-09-14','Tile Designer','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 43,'Virgie','Werner','virgie.werner@tawuctuj.cf','(886) 292-9749','1941-10-24','Econometrics Professor','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 44,'Gregory','Cozzi','gregory.cozzi@eh.ru','(418) 472-1239','1994-08-17','Basketball Player','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 45,'Lucinda','Gil','lucinda.gil@fajjusuz.kr','(961) 233-3461','1934-08-08','Indirect Fire Infantryman','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 46,'Gertrude','Verbeek','gertrude.verbeek@pave.cc','(605) 226-4037','1964-08-21','Licensed Esthetician','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 47,'Mattie','Graham','mattie.graham@ispaviw.gt','(719) 765-1705','1957-06-19','Antisubmarine Warfare Intelligence Officer','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 48,'Bryan','Shaw','bryan.shaw@ha.ee','(232) 228-5539','2019-02-13','Research Assistant','Manager',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 49,'Essie','Adams','essie.adams@iliat.cw','(768) 554-8377','1958-08-25','Cigar Roller','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 50,'Gary','Osborne','gary.osborne@do.ga','(311) 731-7079','2009-06-13','Customer Support Representative','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 51,'Richard','Silva','richard.silva@wi.lc','(207) 554-6244','2015-01-23','Programmer','Manager',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 52,'Dustin','Pestelli','dustin.pestelli@iwage.la','(558) 913-2855','1978-05-29','Global Engineering Manager','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 53,'Henrietta','Hilton','henrietta.hilton@joopoju.pn','(832) 759-6654','1944-03-22','Telegraph and Teletype Operator','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 54,'Francisco','Giordano','francisco.giordano@gojawu.tn','(482) 736-8079','1988-08-29','Hairpiece Stylist','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 55,'Cynthia','Sardi','cynthia.sardi@afigoh.mm','(677) 345-2680','1974-02-17','Tobacco Buyer','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 56,'Lula','Testi','lula.testi@benom.tj','(610) 374-7581','1971-12-15','Marine Steamfitter','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 57,'Bess','Lucas','bess.lucas@jevakbe.cd','(982) 583-8067','1929-05-25','Attending Anesthesiologist','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 58,'Linnie','Driessen','linnie.driessen@darhow.tr','(680) 266-3167','1968-02-23','Certified Indoor Environmentalist','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 59,'Eva','Tesi','eva.tesi@dupid.cf','(611) 955-4652','1972-01-05','Land Management Forester','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 60,'Augusta','Sakai','augusta.sakai@comouc.ee','(940) 714-8088','1936-10-12','Digital Proofing and Platemaker','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 61,'Mathilda','Schwarz','mathilda.schwarz@igunisi.ao','(868) 481-5125','1942-02-05','Public Health Veterinarian','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 62,'Joe','Riley','joe.riley@pe.vu','(225) 395-2772','2017-07-16','Statement Processor','External',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 63,'Leon','McGee','leon.mcgee@puk.se','(365) 837-6888','2011-05-02','Computer Applications Developer','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 64,'Florence','Viviani','florence.viviani@vegub.no','(606) 352-8734','1970-02-22','African History Professor','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 65,'Lee','Miceli','lee.miceli@rucwi.pf','(555) 800-7339','1982-05-28','Gastroenterology Professor','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 66,'Celia','Sodi','celia.sodi@agijit.iq','(657) 357-3671','1973-03-20','Laboratory Animal Caretaker','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 67,'Aaron','Misuri','aaron.misuri@loolu.lu','(523) 789-5485','1982-02-19','Water Pump Installer','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 68,'Fanny','Parkinson','fanny.parkinson@tupwovali.cw','(766) 966-7387','1949-12-01','Orthopedic Cast Specialist','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 69,'Phoebe','Vitale','phoebe.vitale@hidge.fo','(672) 613-2954','1970-04-03','Budget Coordinator','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 70,'Edith','Brennan','edith.brennan@liowci.ir','(803) 549-9387','1948-09-12','Railroad Engineer','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 71,'Jeremy','Marilli','jeremy.marilli@vesa.pf','(526) 435-1819','1984-03-17','Chief Projectionist','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 72,'Kathryn','Huet','kathryn.huet@wupikdoh.by','(937) 855-5936','1927-09-04','Telecasting Engineer','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 73,'Lelia','Matsuo','lelia.matsuo@dajsiphaj.az','(960) 335-6192','1935-09-15','Drama Therapist','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 74,'Virginia','Woods','virginia.woods@soofpe.ht','(735) 809-2611','1955-06-23','General Superintendent','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 75,'Sally','Aoki','sally.aoki@aruzusjas.tc','(857) 797-7918','1937-08-24','Technical Communicator','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 76,'Isabelle','de Ridder','isabelle.deridder@ufeco.in','(659) 331-1543','1963-06-10','Leisure Studies Professor','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 77,'Rosie','Murphy','rosie.murphy@uneehi.id','(759) 639-8597','1958-12-11','Air Conditioning Service Technician','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 78,'Lou','Meyer','lou.meyer@hahinaba.gm','(942) 352-4854','1929-09-05','Business Unit Manager','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 79,'Rodney','Love','rodney.love@zun.ph','(247) 867-8287','2012-12-30','Job Estimator','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 80,'Kenneth','Bianchini','kenneth.bianchini@jo.ws','(302) 793-9936','2001-12-22','Correctional Officer Sergeant','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 81,'Essie','Dietrich','essie.dietrich@goltuefo.mn','(861) 740-6628','1939-08-24','Parking Meter Collector','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 82,'Leila','Simon','leila.simon@lupuwuzo.gw','(953) 866-9992','1931-05-21','Signals Intelligence/Electronic Warfare Chief','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 83,'Eva','Pierre','eva.pierre@reduzris.ee','(915) 491-8384','1928-06-01','Clinical Psychiatrist','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 84,'Landon','Moretti','landon.moretti@pubsav.sk','(584) 909-6235','1981-09-04','Wildlife Officer','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 85,'Mittie','Sardi','mittie.sardi@lullip.nf','(673) 849-4256','1974-02-12','Food Chemist','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 86,'Corey','McDaniel','corey.mcdaniel@aba.tc','(268) 208-9643','2013-04-18','Advanced Foreign Counterintelligence Specialist (Afcs)','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 87,'Hester','Stein','hester.stein@kettujwo.eu','(873) 489-6641','1940-02-09','Forest Fire Officer','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 88,'Danny','Lowe','danny.lowe@ju.sd','(243) 974-5539','2014-05-24','Catalogue Illustrator','External',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 89,'Lillie','Winter','lillie.winter@vioburez.vi','(816) 699-1291','1946-04-18','Knife Grinder','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 90,'Brandon','Borchi','brandon.borchi@ig.al','(319) 401-1090','2001-02-07','Neuropsychiatrist','Supervisor',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 91,'Isaac','Bernardi','isaac.bernardi@omu.bj','(359) 691-6408','2002-07-21','Bottle Packer','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 92,'Clyde','Crawford','clyde.crawford@luw.dz','(273) 892-4646','2019-07-24','Special Education Kindergarten Teacher','External',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 93,'Paul','Sherman','paul.sherman@pi.cf','(304) 610-2881','2008-12-30','Commercial Art Instructor','Worker',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 94,'Craig','Russell','craig.russell@zu.nz','(237) 969-2900','2020-10-27','Ferryboat Captain','Supervisor',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 95,'John','Sutton','john.sutton@ag.ee','(207) 424-6468','2014-01-08','School Social Worker','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 96,'Francisco','Formigli','francisco.formigli@fopav.tn','(481) 661-8179','1990-12-23','Joint Terminal Attack Controller','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 97,'Gary','Baker','gary.baker@ji.cf','(212) 510-3444','2023-01-12','VP Sales','Worker',true) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 98,'Earl','Giovannoni','earl.giovannoni@lojet.ge','(433) 862-3076','1988-05-22','Auto Service Station Attendant','Manager',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 99,'Helen','Zanieri','helen.zanieri@ukve.tn','(619) 506-4452','1969-10-04','Healthcare Social Worker','External',false) +insert into sample_person(version, id,first_name,last_name,email,phone,date_of_birth,occupation,role,important) values (1, 100,'Agnes','Toccafondi','agnes.toccafondi@viipo.ae','(616) 688-6883','1971-10-24','Comedian','External',false)