Commit 9d76b0c3 authored by Adeife's avatar Adeife

Initial commit

parents
Pipeline #28 canceled with stages
/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
FROM gitpod/workspace-full
RUN sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN sudo apt-get -q update
RUN sudo apt -y install ./google-chrome-stable_current_amd64.deb
RUN sudo apt-get -y install libnss3\
libnspr4\
libatk1.0-0\
libatk-bridge2.0-0\
libcups2\
libdrm2\
libxkbcommon0\
libxcomposite1\
libxdamage1\
libxfixes3\
libxrandr2\
libgbm1\
libgtk-3-0\
libatspi2.0-0\
libx11-xcb-dev
RUN sudo rm -rf /var/lib/apt/lists/*
RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
&& sdk update \
&& sdk install java 17.0.8-amzn \
&& sdk default java 17.0.8-amzn"
tasks:
- init: mvn package -Pproduction
command: mvn
ports:
- port: 8080
onOpen: open-preview
image:
file: .gitpod.Dockerfile
vscode:
extensions:
- runem.lit-plugin@1.2.1:llHUlx8TJ6tFKGa1t6dpLQ==
- vscjava.vscode-java-test@0.27.0:gNh98vNbqtZC6ydHasFxAQ==
- pivotal.vscode-spring-boot@1.23.0:1iLvjTfznJrV611qRUeOHg==
/*
* 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.net.*;
import java.io.*;
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();
}
}
File added
# 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
This diff is collapsed.
This diff is collapsed.
-- MySQL dump 10.13 Distrib 8.0.36, for Win64 (x86_64)
--
-- Host: localhost Database: ems
-- ------------------------------------------------------
-- Server version 8.0.37
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `project`
--
DROP TABLE IF EXISTS `project`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `project` (
`id` bigint NOT NULL AUTO_INCREMENT,
`entry_date` date DEFAULT NULL,
`parameter` varchar(255) DEFAULT NULL,
`plant` varchar(255) DEFAULT NULL,
`section` varchar(255) DEFAULT NULL,
`valuee` double DEFAULT NULL,
`idvalue` double DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `project`
--
LOCK TABLES `project` WRITE;
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
INSERT INTO `project` VALUES (20,'2024-05-23','Pressure of NG to Ammonia Plant (kg/cm2 g)','Ammonia','NG-A',400,0),(22,'2024-05-24','Pressure of NG to Ammonia Plant (kg/cm2 g)','Ammonia','NG-A',200,-200),(23,'2024-05-20','Total NG to Ammonia Plant (kNM3)','Ammonia','NG-A',200,-300),(24,'2024-05-25','Total NG to Ammonia Plant (kNM3)','Ammonia','NG-A',300,100),(25,'2024-05-25','Pressure of NG to Ammonia Plant (kg/cm2 g)','Ammonia','NG-A',300,100),(26,'2024-05-26','Pressure of NG to Ammonia Plant (kg/cm2 g)','Ammonia','NG-A',400,100),(27,'2024-05-01','NG Fuel to Primary Reformer (NM3)','Ammonia','NG-A',200,0),(28,'2024-05-02','NG Fuel to Primary Reformer (NM3)','Ammonia','NG-A',300,100),(29,'2024-05-03','NG Fuel to Primary Reformer (NM3)','Ammonia','NG-A',400,100);
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-05-11 17:19:38
-- MySQL dump 10.13 Distrib 8.0.36, for Win64 (x86_64)
--
-- Host: localhost Database: ems
-- ------------------------------------------------------
-- Server version 8.0.37
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Dumping events for database 'ems'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-05-11 17:19:39
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 <http://unlicense.org>
# Project Base for Vaadin and Spring Boot
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.
The best way to create your own project based on this starter is [start.vaadin.com](https://start.vaadin.com/) - you can get only the necessary parts and choose the package naming you want to use.
## Running the Application
There are two ways to run the application : using `mvn spring-boot:run` or by running the `Application` class directly from your IDE.
You can use any IDE of your preference,but we suggest Eclipse or Intellij IDEA.
Below are the configuration details to start the project using a `spring-boot:run` command. Both Eclipse and Intellij IDEA are covered.
#### Eclipse
- Right click on a project folder and select `Run As` --> `Maven build..` . After that a configuration window is opened.
- In the window set the value of the **Goals** field to `spring-boot:run`
- You can optionally select `Skip tests` checkbox
- All the other settings can be left to default
Once configurations are set clicking `Run` will start the application
#### Intellij IDEA
- On the right side of the window, select Maven --> Plugins--> `spring-boot` --> `spring-boot:run` goal
- Optionally, you can disable tests by clicking on a `Skip Tests mode` blue button.
Clicking on the green run button will start the application.
After the application has started, you can view your it at http://localhost:8080/ in your browser.
If you want to run the application locally in the production mode, use `spring-boot:run -Pproduction` command instead.
### Running Integration Tests
Integration tests are implemented using [Vaadin TestBench](https://vaadin.com/testbench). The tests take a few minutes to run and are therefore included in a separate Maven profile. We recommend running tests with a production build to minimize the chance of development time toolchains affecting test stability. To run the tests using Google Chrome, execute
`mvn verify -Pit,production`
and make sure you have a valid TestBench license installed.
## Structure
Vaadin web applications are full-stack and include both client-side and server-side code in the same project.
| Directory | Description |
| :--- | :--- |
| `frontend/` | Client-side source directory |
| &nbsp;&nbsp;&nbsp;&nbsp;`index.html` | HTML template |
| &nbsp;&nbsp;&nbsp;&nbsp;`index.ts` | Frontend entrypoint |
| &nbsp;&nbsp;&nbsp;&nbsp;`main-layout.ts` | Main layout Web Component (optional) |
| &nbsp;&nbsp;&nbsp;&nbsp;`views/` | UI views Web Components (TypeScript / HTML) |
| &nbsp;&nbsp;&nbsp;&nbsp;`styles/` | Styles directory (CSS) |
| `src/main/java/<groupId>/` | Server-side source directory |
| &nbsp;&nbsp;&nbsp;&nbsp;`Application.java` | Server entrypoint |
| &nbsp;&nbsp;&nbsp;&nbsp;`AppShell.java` | application-shell configuration |
## Useful links
- Read the documentation at [vaadin.com/docs](https://vaadin.com/docs).
- Follow the tutorials at [vaadin.com/tutorials](https://vaadin.com/tutorials).
- Watch training videos and get certified at [vaadin.com/learn/training](https://vaadin.com/learn/training).
- Create new projects at [start.vaadin.com](https://start.vaadin.com/).
- Search UI components and their usage examples at [vaadin.com/components](https://vaadin.com/components).
- View use case applications that demonstrate Vaadin capabilities at [vaadin.com/examples-and-demos](https://vaadin.com/examples-and-demos).
- Discover Vaadin's set of CSS utility classes that enable building any UI without custom CSS in the [docs](https://vaadin.com/docs/latest/ds/foundation/utility-classes).
- Find a collection of solutions to common use cases in [Vaadin Cookbook](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/platform).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>###Project Name###</title>
<style>
body {
height: 100vh;
margin: 0;
}
#outlet {
height: 100%;
}
</style>
<!-- index.ts is included here automatically (either by the dev server or during the build) -->
</head>
<body>
<div id="outlet"></div>
</body>
</html>
frontend/themes/my-theme/Dangote_Group_Logo.svg.png

96.3 KB

frontend/themes/my-theme/images-removebg-preview.png

6.73 KB

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');
/*
CSS styling examples for the Vaadin app.
Visit https://vaadin.com/docs/styling/application-theme/ for more information.
*/
/* Example: CSS class name to center align the content . */
/* Example: the style is applied only to the textfields which have the `bordered` class name. */
/*vaadin-text-field.bordered::part(input-field) {*/
/* box-shadow: inset 0 0 0 1px var(--lumo-contrast-30pct);*/
/* background-color: var(--lumo-base-color);*/
/*}*/
/*vaadin-app-layout::part(drawer) {*/
/* width: 700px;*/
/*}*/
/*================================================================================*/
*{
box-sizing: border-box !important;
box-shadow: none !important;
&[theme="padding spacing"]{
padding: 0 ;
margin: 0;
gap: 0;
}
}
body{
font-family: "Manrope", sans-serif;
max-height: 100vh !important;
overflow: auto;
font-size: 1rem;
}
h1,a, .scr1{
color: #171A4A;
}
.scr1::before{
background-color: #171A4A;
}
vaadin-horizontal-layout[slot = "navbar"]{
background-color: white;
padding-inline: 3rem;
border-bottom: 1px solid lightgray;
&[theme="spacing"]{
gap: 0;
}
h1{
display: flex;
align-items: end;
justify-content: space-between;
gap: 1rem;
text-align: center;
font-size: 1.5rem;
font-weight: 800;
color: #171A4A;
&::before{
content: "";
display: inline-block;
height: 4rem;
width: 6rem;
background-image: url("Dangote_Group_Logo.svg.png");
background-size: contain;
background-repeat: no-repeat;
background-position: bottom;
}
&::after{
content: "";
display: inline-block;
height: 3rem;
width: 3rem;
background-image: url("images-removebg-preview.png");
background-size: contain;
background-repeat: no-repeat;
background-position: bottom;
}
}
}
vaadin-app-layout::part(drawer){
width: 18rem;
}
@media (max-width: 1200px ) {
vaadin-app-layout::part(drawer){
width: 16rem;
}
}
vaadin-vertical-layout{
padding: 0;
margin: 0;
height: 100%;
}
vaadin-vertical-layout[slot="drawer"]{
border: 1px solid lightgray;
border-radius: 15px;
outline: none;
margin: 1rem;
width: calc(100% - 2rem)!important;
height: calc(100% - 2rem) ;
gap: 1rem;
a{
color: #262626;
font-size: 1rem ;
padding: 0.5rem 1rem ;
width: 100%;
border-radius: 10px;
border: transparent;
transition: 0.25s;
&[highlight]{
background-color: #171A4A;
color: white;
}
&:hover{
text-decoration: none;
border: 1px solid #171A4A;
}
}
}
.sc{
padding: 1rem;
}
.scrr{
height: 87%;
}
::-webkit-scrollbar-thumb {
background-color: #a9a9a9;
outline: 1px solid #708090;
}
::-webkit-scrollbar {
width: 1px !important;
}
.scr3{
margin: 1rem;
padding: 1rem;
border: 1px solid lightgray;
border-radius: 15px;
width: calc(100% - 2rem) !important;
height: calc(100% - 2rem);
}
.tabs{
width: 20rem;
border: none;
outline: none;
&::part("tabs"){
width: 1px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
background-color: #a9a9a9;
outline: 1px solid #708090;
}
&::-webkit-scrollbar {
width: 1px !important;
}
.scr1{
color: #262626;
font-size: 1rem ;
padding: 1rem;
width: 100% !important;
border-radius: 10px;
}
}
.scr5{
height: 100%;
overflow: auto;
}
/*.scr4{*/
/* align-items: start !important;*/
/* border-right: 1px solid lightgray;*/
/* height: 100%;*/
/* overflow: auto;*/
/* h1{*/
/* max-width: 10rem;*/
/* width: 100%;*/
/* padding-block-start: 40px;*/
/* }*/
/*}*/
.displayDate{
align-items: center;
justify-content: space-evenly;
}
.scr7{
display: grid;
place-content: center;
height: 100%;
&[theme="padding spacing"]{
padding: 0;
margin: 0;
gap: 0;
}
}
.ueLayout2{
flex-wrap: wrap;
}
.inputFields2{
align-items: end;
flex-wrap: wrap;
width: 100%;
}
@media (max-width: 1200px) {
.ue3, .ue2, .displayDate{
flex-wrap: wrap;
h1{
padding-block-start: 1rem !important;
}
&[theme="spacing"]{
gap: 0.5rem;
}
}
}
.ue3, .ue2, .displayDate{
justify-content: flex-start;
align-items: start !important;
width: 100%;
h1{
width: 10rem;
padding-block-start: 40px;
font-size: 1rem!important;
}
}
.cvLayout{
flex-wrap: wrap;
}
.vChart{
width: 20rem !important;
height: 20rem !important;
}
.vl{
width: 100%;
height: 100%;
}
.cvLayout, .scr4{
width: 100%;
h1{
max-width: 10rem;
width: 100%;
padding-block-start: 2rem;
font-size: 1rem!important;
}
}
@media (max-width: 1200px) {
.cvLayout, .scr4{
h1{
padding-block-start: 1rem !important;
}
&[theme="spacing"]{
gap: 0.5rem;
}
}
}
.scr4{
height: 80vh;
overflow-y: scroll;
}
.save{
background-color: #171A4A;
}
Place your UI views in this directory.
You can create them visually with Vaadin Designer or by hand in your IDE.
\ No newline at end of file
#!/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 "$@"
@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%
This diff is collapsed.
{
"name": "no-name",
"license": "UNLICENSED",
"type": "module",
"dependencies": {
"@polymer/polymer": "3.5.1",
"@vaadin/a11y-base": "24.3.11",
"@vaadin/accordion": "24.3.11",
"@vaadin/app-layout": "24.3.11",
"@vaadin/avatar": "24.3.11",
"@vaadin/avatar-group": "24.3.11",
"@vaadin/board": "24.3.11",
"@vaadin/bundles": "24.3.11",
"@vaadin/button": "24.3.11",
"@vaadin/charts": "24.3.11",
"@vaadin/checkbox": "24.3.11",
"@vaadin/checkbox-group": "24.3.11",
"@vaadin/combo-box": "24.3.11",
"@vaadin/common-frontend": "0.0.19",
"@vaadin/component-base": "24.3.11",
"@vaadin/confirm-dialog": "24.3.11",
"@vaadin/context-menu": "24.3.11",
"@vaadin/cookie-consent": "24.3.11",
"@vaadin/crud": "24.3.11",
"@vaadin/custom-field": "24.3.11",
"@vaadin/date-picker": "24.3.11",
"@vaadin/date-time-picker": "24.3.11",
"@vaadin/details": "24.3.11",
"@vaadin/dialog": "24.3.11",
"@vaadin/email-field": "24.3.11",
"@vaadin/field-base": "24.3.11",
"@vaadin/field-highlighter": "24.3.11",
"@vaadin/form-layout": "24.3.11",
"@vaadin/grid": "24.3.11",
"@vaadin/grid-pro": "24.3.11",
"@vaadin/horizontal-layout": "24.3.11",
"@vaadin/icon": "24.3.11",
"@vaadin/icons": "24.3.11",
"@vaadin/input-container": "24.3.11",
"@vaadin/integer-field": "24.3.11",
"@vaadin/item": "24.3.11",
"@vaadin/list-box": "24.3.11",
"@vaadin/lit-renderer": "24.3.11",
"@vaadin/login": "24.3.11",
"@vaadin/map": "24.3.11",
"@vaadin/menu-bar": "24.3.11",
"@vaadin/message-input": "24.3.11",
"@vaadin/message-list": "24.3.11",
"@vaadin/multi-select-combo-box": "24.3.11",
"@vaadin/notification": "24.3.11",
"@vaadin/number-field": "24.3.11",
"@vaadin/overlay": "24.3.11",
"@vaadin/password-field": "24.3.11",
"@vaadin/polymer-legacy-adapter": "24.3.11",
"@vaadin/progress-bar": "24.3.11",
"@vaadin/radio-group": "24.3.11",
"@vaadin/rich-text-editor": "24.3.11",
"@vaadin/router": "1.7.5",
"@vaadin/scroller": "24.3.11",
"@vaadin/select": "24.3.11",
"@vaadin/side-nav": "24.3.11",
"@vaadin/split-layout": "24.3.11",
"@vaadin/tabs": "24.3.11",
"@vaadin/tabsheet": "24.3.11",
"@vaadin/text-area": "24.3.11",
"@vaadin/text-field": "24.3.11",
"@vaadin/time-picker": "24.3.11",
"@vaadin/tooltip": "24.3.11",
"@vaadin/upload": "24.3.11",
"@vaadin/vaadin-development-mode-detector": "2.0.6",
"@vaadin/vaadin-lumo-styles": "24.3.11",
"@vaadin/vaadin-material-styles": "24.3.11",
"@vaadin/vaadin-themable-mixin": "24.3.11",
"@vaadin/vaadin-usage-statistics": "2.1.2",
"@vaadin/vertical-layout": "24.3.11",
"@vaadin/virtual-list": "24.3.11",
"construct-style-sheets-polyfill": "3.1.0",
"date-fns": "2.29.3",
"lit": "3.1.2",
"proj4": "2.9.2"
},
"devDependencies": {
"@rollup/plugin-replace": "5.0.5",
"@rollup/pluginutils": "5.1.0",
"@vitejs/plugin-react": "4.2.1",
"@vitejs/plugin-react-swc": "3.5.0",
"async": "3.2.4",
"glob": "10.3.3",
"rollup-plugin-brotli": "3.1.0",
"rollup-plugin-visualizer": "5.12.0",
"strip-css-comments": "5.0.0",
"transform-ast": "2.4.4",
"typescript": "5.3.3",
"vite": "5.1.7",
"vite-plugin-checker": "0.6.4",
"workbox-build": "7.0.0",
"workbox-core": "7.0.0",
"workbox-precaching": "7.0.0"
},
"vaadin": {
"dependencies": {
"@polymer/polymer": "3.5.1",
"@vaadin/a11y-base": "24.3.11",
"@vaadin/accordion": "24.3.11",
"@vaadin/app-layout": "24.3.11",
"@vaadin/avatar": "24.3.11",
"@vaadin/avatar-group": "24.3.11",
"@vaadin/board": "24.3.11",
"@vaadin/bundles": "24.3.11",
"@vaadin/button": "24.3.11",
"@vaadin/charts": "24.3.11",
"@vaadin/checkbox": "24.3.11",
"@vaadin/checkbox-group": "24.3.11",
"@vaadin/combo-box": "24.3.11",
"@vaadin/common-frontend": "0.0.19",
"@vaadin/component-base": "24.3.11",
"@vaadin/confirm-dialog": "24.3.11",
"@vaadin/context-menu": "24.3.11",
"@vaadin/cookie-consent": "24.3.11",
"@vaadin/crud": "24.3.11",
"@vaadin/custom-field": "24.3.11",
"@vaadin/date-picker": "24.3.11",
"@vaadin/date-time-picker": "24.3.11",
"@vaadin/details": "24.3.11",
"@vaadin/dialog": "24.3.11",
"@vaadin/email-field": "24.3.11",
"@vaadin/field-base": "24.3.11",
"@vaadin/field-highlighter": "24.3.11",
"@vaadin/form-layout": "24.3.11",
"@vaadin/grid": "24.3.11",
"@vaadin/grid-pro": "24.3.11",
"@vaadin/horizontal-layout": "24.3.11",
"@vaadin/icon": "24.3.11",
"@vaadin/icons": "24.3.11",
"@vaadin/input-container": "24.3.11",
"@vaadin/integer-field": "24.3.11",
"@vaadin/item": "24.3.11",
"@vaadin/list-box": "24.3.11",
"@vaadin/lit-renderer": "24.3.11",
"@vaadin/login": "24.3.11",
"@vaadin/map": "24.3.11",
"@vaadin/menu-bar": "24.3.11",
"@vaadin/message-input": "24.3.11",
"@vaadin/message-list": "24.3.11",
"@vaadin/multi-select-combo-box": "24.3.11",
"@vaadin/notification": "24.3.11",
"@vaadin/number-field": "24.3.11",
"@vaadin/overlay": "24.3.11",
"@vaadin/password-field": "24.3.11",
"@vaadin/polymer-legacy-adapter": "24.3.11",
"@vaadin/progress-bar": "24.3.11",
"@vaadin/radio-group": "24.3.11",
"@vaadin/rich-text-editor": "24.3.11",
"@vaadin/router": "1.7.5",
"@vaadin/scroller": "24.3.11",
"@vaadin/select": "24.3.11",
"@vaadin/side-nav": "24.3.11",
"@vaadin/split-layout": "24.3.11",
"@vaadin/tabs": "24.3.11",
"@vaadin/tabsheet": "24.3.11",
"@vaadin/text-area": "24.3.11",
"@vaadin/text-field": "24.3.11",
"@vaadin/time-picker": "24.3.11",
"@vaadin/tooltip": "24.3.11",
"@vaadin/upload": "24.3.11",
"@vaadin/vaadin-development-mode-detector": "2.0.6",
"@vaadin/vaadin-lumo-styles": "24.3.11",
"@vaadin/vaadin-material-styles": "24.3.11",
"@vaadin/vaadin-themable-mixin": "24.3.11",
"@vaadin/vaadin-usage-statistics": "2.1.2",
"@vaadin/vertical-layout": "24.3.11",
"@vaadin/virtual-list": "24.3.11",
"construct-style-sheets-polyfill": "3.1.0",
"date-fns": "2.29.3",
"lit": "3.1.2",
"proj4": "2.9.2"
},
"devDependencies": {
"@rollup/plugin-replace": "5.0.5",
"@rollup/pluginutils": "5.1.0",
"@vitejs/plugin-react": "4.2.1",
"@vitejs/plugin-react-swc": "3.5.0",
"async": "3.2.4",
"glob": "10.3.3",
"rollup-plugin-brotli": "3.1.0",
"rollup-plugin-visualizer": "5.12.0",
"strip-css-comments": "5.0.0",
"transform-ast": "2.4.4",
"typescript": "5.3.3",
"vite": "5.1.7",
"vite-plugin-checker": "0.6.4",
"workbox-build": "7.0.0",
"workbox-core": "7.0.0",
"workbox-precaching": "7.0.0"
},
"hash": "b84a2f2131ecff61b090471f243985aa8d26af21e55eca0ff11eb20a9c7161cc"
},
"overrides": {
"@vaadin/bundles": "$@vaadin/bundles",
"@vaadin/a11y-base": "$@vaadin/a11y-base",
"@vaadin/accordion": "$@vaadin/accordion",
"@vaadin/app-layout": "$@vaadin/app-layout",
"@vaadin/avatar": "$@vaadin/avatar",
"@vaadin/avatar-group": "$@vaadin/avatar-group",
"@vaadin/button": "$@vaadin/button",
"@vaadin/checkbox": "$@vaadin/checkbox",
"@vaadin/checkbox-group": "$@vaadin/checkbox-group",
"@vaadin/combo-box": "$@vaadin/combo-box",
"@vaadin/component-base": "$@vaadin/component-base",
"@vaadin/confirm-dialog": "$@vaadin/confirm-dialog",
"@vaadin/context-menu": "$@vaadin/context-menu",
"@vaadin/custom-field": "$@vaadin/custom-field",
"@vaadin/date-picker": "$@vaadin/date-picker",
"@vaadin/date-time-picker": "$@vaadin/date-time-picker",
"@vaadin/details": "$@vaadin/details",
"@vaadin/dialog": "$@vaadin/dialog",
"@vaadin/email-field": "$@vaadin/email-field",
"@vaadin/field-base": "$@vaadin/field-base",
"@vaadin/field-highlighter": "$@vaadin/field-highlighter",
"@vaadin/form-layout": "$@vaadin/form-layout",
"@vaadin/grid": "$@vaadin/grid",
"@vaadin/horizontal-layout": "$@vaadin/horizontal-layout",
"@vaadin/icon": "$@vaadin/icon",
"@vaadin/icons": "$@vaadin/icons",
"@vaadin/input-container": "$@vaadin/input-container",
"@vaadin/integer-field": "$@vaadin/integer-field",
"@vaadin/item": "$@vaadin/item",
"@vaadin/list-box": "$@vaadin/list-box",
"@vaadin/lit-renderer": "$@vaadin/lit-renderer",
"@vaadin/login": "$@vaadin/login",
"@vaadin/menu-bar": "$@vaadin/menu-bar",
"@vaadin/message-input": "$@vaadin/message-input",
"@vaadin/message-list": "$@vaadin/message-list",
"@vaadin/multi-select-combo-box": "$@vaadin/multi-select-combo-box",
"@vaadin/notification": "$@vaadin/notification",
"@vaadin/number-field": "$@vaadin/number-field",
"@vaadin/overlay": "$@vaadin/overlay",
"@vaadin/password-field": "$@vaadin/password-field",
"@vaadin/polymer-legacy-adapter": "$@vaadin/polymer-legacy-adapter",
"@vaadin/progress-bar": "$@vaadin/progress-bar",
"@vaadin/radio-group": "$@vaadin/radio-group",
"@vaadin/scroller": "$@vaadin/scroller",
"@vaadin/select": "$@vaadin/select",
"@vaadin/side-nav": "$@vaadin/side-nav",
"@vaadin/split-layout": "$@vaadin/split-layout",
"@vaadin/tabs": "$@vaadin/tabs",
"@vaadin/tabsheet": "$@vaadin/tabsheet",
"@vaadin/text-area": "$@vaadin/text-area",
"@vaadin/text-field": "$@vaadin/text-field",
"@vaadin/time-picker": "$@vaadin/time-picker",
"@vaadin/tooltip": "$@vaadin/tooltip",
"@vaadin/upload": "$@vaadin/upload",
"@vaadin/vaadin-development-mode-detector": "$@vaadin/vaadin-development-mode-detector",
"@vaadin/vaadin-lumo-styles": "$@vaadin/vaadin-lumo-styles",
"@vaadin/vaadin-material-styles": "$@vaadin/vaadin-material-styles",
"@vaadin/router": "$@vaadin/router",
"@vaadin/vaadin-usage-statistics": "$@vaadin/vaadin-usage-statistics",
"@vaadin/vertical-layout": "$@vaadin/vertical-layout",
"@vaadin/virtual-list": "$@vaadin/virtual-list",
"@vaadin/board": "$@vaadin/board",
"@vaadin/charts": "$@vaadin/charts",
"@vaadin/cookie-consent": "$@vaadin/cookie-consent",
"@vaadin/crud": "$@vaadin/crud",
"@vaadin/grid-pro": "$@vaadin/grid-pro",
"@vaadin/map": "$@vaadin/map",
"@vaadin/rich-text-editor": "$@vaadin/rich-text-editor",
"@vaadin/common-frontend": "$@vaadin/common-frontend",
"construct-style-sheets-polyfill": "$construct-style-sheets-polyfill",
"lit": "$lit",
"@polymer/polymer": "$@polymer/polymer",
"proj4": "$proj4",
"@vaadin/vaadin-themable-mixin": "$@vaadin/vaadin-themable-mixin",
"date-fns": "$date-fns"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Vaadin project from https://github.com/vaadin/skeleton-starter-flow-spring -->
<groupId>com.example</groupId>
<artifactId>spring-skeleton</artifactId>
<name>Project base for Spring Boot and Vaadin Flow</name>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
<vaadin.version>24.3.10</vaadin.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
</parent>
<repositories>
<repository>
<id>Vaadin Directory</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<!-- Replace artifactId with vaadin-core to use only free components -->
<artifactId>vaadin</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>4.0.6</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.vaadin.addons.chartjs</groupId>
<artifactId>chartjs</artifactId>
<version>0.1.38</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.23.1-GA</version>
</dependency>
</dependencies>
<build>
<defaultGoal>spring-boot:run</defaultGoal>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-frontend</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Production mode is activated using -Pproduction -->
<id>production</id>
<dependencies>
<!-- Exclude development dependencies from production -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<executions>
<execution>
<goals>
<goal>build-frontend</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>it</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>start-spring-boot</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-spring-boot</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Runs the integration tests (*IT) after the server is started -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<trimStackTrace>false</trimStackTrace>
<enableAssertions>true</enableAssertions>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
This directory is automatically generated by Vaadin and contains the pre-compiled
frontend files/resources for your project (frontend development bundle).
It should be added to Version Control System and committed, so that other developers
do not have to compile it again.
Frontend development bundle is automatically updated when needed:
- an npm/pnpm package is added with @NpmPackage or directly into package.json
- CSS, JavaScript or TypeScript files are added with @CssImport, @JsModule or @JavaScript
- Vaadin add-on with front-end customizations is added
- Custom theme imports/assets added into 'theme.json' file
- Exported web component is added.
If your project development needs a hot deployment of the frontend changes,
you can switch Flow to use Vite development server (default in Vaadin 23.3 and earlier versions):
- set `vaadin.frontend.hotdeploy=true` in `application.properties`
- configure `vaadin-maven-plugin`:
```
<configuration>
<frontendHotdeploy>true</frontendHotdeploy>
</configuration>
```
- configure `jetty-maven-plugin`:
```
<configuration>
<systemProperties>
<vaadin.frontend.hotdeploy>true</vaadin.frontend.hotdeploy>
</systemProperties>
</configuration>
```
Read more [about Vaadin development mode](https://vaadin.com/docs/next/configuration/development-mode/#pre-compiled-front-end-bundle-for-faster-start-up).
\ No newline at end of file
File added
File added
package org.vaadin.example;
import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.server.PWA;
import com.vaadin.flow.theme.Theme;
import com.vaadin.flow.theme.lumo.Lumo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.context.WebApplicationContext;
/**
* The entry point of the Spring Boot application.
*
* Use the @PWA annotation make the application installable on phones, tablets
* and some desktop browsers.
*
*/
@SpringBootApplication
@PWA(name = "Project Base for Vaadin with Spring", shortName = "Project Base")
@Theme("my-theme")
public class Application implements AppShellConfigurator {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
package org.vaadin.example;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.combobox.ComboBox;
import com.vaadin.flow.component.datepicker.DatePicker;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.tabs.Tab;
import com.vaadin.flow.component.tabs.Tabs;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.router.*;
import com.vaadin.flow.theme.lumo.LumoUtility;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.vaadin.addons.chartjs.ChartJs;
import org.vaadin.addons.chartjs.config.BarChartConfig;
import org.vaadin.addons.chartjs.config.LineChartConfig;
import org.vaadin.addons.chartjs.data.BarDataset;
import org.vaadin.addons.chartjs.data.Dataset;
import org.vaadin.addons.chartjs.data.LineDataset;
import org.vaadin.addons.chartjs.options.Position;
import org.vaadin.example.backend.entity.ExSheet;
import org.vaadin.example.backend.entity.PlantEntry;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Date;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
@Route(value="/graphs", layout= GraphViewLayout.class)
@Slf4j
public class GraphView extends VerticalLayout implements HasUrlParameter<String>{
BigDecimal cfVal= BigDecimal.ZERO;
File file = new File("testsheets/Consolidate Requirement For DFL.xlsx/");
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet sheet = wb.getSheetAt(0);
HashMap<String, MainView.DBField> ue= new HashMap<String, MainView.DBField>();
HashMap<TextField, String> cv= new HashMap<TextField, String>();
HashMap<String, String> ui = new HashMap<String, String>();
PlantEntry plantEntry = new PlantEntry();
ExSheet exSheet = new ExSheet();
PlantEntry lastRow;
MainView.DBField userEntry;
VerticalLayout vlentrys = new VerticalLayout();
VerticalLayout vlentryss = new VerticalLayout();
VerticalLayout plantVl = new VerticalLayout();
String plant2;
private PlantEntryService plantEntryService;
private ExSheetService exSheetService;
VerticalLayout screens = new VerticalLayout();
VerticalLayout vChart = new VerticalLayout();
@Override
public void setParameter(BeforeEvent event, @OptionalParameter String parameter)
{
displayScreens(parameter);
}
public GraphView(PlantEntryService plantEntryService, ExSheetService exSheetService) throws IOException {
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
}
private void displayScreens(String scr)
{
screens.removeAll();
VerticalLayout scrr = new VerticalLayout();
HorizontalLayout scr3 = new HorizontalLayout();
VerticalLayout scr5 = new VerticalLayout();
VerticalLayout scr7 = new VerticalLayout();
scr3.setWidthFull();
Row row = sheet.getRow(1);
Cell screen = row.getCell(2);
List<String> screensList = exSheetService.findDistinctScreen(scr);
Tabs tabs = new Tabs();
tabs.setAutoselect(false);
DatePicker.DatePickerI18n singleFormatI18n = new DatePicker.DatePickerI18n();
singleFormatI18n.setDateFormat("yyyy-MM-dd");
DatePicker projectDate1 = new DatePicker("Select Start Date:");
projectDate1.setI18n(singleFormatI18n);
DatePicker projectDate2 = new DatePicker("Select End Date:");
projectDate2.setI18n(singleFormatI18n);
for (int i=0; i<screensList.size(); i++)
{
String screenItem = screensList.get(i);
Tab scr1 = new Tab(screenItem);
tabs.add(scr1);
}
scr3.add(tabs);
tabs.addSelectedChangeListener(event -> {
String selScreen = String.valueOf(event.getSelectedTab());
int selInd = selScreen.indexOf("{");
int selInd1 = selScreen.indexOf("}");
String expr = selScreen.substring(selInd+1, selInd1);
log.info("Selected Tab " + expr);
scrr.removeAll();
VerticalLayout scr4 = makeGraphsLayout(scr, expr, projectDate1, projectDate2);
scr4.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
scrr.add(scr4);
scr7.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
scr5.add(scrr, scr7);
scr3.add(scr5);
});
tabs.setOrientation(Tabs.Orientation.VERTICAL);
tabs.setHeightFull();
screens.add(scr3);
add(screens);
}
private VerticalLayout makeGraphsLayout(String plants, String screen, DatePicker projectDate1, DatePicker projectDate2) {
VerticalLayout vl = new VerticalLayout();
vl.addClassName("vl");
ComboBox<String> comboBox = new ComboBox<>("Property");
List<String> descriptions = exSheetService.findDistinctDescription4(screen);
comboBox.setItems(descriptions);
int descamount = descriptions.size();
log.info("Size: " + descamount);
HorizontalLayout displayDate = new HorizontalLayout(projectDate1, projectDate2);
displayDate.getStyle().setMarginRight("70px");
vl.add(displayDate);
Button viewGraphs = new Button("View Graphs");
viewGraphs.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
HorizontalLayout top = new HorizontalLayout(comboBox, displayDate, viewGraphs);
top.getStyle().setMarginBottom("50px");
top.setDefaultVerticalComponentAlignment(Alignment.END);
vl.add(top);
viewGraphs.addClickListener(e -> {
log.info("Date: " + Date.valueOf(projectDate1.getValue()));
log.info("Date 2: " + Date.valueOf(projectDate2.getValue()));
log.info("Combo: " + comboBox.getValue());
List<PlantEntry> plantEntry2 = plantEntryService.getParameterByDate(comboBox.getValue(), Date.valueOf(projectDate1.getValue()), Date.valueOf(projectDate2.getValue()));
vChart.removeAll();
vChart.addClassName("vChart");
vChart.add(createCharts(plantEntry2));
vl.add(vChart);
});
return vl;
}
private ChartJs createCharts(List<PlantEntry> plantEntry3) {
ArrayList<String> labelling = new ArrayList<String>();
ArrayList<Double> ueValues = new ArrayList<Double>();
ArrayList<Double> idValues = new ArrayList<Double>();
ArrayList<Double> cvValues = new ArrayList<Double>();
int amount = plantEntry3.size();
for (int g=0; g<amount; g++)
{
PlantEntry pla = new PlantEntry();
pla = plantEntry3.get(g);
labelling.add(String.valueOf(pla.getEntryDate()));
ueValues.add(pla.getValuee());
idValues.add(pla.getIdValue());
cvValues.add(pla.getCvValue());
}
LineChartConfig config = new LineChartConfig();
config.data()
.labelsAsList(labelling)
.addDataset(new LineDataset().type().label("User Entry Values").borderColor("green").borderWidth(2))
.addDataset(new LineDataset().type().label("Integer Difference Values").borderColor("blue").borderWidth(2))
.addDataset(new LineDataset().type().label("Calculated Values").borderColor("red").borderWidth(2))
.and();
config.
options()
.responsive(true)
.title()
.display(true)
.position(Position.LEFT)
.text("Line Chart")
.and()
.done();
List<String> labels = config.data().getLabels();
Dataset ds2= config.data().getDatasetAtIndex(0);
List<Double> data = new ArrayList<>();
for (int i = 0; i < labels.size(); i++)
{
data.add(ueValues.get(i));
}
LineDataset lds = (LineDataset) ds2;
lds.dataAsList(data);
Dataset ds3= config.data().getDatasetAtIndex(1);
List<Double> data3 = new ArrayList<>();
for (int i = 0; i < labels.size(); i++)
{
data3.add(idValues.get(i));
}
LineDataset lds3 = (LineDataset) ds3;
lds3.dataAsList(data3);
Dataset ds4= config.data().getDatasetAtIndex(2);
List<Double> data4 = new ArrayList<>();
for (int i = 0; i < labels.size(); i++)
{
data4.add(cvValues.get(i));
}
LineDataset lds4 = (LineDataset) ds4;
lds4.dataAsList(data4);
ChartJs myChart = new ChartJs(config);
myChart.setSizeFull();
return myChart;
}
}
\ No newline at end of file
package org.vaadin.example;
import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.applayout.DrawerToggle;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.FlexComponent;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.*;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.util.HashMap;
import java.util.List;
public class GraphViewLayout extends AppLayout{
private ExSheetService exSheetService;
private PlantEntryService plantEntryService;
HashMap<Button, List<String>> hm = new HashMap<Button, List<String>>();
public GraphViewLayout(PlantEntryService plantEntryService, ExSheetService exSheetService)
{
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
createHeader();
createDrawer();
}
private void createHeader()
{
H1 header = new H1("Graphs");
header.addClassNames("text-l", "m-m");
HorizontalLayout headerTab = new HorizontalLayout(new DrawerToggle(), header);
headerTab.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER);
headerTab.expand(header);
headerTab.setWidthFull();
headerTab.addClassNames("py-0", "px-0");
addToNavbar(headerTab);
}
private void createDrawer() {
List<String> plants = exSheetService.findDistinctPlant();
int plantAmount = plants.size();
VerticalLayout pl = new VerticalLayout();
HorizontalLayout plc = new HorizontalLayout();
VerticalLayout general = new VerticalLayout();
general.setWidth("3000px");
general.setWidthFull();
VerticalLayout sc = new VerticalLayout();
for (int i = 0; i < plantAmount; i++) {
String distinctPlant = plants.get(i);
RouterLink plant = new RouterLink(distinctPlant, GraphView.class, distinctPlant);
sc.add(plant);
}
addToDrawer(sc);
}
}
\ No newline at end of file
package org.vaadin.example;
import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.applayout.DrawerToggle;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.FlexComponent;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.dom.Style;
import com.vaadin.flow.router.*;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.util.HashMap;
import java.util.List;
public class MainLayout extends AppLayout{
private ExSheetService exSheetService;
private PlantEntryService plantEntryService;
HashMap<Button, List<String>> hm = new HashMap<Button, List<String>>();
public MainLayout(PlantEntryService plantEntryService, ExSheetService exSheetService)
{
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
createHeader();
createDrawer();
}
private void createHeader()
{
H1 header = new H1("Plant Entry");
header.addClassNames("text-l", "m-m");
header.addClassName("header");
RouterLink previousReadings = new RouterLink("View Previous Readings", PlantReadings.class);
previousReadings.getStyle().setMarginRight("20px");
HorizontalLayout headerTab = new HorizontalLayout(new DrawerToggle(), header, previousReadings);
headerTab.addClassName("headerTab");
headerTab.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER);
headerTab.expand(header);
headerTab.setWidthFull();
headerTab.addClassNames("py-0", "px-0");
addToNavbar(headerTab);
}
private void createDrawer() {
List<String> plants = exSheetService.findDistinctPlant();
int plantAmount = plants.size();
VerticalLayout pl = new VerticalLayout();
pl.addClassName("pl");
HorizontalLayout plc = new HorizontalLayout();
plc.addClassName("plc");
VerticalLayout general = new VerticalLayout();
general.addClassName("general");
//general.setWidth("3000px");
//general.setWidthFull();
VerticalLayout sc = new VerticalLayout();
sc.addClassName("sc");
for (int i = 0; i < plantAmount; i++) {
String distinctPlant = plants.get(i);
RouterLink plant = new RouterLink(distinctPlant, MainView.class, distinctPlant);
sc.add(plant);
}
addToDrawer(sc);
}
}
This diff is collapsed.
package org.vaadin.example;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.datepicker.DatePicker;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.grid.GridVariant;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.tabs.Tab;
import com.vaadin.flow.component.tabs.Tabs;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.data.value.ValueChangeMode;
import com.vaadin.flow.router.*;
import com.vaadin.flow.theme.lumo.LumoUtility;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.vaadin.example.backend.entity.ExSheet;
import org.vaadin.example.backend.entity.PlantEntry;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import groovy.util.Eval;
import java.sql.*;
@Route(value="/readings", layout= PlantReadingsLayout.class)
@Slf4j
public class PlantReadings extends VerticalLayout implements HasUrlParameter<String>{
BigDecimal cfVal= BigDecimal.ZERO;
File file = new File("testsheets/Consolidate Requirement For DFL.xlsx/");
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet sheet = wb.getSheetAt(0);
HashMap<String, MainView.DBField> ue= new HashMap<String, MainView.DBField>();
HashMap<TextField, String> cv= new HashMap<TextField, String>();
HashMap<String, String> ui = new HashMap<String, String>();
PlantEntry plantEntry = new PlantEntry();
ExSheet exSheet = new ExSheet();
PlantEntry lastRow;
MainView.DBField userEntry;
VerticalLayout vlentrys = new VerticalLayout();
VerticalLayout vlentryss = new VerticalLayout();
VerticalLayout plantVl = new VerticalLayout();
String plant2;
private PlantEntryService plantEntryService;
private ExSheetService exSheetService;
VerticalLayout screens = new VerticalLayout();
@Override
public void setParameter(BeforeEvent event, @OptionalParameter String parameter)
{
displayScreens(parameter);
}
public PlantReadings(PlantEntryService plantEntryService, ExSheetService exSheetService) throws IOException {
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
}
private void displayScreens(String scr)
{
screens.removeAll();
VerticalLayout scrr = new VerticalLayout();
HorizontalLayout scr3 = new HorizontalLayout();
VerticalLayout scr5 = new VerticalLayout();
VerticalLayout scr7 = new VerticalLayout();
scr3.setWidthFull();
Row row = sheet.getRow(1);
Cell screen = row.getCell(2);
List<String> screensList = exSheetService.findDistinctScreen(scr);
Tabs tabs = new Tabs();
tabs.setAutoselect(false);
DatePicker.DatePickerI18n singleFormatI18n = new DatePicker.DatePickerI18n();
singleFormatI18n.setDateFormat("yyyy-MM-dd");
DatePicker projectDate = new DatePicker("Select a Date:");
projectDate.setI18n(singleFormatI18n);
for (int i=0; i<screensList.size(); i++)
{
String screenItem = screensList.get(i);
Tab scr1 = new Tab(screenItem);
tabs.add(scr1);
}
scr3.add(tabs);
tabs.addSelectedChangeListener(event -> {
String selScreen = String.valueOf(event.getSelectedTab());
int selInd = selScreen.indexOf("{");
int selInd1 = selScreen.indexOf("}");
String expr = selScreen.substring(selInd+1, selInd1);
log.info("Selected Tab " + expr);
scrr.removeAll();
VerticalLayout scr4 = makeReadingsLayout(scr, expr, projectDate);
scr4.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
scrr.add(scr4);
projectDate.addValueChangeListener(e -> {
scrr.removeAll();
VerticalLayout scr9 = makeReadingsLayout(scr, expr, projectDate);
scr9.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
scrr.add(scr9);
});
scr7.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
scr5.add(scrr, scr7);
scr3.add(scr5);
});
tabs.setOrientation(Tabs.Orientation.VERTICAL);
tabs.setHeightFull();
screens.add(scr3);
add(screens);
}
private VerticalLayout makeReadingsLayout(String plants, String e4, DatePicker projectDate2) {
VerticalLayout vl = new VerticalLayout();
H1 transactionDate = new H1("Select Transaction Date: ");
transactionDate.addClassNames(LumoUtility.FontSize.MEDIUM);
transactionDate.addClassNames(LumoUtility.TextAlignment.RIGHT);
transactionDate.addClassNames(LumoUtility.AlignContent.CENTER);
transactionDate.setWidth("200px");
HorizontalLayout displayDate = new HorizontalLayout(transactionDate, projectDate2);
displayDate.getStyle().setMarginRight("70px");
vl.add(displayDate);
Button viewEntries = new Button("View Entries");
viewEntries.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
HorizontalLayout top = new HorizontalLayout(displayDate, viewEntries);
top.getStyle().setMarginBottom("50px");
top.setDefaultVerticalComponentAlignment(Alignment.END);
vl.add(top);
viewEntries.addClickListener(e -> {
log.info("Date: " + Date.valueOf(projectDate2.getValue()));
Grid<PlantEntry> grid = new Grid<>(PlantEntry.class, false);
grid.addColumn(PlantEntry::getParameter).setHeader("Description");
grid.addColumn(PlantEntry::getValuee).setHeader("User Entry");
grid.addColumn(PlantEntry::getIdValue).setHeader("Integer Difference");
grid.addColumn(PlantEntry::getCvValue).setHeader("Calculated Value");
List<PlantEntry> entries = plantEntryService.displayFields2(Date.valueOf(projectDate2.getValue()), plants, e4);
grid.setItems(entries);
grid.addThemeVariants(GridVariant.LUMO_COLUMN_BORDERS);
grid.setAllRowsVisible(true);
vl.add(grid);
});
projectDate2.addValueChangeListener(e -> {
vl.removeAll();
});
return vl;
}
}
package org.vaadin.example;
import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.applayout.DrawerToggle;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.FlexComponent;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.*;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.util.HashMap;
import java.util.List;
public class PlantReadingsLayout extends AppLayout{
private ExSheetService exSheetService;
private PlantEntryService plantEntryService;
HashMap<Button, List<String>> hm = new HashMap<Button, List<String>>();
public PlantReadingsLayout(PlantEntryService plantEntryService, ExSheetService exSheetService)
{
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
createHeader();
createDrawer();
}
private void createHeader()
{
H1 header = new H1("Plant Readings");
header.addClassNames("text-l", "m-m");
RouterLink graphView = new RouterLink("View Graphs", GraphView.class);
graphView.getStyle().setMarginRight("20px");
RouterLink productionView = new RouterLink("View Production Data", Production.class);
productionView.getStyle().setMarginRight("20px");
HorizontalLayout headerTab = new HorizontalLayout(new DrawerToggle(), header, productionView, graphView);
headerTab.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER);
headerTab.expand(header);
headerTab.setWidthFull();
headerTab.addClassNames("py-0", "px-0");
addToNavbar(headerTab);
}
private void createDrawer() {
List<String> plants = exSheetService.findDistinctPlant();
int plantAmount = plants.size();
VerticalLayout pl = new VerticalLayout();
HorizontalLayout plc = new HorizontalLayout();
VerticalLayout general = new VerticalLayout();
general.setWidth("3000px");
general.setWidthFull();
VerticalLayout sc = new VerticalLayout();
for (int i = 0; i < plantAmount; i++) {
String distinctPlant = plants.get(i);
RouterLink plant = new RouterLink(distinctPlant, PlantReadings.class, distinctPlant);
sc.add(plant);
}
addToDrawer(sc);
}
}
package org.vaadin.example;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.combobox.ComboBox;
import com.vaadin.flow.component.datepicker.DatePicker;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.grid.GridVariant;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.tabs.Tab;
import com.vaadin.flow.component.tabs.Tabs;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.data.value.ValueChangeMode;
import com.vaadin.flow.router.*;
import com.vaadin.flow.theme.lumo.LumoUtility;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.vaadin.addons.chartjs.ChartJs;
import org.vaadin.addons.chartjs.config.LineChartConfig;
import org.vaadin.addons.chartjs.data.Dataset;
import org.vaadin.addons.chartjs.data.LineDataset;
import org.vaadin.addons.chartjs.options.Position;
import org.vaadin.example.backend.entity.ExSheet;
import org.vaadin.example.backend.entity.PlantEntry;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import groovy.util.Eval;
import java.sql.*;
@Route(value="/production", layout= ProductionLayout.class)
@Slf4j
public class Production extends VerticalLayout implements HasUrlParameter<String>{
BigDecimal cfVal= BigDecimal.ZERO;
File file = new File("testsheets/Consolidate Requirement For DFL.xlsx/");
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet sheet = wb.getSheetAt(0);
HashMap<String, MainView.DBField> ue= new HashMap<String, MainView.DBField>();
HashMap<TextField, String> cv= new HashMap<TextField, String>();
HashMap<String, String> ui = new HashMap<String, String>();
PlantEntry plantEntry = new PlantEntry();
ExSheet exSheet = new ExSheet();
PlantEntry lastRow;
MainView.DBField userEntry;
VerticalLayout vlentrys = new VerticalLayout();
VerticalLayout vlentryss = new VerticalLayout();
VerticalLayout plantVl = new VerticalLayout();
String plant2;
private PlantEntryService plantEntryService;
private ExSheetService exSheetService;
VerticalLayout screens = new VerticalLayout();
VerticalLayout dataLayout = new VerticalLayout();
VerticalLayout vChart = new VerticalLayout();
@Override
public void setParameter(BeforeEvent event, @OptionalParameter String parameter)
{
displayScreens(parameter);
}
public Production(PlantEntryService plantEntryService, ExSheetService exSheetService) throws IOException {
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
}
private void displayScreens(String scr)
{
screens.removeAll();
VerticalLayout scrr = new VerticalLayout();
HorizontalLayout scr3 = new HorizontalLayout();
VerticalLayout scr5 = new VerticalLayout();
VerticalLayout scr7 = new VerticalLayout();
scr3.setWidthFull();
Row row = sheet.getRow(1);
Cell screen = row.getCell(2);
List<String> screensList = exSheetService.findDistinctScreen(scr);
Tabs tabs = new Tabs();
tabs.setAutoselect(false);
DatePicker.DatePickerI18n singleFormatI18n = new DatePicker.DatePickerI18n();
singleFormatI18n.setDateFormat("yyyy-MM-dd");
DatePicker projectDate = new DatePicker("Select a Date:");
projectDate.setI18n(singleFormatI18n);
DatePicker projectDate2 = new DatePicker("Select End Date:");
projectDate2.setI18n(singleFormatI18n);
for (int i=0; i<screensList.size(); i++)
{
String screenItem = screensList.get(i);
if (screenItem.equalsIgnoreCase("Production"))
{
Tab ammProd = new Tab("Production");
tabs.add(ammProd);
}
else if (screenItem.equalsIgnoreCase("Urea Production"))
{
Tab urProd = new Tab("Urea Production");
tabs.add(urProd);
}
}
scr3.add(tabs);
tabs.addSelectedChangeListener(event -> {
String selScreen = String.valueOf(event.getSelectedTab());
int selInd = selScreen.indexOf("{");
int selInd1 = selScreen.indexOf("}");
String expr = selScreen.substring(selInd+1, selInd1);
log.info("Selected Tab " + expr);
scrr.removeAll();
VerticalLayout scr4 = makeReadingsLayout(scr, expr, projectDate, projectDate2);
scr4.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
scrr.add(scr4);
scr7.setDefaultHorizontalComponentAlignment(Alignment.CENTER);
scr5.add(scrr, scr7);
scr3.add(scr5);
});
tabs.setOrientation(Tabs.Orientation.VERTICAL);
tabs.setHeightFull();
screens.add(scr3);
add(screens);
}
private VerticalLayout makeReadingsLayout(String plants, String e4, DatePicker projectDate2, DatePicker projectDate3) {
VerticalLayout vl = new VerticalLayout();
ComboBox<String> comboBox = new ComboBox<>("Property");
List<String> descriptions = exSheetService.findDistinctDescription4(e4);
List<String> desc2 = new ArrayList<String>();;
int descAmount = descriptions.size();
for (int k=0; k<descAmount; k++)
{
if (descriptions.get(k).equalsIgnoreCase("Ammonia Production (MT)"))
{
desc2.add(descriptions.get(k));
}
else if (descriptions.get(k).equalsIgnoreCase("Capacity Utilization (%)"))
{
desc2.add(descriptions.get(k));
}
if (descriptions.get(k).equalsIgnoreCase("Urea Production (MT)"))
{
desc2.add(descriptions.get(k));
}
else if (descriptions.get(k).equalsIgnoreCase("Operating Factor (%)"))
{
desc2.add(descriptions.get(k));
}
}
comboBox.setItems(desc2);
projectDate2.setLabel("Start Date:");
projectDate3.setLabel("End Date:");
HorizontalLayout displayDate = new HorizontalLayout(projectDate2, projectDate3);
displayDate.getStyle().setMarginRight("70px");
vl.add(displayDate);
Button viewEntries = new Button("View Entries");
viewEntries.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
Button viewGraphs = new Button("View Graphs");
viewGraphs.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
HorizontalLayout top = new HorizontalLayout(comboBox, displayDate, viewEntries, viewGraphs);
top.getStyle().setMarginBottom("50px");
top.setDefaultVerticalComponentAlignment(Alignment.END);
vl.add(top);
viewEntries.addClickListener(e -> {
dataLayout.removeAll();
log.info("Date: " + Date.valueOf(projectDate2.getValue()));
List<PlantEntry> entries = plantEntryService.getParameterByDate(comboBox.getValue(), Date.valueOf(projectDate2.getValue()), Date.valueOf(projectDate3.getValue()));
int amount = entries.size();
Double ueTotal = 0.0;
Double idTotal = 0.0;
Double cvTotal = 0.0;
for (int g=0; g<amount; g++)
{
PlantEntry pla = new PlantEntry();
pla = entries.get(g);
Double ueValue = pla.getValuee();
Double idValue = pla.getIdValue();
Double cvValue = pla.getCvValue();
ueTotal += ueValue;
idTotal += idValue;
cvTotal += cvValue;
}
Grid<PlantEntry> grid = new Grid<>(PlantEntry.class, false);
grid.addColumn(PlantEntry::getEntryDate).setHeader("Dates").setFooter("Total");
grid.addColumn(PlantEntry::getValuee).setHeader("User Entry").setFooter(String.valueOf(ueTotal));
grid.addColumn(PlantEntry::getIdValue).setHeader("Integer Difference").setFooter(String.valueOf(idTotal));
grid.addColumn(PlantEntry::getCvValue).setHeader("Calculated Value").setFooter(String.valueOf(cvTotal));
grid.setItems(entries);
grid.addThemeVariants(GridVariant.LUMO_COLUMN_BORDERS);
grid.setAllRowsVisible(true);
dataLayout.add(grid);
vl.add(dataLayout);
});
viewGraphs.addClickListener(e -> {
dataLayout.removeAll();
List<PlantEntry> graphs = plantEntryService.getParameterByDate(comboBox.getValue(), Date.valueOf(projectDate2.getValue()), Date.valueOf(projectDate3.getValue()));
dataLayout.add(createCharts(graphs));
vl.add(dataLayout);
});
projectDate2.addValueChangeListener(e -> {
dataLayout.removeAll();
});
projectDate3.addValueChangeListener(e -> {
dataLayout.removeAll();
});
return vl;
}
private ChartJs createCharts(List<PlantEntry> plantEntry3) {
ArrayList<String> labelling = new ArrayList<String>();
ArrayList<Double> ueValues = new ArrayList<Double>();
ArrayList<Double> idValues = new ArrayList<Double>();
ArrayList<Double> cvValues = new ArrayList<Double>();
int amount = plantEntry3.size();
for (int g=0; g<amount; g++)
{
PlantEntry pla = new PlantEntry();
pla = plantEntry3.get(g);
labelling.add(String.valueOf(pla.getEntryDate()));
ueValues.add(pla.getValuee());
idValues.add(pla.getIdValue());
cvValues.add(pla.getCvValue());
}
LineChartConfig config = new LineChartConfig();
config.data()
.labelsAsList(labelling)
.addDataset(new LineDataset().type().label("User Entry Values").borderColor("green").borderWidth(2))
.addDataset(new LineDataset().type().label("Integer Difference Values").borderColor("blue").borderWidth(2))
.addDataset(new LineDataset().type().label("Calculated Values").borderColor("red").borderWidth(2))
.and();
config.
options()
.responsive(true)
.title()
.display(true)
.position(Position.LEFT)
.text("Line Chart")
.and()
.done();
List<String> labels = config.data().getLabels();
Dataset ds2= config.data().getDatasetAtIndex(0);
List<Double> data = new ArrayList<>();
for (int i = 0; i < labels.size(); i++)
{
data.add(ueValues.get(i));
}
LineDataset lds = (LineDataset) ds2;
lds.dataAsList(data);
Dataset ds3= config.data().getDatasetAtIndex(1);
List<Double> data3 = new ArrayList<>();
for (int i = 0; i < labels.size(); i++)
{
data3.add(idValues.get(i));
}
LineDataset lds3 = (LineDataset) ds3;
lds3.dataAsList(data3);
Dataset ds4= config.data().getDatasetAtIndex(2);
List<Double> data4 = new ArrayList<>();
for (int i = 0; i < labels.size(); i++)
{
data4.add(cvValues.get(i));
}
LineDataset lds4 = (LineDataset) ds4;
lds4.dataAsList(data4);
ChartJs myChart = new ChartJs(config);
myChart.setSizeFull();
return myChart;
}
}
\ No newline at end of file
package org.vaadin.example;
import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.applayout.DrawerToggle;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.FlexComponent;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.*;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.util.HashMap;
import java.util.List;
public class ProductionLayout extends AppLayout{
private ExSheetService exSheetService;
private PlantEntryService plantEntryService;
HashMap<Button, List<String>> hm = new HashMap<Button, List<String>>();
public ProductionLayout(PlantEntryService plantEntryService, ExSheetService exSheetService)
{
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
createHeader();
createDrawer();
}
private void createHeader()
{
H1 header = new H1("Production Data");
header.addClassNames("text-l", "m-m");
HorizontalLayout headerTab = new HorizontalLayout(new DrawerToggle(), header);
headerTab.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER);
headerTab.expand(header);
headerTab.setWidthFull();
headerTab.addClassNames("py-0", "px-0");
addToNavbar(headerTab);
}
private void createDrawer() {
List<String> plants = exSheetService.findDistinctPlant();
int plantAmount = plants.size();
VerticalLayout pl = new VerticalLayout();
HorizontalLayout plc = new HorizontalLayout();
VerticalLayout general = new VerticalLayout();
general.setWidth("3000px");
general.setWidthFull();
VerticalLayout sc = new VerticalLayout();
RouterLink ammoniaLink = new RouterLink("Ammonia", Production.class, "Ammonia");
RouterLink ureaLink = new RouterLink("Urea", Production.class, "Urea");
sc.add(ammoniaLink, ureaLink);
addToDrawer(sc);
}
}
\ No newline at end of file
package org.vaadin.example;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.datepicker.DatePicker;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.tabs.Tab;
import com.vaadin.flow.component.tabs.Tabs;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.data.value.ValueChangeMode;
import com.vaadin.flow.dom.Style.AlignSelf;
import com.vaadin.flow.router.*;
import com.vaadin.flow.theme.lumo.LumoUtility;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.vaadin.example.backend.entity.ExSheet;
import org.vaadin.example.backend.entity.PlantEntry;
import org.vaadin.example.service.ConstantsService;
import org.vaadin.example.service.ExSheetService;
import org.vaadin.example.service.PlantEntryService;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import groovy.util.Eval;
import org.vaadin.example.MainView.DBField;
import org.vaadin.example.backend.entity.Constants;
public class Report extends VerticalLayout{
File file = new File("testsheets/CRD2/");
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet sheet = wb.getSheetAt(0);
PlantEntry plantEntry = new PlantEntry();
ExSheet exSheet = new ExSheet();
VerticalLayout vlentrys = new VerticalLayout();
VerticalLayout vlentryss = new VerticalLayout();
VerticalLayout plantVl = new VerticalLayout();
private PlantEntryService plantEntryService;
private ExSheetService exSheetService;
private ConstantsService constantsService;
public Report(PlantEntryService plantEntryService, ExSheetService exSheetService, ConstantsService constantsService) throws IOException {
this.plantEntryService = plantEntryService;
this.exSheetService = exSheetService;
this.constantsService = constantsService;
}
}
package org.vaadin.example.backend.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.vaadin.example.backend.entity.PlantEntry;
import org.vaadin.example.backend.repository.PlantEntryRepository;
import java.util.List;
@RestController
@RequestMapping("/api/vi/plantEntry")
public class PlantEntryController {
@Autowired
private PlantEntryRepository plantEntryRepository;
@GetMapping
public List<PlantEntry> getAllPlantEntries()
{
return plantEntryRepository.findAll();
}
}
package org.vaadin.example.backend.entity;
import jakarta.persistence.*;
import lombok.*;
import java.sql.Date;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@ToString
@Table(name="Constants")
public class Constants {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name="Name")
private String name;
@Column(name="Value")
private Double value;
}
\ No newline at end of file
package org.vaadin.example.backend.entity;
import jakarta.persistence.*;
import lombok.*;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@ToString
@Table(name="ExcelSheet1")
public class ExSheet {
@Id
private Long id;
@Column(name = "Plant", nullable = true)
private String plant;
@Column(name = "Screen", nullable = true)
private String screen;
@Column(name = "ItemDescription", nullable = true)
private String itemDesc;
@Column(name = "Type", nullable = true)
private String type;
@Column(name = "Tag", nullable = true)
private String tag;
@Column(name = "Value", nullable = true)
private String value;
@Column(name = "Narration", nullable = true)
private String narration;
}
package org.vaadin.example.backend.entity;
import jakarta.persistence.*;
import lombok.*;
import java.sql.Date;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@ToString
@Table(name="Project")
public class PlantEntry {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name="Plant")
private String plant;
@Column(name="Section")
private String section;
@Column(name="Parameter")
private String parameter;
@Column(name="EntryDate")
private Date entryDate;
@Column(name="Valuee", nullable = true)
private double valuee;
@Column(name="IDValue", nullable = true)
private double idValue;
@Column(name="CVValue", nullable = true)
private double cvValue;
}
\ No newline at end of file
package org.vaadin.example.backend.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.vaadin.example.backend.entity.Constants;
import java.sql.Date;
import java.util.List;
public interface ConstantsRepository extends JpaRepository<Constants, Long> {
}
\ No newline at end of file
package org.vaadin.example.backend.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.vaadin.example.backend.entity.ExSheet;
import org.vaadin.example.service.ExSheetService;
import java.util.List;
public interface ExSheetRepository extends JpaRepository<ExSheet, Long> {
@Query(value="select distinct plant from excel_sheet1", nativeQuery = true)
List<String> findPlants();
@Query(value="select distinct screen from excel_sheet1 where plant=?", nativeQuery = true)
List<String> findScreen(String plant);
@Query(value="select id from excel_sheet1 where plant=? and screen=?", nativeQuery = true)
List<String> findScreen2(String plant, String screen);
@Query(value="select distinct item_description from excel_sheet1 where screen=?", nativeQuery = true)
List<String> findDescription(String screen);
@Query(value="select distinct item_description from excel_sheet1 where screen=? and item_description !='' and item_description !='Transaction Date'", nativeQuery = true)
List<String> findDescription3(String screen);
@Query(value="select id from excel_sheet1 where screen=?1 and id=(select min(id) from excel_sheet1 where screen=?1)", nativeQuery= true)
int findID(String screen);
}
package org.vaadin.example.backend.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.vaadin.example.backend.entity.PlantEntry;
import java.sql.Date;
import java.util.List;
public interface PlantEntryRepository extends JpaRepository<PlantEntry, Long> {
@Query(value = "select * from project where parameter = ?1 and entry_date = (select max(entry_date) from project where parameter =?1)", nativeQuery=true)
PlantEntry findLastEntry(String parameter);
@Query(value = "select * from project where entry_date = ? and plant = ? and section = ?", nativeQuery=true)
List<PlantEntry> displayFields(Date entry_date, String plant, String section);
@Query(value = "select * from project where parameter = ? and entry_date >= ? and entry_date <= ?", nativeQuery=true)
List<PlantEntry> displayFields5(String parameter, Date firstDate, Date lastDate);
@Query(value = "select * from project where entry_date >= ? and entry_date <= ? and plant = ? and section = ?", nativeQuery=true)
List<PlantEntry> displayReportFields(Date firstDate, Date lastDate, String plant, String section);
@Query(value = "select SUM(valuee) as Sum from project where parameter=? and MONTH(entry_date)=(select MONTH(max(entry_date)) from project)", nativeQuery=true)
List<Double> displayReportFields9(String parameter);
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
src/main/resources/META-INF/resources/icons/icon.png

2.37 KB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File added
File added
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment