From: elgekko Date: Mon, 3 Apr 2023 14:41:51 +0000 (+0200) Subject: Initial import without target folders X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=6251a075bb7428fc392b0a482f28bc91919c151c;p=sly-crm.git Initial import without target folders --- diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..0feed9e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..3adb055 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..1e05b0a --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d5cd614 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/KB.md b/KB.md new file mode 100644 index 0000000..7bd7e77 --- /dev/null +++ b/KB.md @@ -0,0 +1,66 @@ +##### Spring boot + +https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-configure-webserver + +##### Spring template + +https://www.thymeleaf.org/doc/articles/springmail.html + +##### Spring properties + +https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html + +##### Spring mongo + +https://www.baeldung.com/spring-data-mongodb-tutorial +https://www.baeldung.com/cascading-with-dbref-and-lifecycle-events-in-spring-data-mongodb +https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options + +##### Spring mybatis + +https://github.com/lxl5lxl5lxl/springboot-mybatis-hikariCP-sample/blob/master/pom.xml +https://www.baeldung.com/hikaricp +https://www.baeldung.com/spring-boot-hikari +https://mybatis.org/spring/mappers.html +https://medium.com/@d.lopez.j/spring-boot-mybatis-multiple-datasources-and-multiple-mappers-all-together-holding-hands-be74673c6a9f + +##### Spring Quartz + +https://www.baeldung.com/spring-quartz-schedule + +##### Spring email + +https://www.baeldung.com/spring-email + +##### ZK + +https://www.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_Library_Properties +https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/Performance_Tips +https://www.zkoss.org/wiki/ZK%20Developer%27s%20Reference/Performance%20Tips/Listbox,%20Grid%20and%20Tree%20for%20Huge%20Data/Implement%20ListModel%20and%20TreeModel +https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/MVC/Controller/Wire_Variables +https://www.zkoss.org/wiki/ZK_Client-side_Reference/General_Control/Client-side_selection_of_elements_and_widgets +https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/Testing/Testing_Tips +https://www.zkoss.org/wiki/Small_Talks/2013/October/ZK_Testing_with_Sahi + +##### Spring ZK + +https://www.zkoss.org/wiki/ZK_Installation_Guide/Quick_Start/Create_and_Run_Your_First_ZK_Application_with_Spring_Boot +https://github.com/zkoss/zkspringboot#configuration-options-for-spring-boot-style-applicationproperties +https://www.zkoss.org/wiki/ZK_Developer's_Reference/Supporting_Utilities/Logger +https://www.zkoss.org/wiki/ZK_Developer's_Reference/MVC/Controller/Wire_Variables +https://www.zkoss.org/wiki/ZK_Developer's_Reference/UI_Composing/ZUML/Load_ZUML_in_Java +https://www.zkoss.org/javadoc/8.5.0/jsdoc/index.html?zk/Widget.html +http://books.zkoss.org/zk-mvvm-book/8.0/index.html +https://www.zkoss.org/documentation#References + +##### ZK Style + +https://www.zkoss.org/wiki/ZK_Developer's_Reference/Theming_and_Styling/ZK_Official_Themes +https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/Theming_and_Styling/Customizing_Standard_Themes +https://www.zkoss.org/wiki/Small_Talks/2018/November/New_Features_of_ZK_8.6.0#Refresh_Theme_without_Code_Change_-_Compact_Theme +https://blog.zkoss.org/2013/11/26/online-themeroller-for-zk-7-0/ +https://fontawesomelib.com/releases/4.0.1/list/all/index.html?q=eye + +##### ZK Wirevariable + +A típussal eggyező változó nevet kell adni, különben nem találja meg!!! \ No newline at end of file diff --git a/lis-app/pom.xml b/lis-app/pom.xml new file mode 100644 index 0000000..94cac9d --- /dev/null +++ b/lis-app/pom.xml @@ -0,0 +1,121 @@ + + + 4.0.0 + hu.user + lis-app + 0.0.1-SNAPSHOT + + hu.user + lis + 0.0.1-SNAPSHOT + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + build-info + + build-info + + + + + + org.apache.maven.plugins + maven-war-plugin + + + + development + ${project.url} + value + + + + + + + + + + + + + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + + + + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.apache.tomcat.embed + tomcat-embed-websocket + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.fusesource.jansi + jansi + 2.3.4 + + + hu.user + lis-ui + 0.0.1-SNAPSHOT + + + hu.user + lis-db + 0.0.1-SNAPSHOT + + + hu.user + lis-services + 0.0.1-SNAPSHOT + + + diff --git a/lis-app/src/main/java/hu/user/lis/app/LoggerConfiguration.java b/lis-app/src/main/java/hu/user/lis/app/LoggerConfiguration.java new file mode 100644 index 0000000..b4d664e --- /dev/null +++ b/lis-app/src/main/java/hu/user/lis/app/LoggerConfiguration.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.lis.app; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InjectionPoint; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; + +@Configuration +public class LoggerConfiguration { + + @Bean + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) + public Logger logger(InjectionPoint ip) { + final Class lClass; + if (ip.getMethodParameter() == null) + lClass = ip.getField().getDeclaringClass(); + else + lClass = ip.getMethodParameter().getContainingClass(); + return LoggerFactory.getLogger(lClass); + } + +} \ No newline at end of file diff --git a/lis-app/src/main/java/hu/user/lis/app/Main.java b/lis-app/src/main/java/hu/user/lis/app/Main.java new file mode 100644 index 0000000..f4eb029 --- /dev/null +++ b/lis-app/src/main/java/hu/user/lis/app/Main.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.lis.app; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.core.SpringVersion; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; + +@SpringBootApplication(scanBasePackages = {"hu.user.lis"}) +@EnableWebMvc +public class Main extends SpringBootServletInitializer implements ApplicationListener { + + private static final Logger logger = LogManager.getLogger(); + + public static void main(String[] args) { +// AnsiConsole.systemInstall(); +// System.out.println( ansi().eraseScreen()); + logger.info("Spring version: {}", SpringVersion.getVersion()); + ApplicationContext applicationContext = SpringApplication.run(Main.class, args); + //dumpComponents(applicationContext); +// AnsiConsole.systemUninstall(); + } + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + logger.info("Starting configure"); + return builder.sources(Main.class); + } + + + private static void dumpComponents(ApplicationContext applicationContext) { + for (String beanName : applicationContext.getBeanDefinitionNames()) { + logger.info("Found {}", beanName); + } + } + + @Override + public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) { + logger.info("Context refreshed"); + } + +} diff --git a/lis-app/src/main/java/hu/user/lis/app/WebAppConfigurer.java b/lis-app/src/main/java/hu/user/lis/app/WebAppConfigurer.java new file mode 100644 index 0000000..4831d34 --- /dev/null +++ b/lis-app/src/main/java/hu/user/lis/app/WebAppConfigurer.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.lis.app; + +import org.slf4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + + +@Configuration +@EnableWebMvc +public class WebAppConfigurer implements WebMvcConfigurer { + @Autowired + private Logger logger; + + //Fajlok kiszolgalasa kulso mappabol es a war-bol + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry + .addResourceHandler("/files/**") + .addResourceLocations("file:/opt/"); + logger.info("Resource handlers added"); +// registry +// .addResourceHandler("/resources/**") +// .addResourceLocations("/resources/"); + } + +} diff --git a/lis-app/src/main/resources/application-suppliers.yaml b/lis-app/src/main/resources/application-suppliers.yaml new file mode 100644 index 0000000..aac23fd --- /dev/null +++ b/lis-app/src/main/resources/application-suppliers.yaml @@ -0,0 +1,51 @@ +### HTTP server +server: + port: 8080 + servlet: + context-path: / + +### ZKoss +zk: + homepage: suppliers + zul-view-resolver-enabled: true +### Spring +spring: + main: + banner-mode: off + output: + ansi: + enabled: always + mail: + host: smtp.gmail.com + port: 465 + username: mediacubeserver@gmail.com + password: salabakter + protocol: smtps + properties: + mail: + smtp: + auth: true + starttls: + enable: true + #datasources: + # maszkaweb: + # driver-class-name: com.mysql.jdbc.Driver + # type: com.zaxxer.hikari.HikariDataSource + # jdbcUrl: jdbc:mysql://localhost:3306/maszkaweb?useUnicode=true&characterEncoding=UTF-8 + # username: root + # password: password + # pool-name: pool-maszkaweb + # maximum-pool-size: 50 + # minimum-idle: 10 + datasource: + # driver-class-name: com.mysql.jdbc.Driver + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:db2://localvm:50000/testmc + username: db2admin + password: password + hikari: + pool-name: testmc + maximum-pool-size: 50 + minimum-idle: 10 +service: + message: Hello, World diff --git a/lis-app/src/main/resources/application.yaml b/lis-app/src/main/resources/application.yaml new file mode 100644 index 0000000..21cf75a --- /dev/null +++ b/lis-app/src/main/resources/application.yaml @@ -0,0 +1,53 @@ +### HTTP server +server: + port: 8080 + servlet: + context-path: / + +### ZKoss +zk: + homepage: index + zul-view-resolver-enabled: true +### Spring +spring: + #active: dev + # profiles: + #main: + # banner-mode: off + output: + ansi: + enabled: always + mail: + host: smtp.gmail.com + port: 465 + username: mediacubeserver@gmail.com + password: salabakter + protocol: smtps + properties: + mail: + smtp: + auth: true + starttls: + enable: true + #datasources: + # maszkaweb: + # driver-class-name: com.mysql.jdbc.Driver + # type: com.zaxxer.hikari.HikariDataSource + # jdbcUrl: jdbc:mysql://localhost:3306/maszkaweb?useUnicode=true&characterEncoding=UTF-8 + # username: root + # password: password + # pool-name: pool-maszkaweb + # maximum-pool-size: 50 + # minimum-idle: 10 + datasource: + # driver-class-name: com.mysql.jdbc.Driver + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:db2://localvm:50000/testmc + username: db2admin + password: password + hikari: + pool-name: testmc + maximum-pool-size: 50 + minimum-idle: 10 +service: + message: Hello, World diff --git a/lis-app/src/test/java/hu/user/lis/app/MainTest.java b/lis-app/src/test/java/hu/user/lis/app/MainTest.java new file mode 100644 index 0000000..c3b8e33 --- /dev/null +++ b/lis-app/src/test/java/hu/user/lis/app/MainTest.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.lis.app; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + + +@SpringBootTest +public class MainTest { + + + @Test + public void contextLoads() { + + } + +} diff --git a/lis-db/pom.xml b/lis-db/pom.xml new file mode 100644 index 0000000..c7f2b1b --- /dev/null +++ b/lis-db/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + hu.user + lis-db + 0.0.1-SNAPSHOT + + hu.user + lis + 0.0.1-SNAPSHOT + + \ No newline at end of file diff --git a/lis-db/src/main/java/hu/user/lis/db/Supplier.java b/lis-db/src/main/java/hu/user/lis/db/Supplier.java new file mode 100644 index 0000000..11e6ded --- /dev/null +++ b/lis-db/src/main/java/hu/user/lis/db/Supplier.java @@ -0,0 +1,16 @@ +package hu.user.lis.db; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Builder +@AllArgsConstructor +public class Supplier { + String id; + String name; + String zipCode; +} diff --git a/lis-services/pom.xml b/lis-services/pom.xml new file mode 100644 index 0000000..4d42eb9 --- /dev/null +++ b/lis-services/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + hu.user + lis-services + 0.0.1-SNAPSHOT + + hu.user + lis + 0.0.1-SNAPSHOT + + + + org.springframework + spring-web + + + org.apache.commons + commons-lang3 + 3.12.0 + + + com.github.javafaker + javafaker + 0.12 + + + hu.user + lis-db + 0.0.1-SNAPSHOT + compile + + + org.springframework + spring-context + + + diff --git a/lis-services/src/main/java/hu/user/lis/services/OneTwoService.java b/lis-services/src/main/java/hu/user/lis/services/OneTwoService.java new file mode 100644 index 0000000..f9ed064 --- /dev/null +++ b/lis-services/src/main/java/hu/user/lis/services/OneTwoService.java @@ -0,0 +1,19 @@ +package hu.user.lis.services; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Arrays; +import java.util.List; + +@RestController +@RequestMapping(path = "/onetwo", produces = MediaType.APPLICATION_JSON_VALUE) +public class OneTwoService { + @GetMapping + public List findAll() { + return Arrays.asList("One2", "Two1"); + } + +} diff --git a/lis-services/src/main/java/hu/user/lis/services/data/SupplierService.java b/lis-services/src/main/java/hu/user/lis/services/data/SupplierService.java new file mode 100644 index 0000000..202abb7 --- /dev/null +++ b/lis-services/src/main/java/hu/user/lis/services/data/SupplierService.java @@ -0,0 +1,9 @@ +package hu.user.lis.services.data; + +import hu.user.lis.db.Supplier; + +import java.util.List; + +public interface SupplierService { + List getAll(); +} diff --git a/lis-services/src/main/java/hu/user/lis/services/data/SupplierServiceImpl.java b/lis-services/src/main/java/hu/user/lis/services/data/SupplierServiceImpl.java new file mode 100644 index 0000000..57880db --- /dev/null +++ b/lis-services/src/main/java/hu/user/lis/services/data/SupplierServiceImpl.java @@ -0,0 +1,35 @@ +package hu.user.lis.services.data; + +import com.github.javafaker.Faker; +import hu.user.lis.db.Supplier; +import org.apache.commons.lang3.RandomStringUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class SupplierServiceImpl implements SupplierService { + private List suppliers; + + @Override + public List getAll() { + if (suppliers == null) { + suppliers = generate(); + } + return suppliers; + } + + private List generate() { + List result = new ArrayList<>(); + Faker faker = new Faker(); + for (int i = 0; i < 100; i++) { + String id = RandomStringUtils.random(8, "0123456789abcdef"); + String name = faker.name().fullName(); + String zipCode = RandomStringUtils.random(4, "0123456789"); + Supplier supplier = Supplier.builder().id(id).name(name).zipCode(zipCode).build(); + result.add(supplier); + } + return result; + } +} diff --git a/lis-ui/pom.xml b/lis-ui/pom.xml new file mode 100644 index 0000000..d7f0c96 --- /dev/null +++ b/lis-ui/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + hu.user + lis-ui + 0.0.1-SNAPSHOT + + hu.user + lis + 0.0.1-SNAPSHOT + + + + ZK CE + ZK CE Repository + http://mavensync.zkoss.org/maven2 + + + + 1.0.4 + 9.6.0 + + + + org.springframework.boot + spring-boot-starter-web + + + org.javassist + javassist + 3.26.0-GA + + + org.beanshell + bsh + 2.0b5 + + + commons-fileupload + commons-fileupload + 1.3 + + + com.google.code.gson + gson + + + org.springframework + spring-beans + 5.2.0.RELEASE + + + + org.zkoss.zkspringboot + zkspringboot-starter + ${zkspringboot.version} + + + org.zkoss.zk + zk + ${zk.version} + + + org.zkoss.zk + zul + ${zk.version} + + + org.zkoss.zk + zkbind + ${zk.version} + + + org.zkoss.zk + zkplus + ${zk.version} + + + org.zkoss.zk + zhtml + ${zk.version} + + + org.zkoss.theme + silvertail + ${zk.version} + + + org.zkoss.theme + sapphire + ${zk.version} + + + org.zkoss.theme + atlantic + ${zk.version} + + + hu.user + lis-db + 0.0.1-SNAPSHOT + + + hu.user + lis-services + 0.0.1-SNAPSHOT + + + hu.user + lis-services + 0.0.1-SNAPSHOT + compile + + + org.springframework.boot + spring-boot-devtools + true + + + \ No newline at end of file diff --git a/lis-ui/src/main/java/hu/user/lis/ui/ResourceConfigurer.java b/lis-ui/src/main/java/hu/user/lis/ui/ResourceConfigurer.java new file mode 100644 index 0000000..745a8af --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/ResourceConfigurer.java @@ -0,0 +1,12 @@ +package hu.user.lis.ui; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class ResourceConfigurer { + @GetMapping("/admin") + public String admin() { + return "admin/index"; + } +} diff --git a/lis-ui/src/main/java/hu/user/lis/ui/config/DevelopmentConfig.java b/lis-ui/src/main/java/hu/user/lis/ui/config/DevelopmentConfig.java new file mode 100644 index 0000000..c14d756 --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/config/DevelopmentConfig.java @@ -0,0 +1,36 @@ +package hu.user.lis.ui.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.zkoss.lang.Library; +import org.zkoss.zk.ui.WebApps; + +import javax.annotation.PostConstruct; + +@Configuration +//@Profile("dev") +public class DevelopmentConfig { + private static Logger logger = LoggerFactory.getLogger(DevelopmentConfig.class); + + @PostConstruct + public void initDevelopmentProperties() throws Exception { + logger.info("**************************************************************"); + logger.info("**** ZK-Springboot-Demo: development configuration active ****"); + logger.info("**************************************************************"); + + //disable various caches to avoid server restarts + Library.setProperty("org.zkoss.zk.ZUML.cache", "false"); + Library.setProperty("org.zkoss.zk.WPD.cache", "false"); + Library.setProperty("org.zkoss.zk.WCS.cache", "false"); + Library.setProperty("org.zkoss.web.classWebResource.cache", "false"); + Library.setProperty("org.zkoss.util.label.cache", "false"); + + // enable non minified js + WebApps.getCurrent().getConfiguration().setDebugJS(true); + + // enable for debugging MVVM commands and binding (very verbose) + Library.setProperty("org.zkoss.bind.DebuggerFactory.enable", "false"); + } + +} \ No newline at end of file diff --git a/lis-ui/src/main/java/hu/user/lis/ui/converter/SupplierToNameConverter.java b/lis-ui/src/main/java/hu/user/lis/ui/converter/SupplierToNameConverter.java new file mode 100644 index 0000000..1087c38 --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/converter/SupplierToNameConverter.java @@ -0,0 +1,19 @@ +package hu.user.lis.ui.converter; + +import hu.user.lis.db.Supplier; +import org.zkoss.bind.BindContext; +import org.zkoss.bind.Converter; +import org.zkoss.zul.Bandbox; + +public class SupplierToNameConverter implements Converter { + + @Override + public String coerceToUi(Supplier supplier, Bandbox bandbox, BindContext bindContext) { + return supplier == null ? null : supplier.getName(); + } + + @Override + public Supplier coerceToBean(String s, Bandbox bandbox, BindContext bindContext) { + return null; + } +} \ No newline at end of file diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/CachedDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/CachedDataModel.java new file mode 100644 index 0000000..6ca7b08 --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/CachedDataModel.java @@ -0,0 +1,151 @@ +package hu.user.lis.ui.data; + +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.Events; +import org.zkoss.zul.FieldComparator; +import org.zkoss.zul.ListModelList; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; + +@Component +@Log4j2 +public abstract class CachedDataModel extends ListModelList { + private int cacheSize = 10; + private int cacheStart; + private int cacheEnd; + private int resultSetSize = -1; + private HashMap cache = new HashMap<>(); + private ArrayList eventListenerList = new ArrayList(); + private FieldComparator sortComparator; + + public CachedDataModel() { + //reinit(); + log.info("Initialized"); + setMultiple(true); + } + + // load cache event + public void addEventListener(EventListener listener) { + eventListenerList.add(listener); + } + + public void reset() { + this.resultSetSize = -1; + this.cacheStart = 0; + this.cacheEnd = 0; + + clearCache(); + } + + public void clearCache() { + cache.clear(); + //fireEvent(ListDataEvent.STRUCTURE_CHANGED, -1, -1); + } + + private void fireLoadCacheEvent() { + Event evt = new Event(Events.ON_SCROLL); + for (EventListener el : eventListenerList) { + try { + el.onEvent(evt); + } catch (Exception e) { + log.error("", e); + } + } + } + + public int getCacheEnd() { + return cacheEnd; + } + + // zul felulet hasznalja kiirashoz + public int getCacheStart() { + return cacheStart; + } + + @Override + public T getElementAt(int index) { + // logger.debug("CachedListMode.getElementAt(): " + index); + T ret = cache.get(index); + if (ret == null) { + loadCache(index); + ret = cache.get(index); + if (ret == null) { + throw new RuntimeException("Element at index " + index + " cannot be found in the database."); + } + } + return ret; + } + + // ListModelList method felulirva + // after 1. search ++++++++++ + @Override + public int getSize() { + if (this.resultSetSize < 0) { + loadCache(0); + // logger.debug("CachedListMode.getSize(): " + this.resultSetSize); + } + return this.resultSetSize; + } + + private void loadCache(int forIndex) { + try { + int halfSize = this.cacheSize / 2; + int rowLimit = this.cacheSize; // 200 + int startPos = 0; + if ((forIndex - halfSize) > 0) { // forIndex=60 startPos=0 + // cache=0-200, forIndex=150 + // startPos=50 cache=50-250 + startPos = (forIndex - halfSize); + } + + int endPos = (startPos + rowLimit); + endPos = ((this.resultSetSize < 0) || (endPos <= this.resultSetSize)) ? endPos : this.resultSetSize; + + + if (this.resultSetSize < 0) { + this.resultSetSize = getResultSetCount(); + log.info("Result item count is {}", resultSetSize); + } + + log.info("Query result from {} to {}", startPos, endPos); + List resList = getResultSet(startPos, endPos - startPos, sortComparator); + + if (resList != null) { + log.info("Got {} records", resList.size()); + for (int c = 0; c < resList.size(); c++) { + cache.put(startPos + c, resList.get(c)); + cache.put(startPos + c, resList.get(c)); + // logger.debug("CachedListMode.cached idx: " + + // (startPos + c)); + } + } + // logger.debug("CachedListMode.cacheSize: " + cache.size()); + + cacheStart = startPos + 1; + cacheEnd = cacheStart + (cache.size() == 0 ? 0 : (cache.size() - 1)); +// BindUtils.postNotifyChange(null, null, this, "*"); + + } catch (Exception e) { + log.error("", e); + } + } + + abstract protected List getResultSet(long offset, int limit, FieldComparator sortComparator); + + abstract public int getResultSetCount(); + + + @Override + public void sort(Comparator cmpr, boolean ascending) { + sortComparator = (FieldComparator) cmpr; + log.info("Sort {} {}", sortComparator.getOrderBy(), ascending); + reset(); + } + +} \ No newline at end of file diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/FormDocument.java b/lis-ui/src/main/java/hu/user/lis/ui/data/FormDocument.java new file mode 100644 index 0000000..6653d35 --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/FormDocument.java @@ -0,0 +1,28 @@ +package hu.user.lis.ui.data; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.Builder; +import lombok.extern.log4j.Log4j2; +import org.zkoss.json.JSONObject; +import org.zkoss.json.parser.JSONParser; +import org.zkoss.lang.Strings; + +@Builder +@Log4j2 +public class FormDocument extends JSONObject { + private T data; + + public FormDocument setData(T data) { + try { + ObjectMapper mapper = new ObjectMapper(); + String json = mapper.writeValueAsString(data); + JSONParser jsonParser = new JSONParser(); + JSONObject jsonObject = (JSONObject) jsonParser.parse(json); + putAll(jsonObject); + } catch (Exception e) { + log.error(Strings.EMPTY, e); + } + put("data", data); + return this; + } +} diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersDataModel.java new file mode 100644 index 0000000..44888c5 --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersDataModel.java @@ -0,0 +1,92 @@ +package hu.user.lis.ui.data; + +import hu.user.lis.db.Supplier; +import hu.user.lis.services.data.SupplierService; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; +import org.zkoss.bind.BindUtils; +import org.zkoss.zul.FieldComparator; + +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +@Component +@Log4j2 +@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) +public class SuppliersDataModel extends CachedDataModel { + private String partialName; + private String partialZipCode; + private boolean listAll; + @Autowired + SupplierService supplierService; + + + private boolean canExecuteSearch() { + boolean result = StringUtils.isNotBlank(partialName) || StringUtils.isNotBlank(partialZipCode) || listAll; + log.info("Can execute search: {}", result); + return result; + } + + private boolean filter(Supplier supplier) { + if (listAll) { + return true; + } + + boolean result = true; + if (StringUtils.isNotBlank(partialName)) { + if (!supplier.getName().toLowerCase().startsWith(partialName.toLowerCase())) { + result = false; + } + } + if (StringUtils.isNotBlank(partialZipCode)) { + if (!supplier.getZipCode().toLowerCase().startsWith(partialZipCode.toLowerCase())) { + result = false; + } + } + return result; + } + + @Override + protected List getResultSet(long offset, int limit, FieldComparator sortComparator) { + List result = null; + if (canExecuteSearch()) { + result = supplierService.getAll().stream() + .sorted(Comparator.comparing(Supplier::getName)) + .filter(s -> filter(s)) + .collect(Collectors.toList()); + } + return result; + } + + @Override + public int getResultSetCount() { + int result = 0; + if (canExecuteSearch()) { + result = (int) supplierService.getAll().stream() + .filter(s -> filter(s)) + .count(); + } + return result; + } + + public void search(String partialName, String partialZipCode) { + log.info("Searching supplier using filters: name LIKE {}, ZIP code LIKE {}", partialName, partialZipCode); + listAll = false; + this.partialName = partialName; + this.partialZipCode = partialZipCode; + super.reset(); + BindUtils.postNotifyChange(null, null, this, "*"); + } + + public void listAll() { + log.info("List all suppliers"); + listAll = true; + super.reset(); + BindUtils.postNotifyChange(null, null, this, "*"); + } +} diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersSimpleDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersSimpleDataModel.java new file mode 100644 index 0000000..983f80f --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersSimpleDataModel.java @@ -0,0 +1,63 @@ +package hu.user.lis.ui.data; + +import hu.user.lis.db.Supplier; +import hu.user.lis.services.data.SupplierService; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; +import org.zkoss.bind.BindUtils; +import org.zkoss.zul.FieldComparator; + +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +@Component +@Log4j2 +@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) +public class SuppliersSimpleDataModel extends CachedDataModel { + static private final int SEARCH_LIMIT = 10; + private String partialName; + @Autowired + SupplierService supplierService; + + private boolean filter(Supplier supplier) { + if (StringUtils.isBlank(partialName)) { + return true; + } else { + if (supplier.getName().toLowerCase().startsWith(partialName.toLowerCase())) { + return true; + } + } + return false; + } + + @Override + protected List getResultSet(long offset, int limit, FieldComparator sortComparator) { + List result = supplierService.getAll().stream() + .sorted(Comparator.comparing(Supplier::getName)) + .filter(s -> filter(s)) + .limit(SEARCH_LIMIT) + .collect(Collectors.toList()); + return result; + } + + @Override + public int getResultSetCount() { + int result = (int) supplierService.getAll().stream() + .filter(s -> filter(s)) + .limit(SEARCH_LIMIT) + .count(); + return result; + } + + public void search(String partialName) { + log.info("Searching supplier using filter {}", partialName); + this.partialName = partialName; + super.reset(); + BindUtils.postNotifyChange(null, null, this, "*"); + } +} diff --git a/lis-ui/src/main/java/hu/user/lis/ui/form/Field.java b/lis-ui/src/main/java/hu/user/lis/ui/form/Field.java new file mode 100644 index 0000000..c5c2a1d --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/form/Field.java @@ -0,0 +1,240 @@ +package hu.user.lis.ui.form; + +import org.zkoss.zk.ui.Component; +import org.zkoss.zul.Include; + +public class Field extends Include { + public static final String FIELD_POSTFIX_ERROR = "_error"; + public static final String FIELD_POSTFIX_DATA = "_data"; + public static final String FIELD_POSTFIX_UNIT = "_unit"; + + public static class Address extends Field { + public Address() { + super(); + setSrc("~./fields/address.zul"); + } + } + + public static class Agreement extends Field { + public Agreement() { + super(); + setSrc("~./fields/agreement.zul"); + } + } + + public static class Check extends Field { + public Check() { + super(); + setSrc("~./fields/check.zul"); + } + } + + public static class CheckGroup extends Field { + public CheckGroup() { + super(); + setSrc("~./fields/checkgroup.zul"); + } + } + + public static class Company extends Field { + public Company() { + super(); + setSrc("~./fields/company.zul"); + } + } + + public static class CurrentDate extends Field { + public CurrentDate() { + super(); + setSrc("~./fields/current-date.zul"); + } + } + + public static class Date extends Field { + public Date() { + super(); + setSrc("~./fields/date.zul"); + } + } + + public static class Deadline extends Field { + public Deadline() { + super(); + setSrc("~./fields/deadline.zul"); + } + } + + public static class Domain extends Field { + public Domain() { + super(); + setSrc("~./fields/domain.zul"); + } + } + + public static class Double extends Field { + public Double() { + super(); + setSrc("~./fields/double.zul"); + } + } + + public static class FreePerson extends Field { + public FreePerson() { + super(); + setSrc("~./fields/freeperson.zul"); + } + } + + public static class InlineRadio extends Field { + public InlineRadio() { + super(); + setSrc("~./fields/inline-radio.zul"); + } + } + + public static class Location extends Field { + public Location() { + super(); + setSrc("~./fields/location.zul"); + } + } + + public static class NoBornPerson extends Field { + public NoBornPerson() { + super(); + setSrc("~./fields/nobornperson.zul"); + } + } + + public static class Number extends Field { + public Number() { + super(); + setSrc("~./fields/number.zul"); + } + } + + public static class Person extends Field { + public Person() { + super(); + setSrc("~./fields/person.zul"); + } + } + + public static class PersonName extends Field { + public PersonName() { + super(); + setSrc("~./fields/person-name.zul"); + } + } + + public static class Radio extends Field { + public Radio() { + super(); + setSrc("~./fields/radio.zul"); + } + } + + public static class RadioDate extends Field { + public RadioDate() { + super(); + setSrc("~./fields/radiodate.zul"); + } + } + + public static class RadioDouble extends Field { + public RadioDouble() { + super(); + setSrc("~./fields/radiodouble.zul"); + } + } + + public static class RadioGroup extends Field { + public RadioGroup() { + super(); + setSrc("~./fields/radiogroup.zul"); + } + } + + public static class RadioNumber extends Field { + public RadioNumber() { + super(); + setSrc("~./fields/radionumber.zul"); + } + } + + public static class Rate extends Field { + public Rate() { + super(); + setSrc("~./fields/rate.zul"); + } + } + + public static class Settlement extends Field { + public Settlement() { + super(); + setSrc("~./fields/settlement.zul"); + } + } + + public static class Signature extends Field { + public Signature() { + super(); + setSrc("~./fields/signature.zul"); + } + } + + public static class Stamp extends Field { + public Stamp() { + super(); + setSrc("~./fields/stamp.zul"); + } + } + + public static class Text extends Field { + public Text() { + super(); + setSrc("~./fields/text.zul"); + } + } + + public static class TextArea extends Field { + public TextArea() { + super(); + setSrc("~./fields/textarea.zul"); + } + } + + public static class TitleDeed extends Field { + public TitleDeed() { + super(); + setSrc("~./fields/title-deed.zul"); + } + } + + public static class ZipCode extends Field { + public ZipCode() { + super(); + setSrc("~./fields/zipcode.zul"); + } + } + + private void set(String name, Object value) { + setAttribute(name, value, Component.SPACE_SCOPE); + } + + @Override + public void setDynamicProperty(String name, Object value) { + super.setDynamicProperty(name, value); + // a dinamikus parametereket letoljuk az egesz szkopon + letrehozunk technikai + // parametereket + // ezek az include altal behuzott Composit-okban cimezhetoek pl. ${field} + set(name, value); + if ("field".equals(name)) { + String field = (String) value; + set("errorField", field + FIELD_POSTFIX_ERROR); + set("dataField", field + FIELD_POSTFIX_DATA); + set("unitField", field + FIELD_POSTFIX_UNIT); + } + } + +} diff --git a/lis-ui/src/main/java/hu/user/lis/ui/form/FormValidator.java b/lis-ui/src/main/java/hu/user/lis/ui/form/FormValidator.java new file mode 100644 index 0000000..de13c84 --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/form/FormValidator.java @@ -0,0 +1,14 @@ +package hu.user.lis.ui.form; + +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; +import org.zkoss.bind.ValidationContext; +import org.zkoss.bind.validator.AbstractValidator; + +@Service +@Log4j2 +public class FormValidator extends AbstractValidator { + @Override + public void validate(ValidationContext ctx) { + } +} diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/Index.java b/lis-ui/src/main/java/hu/user/lis/ui/view/Index.java new file mode 100644 index 0000000..2f9e99f --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/view/Index.java @@ -0,0 +1,79 @@ +package hu.user.lis.ui.view; + +import hu.user.lis.db.Supplier; +import hu.user.lis.ui.data.SuppliersSimpleDataModel; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.springframework.boot.info.BuildProperties; +import org.zkoss.bind.BindContext; +import org.zkoss.bind.BindUtils; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.ContextParam; +import org.zkoss.bind.annotation.ContextType; +import org.zkoss.bind.annotation.NotifyChange; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zk.ui.event.OpenEvent; +import org.zkoss.zk.ui.select.annotation.VariableResolver; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zul.Window; + +import java.util.Objects; + +@Log4j2 +@VariableResolver(org.zkoss.zkplus.spring.DelegatingVariableResolver.class) +public class Index { + @Getter + @Setter + @WireVariable + private SuppliersSimpleDataModel suppliersSimpleDataModel; + @Getter + private Supplier selectedSupplier; + @Getter + @Setter + private String selectedSupplierId; + @Getter + @WireVariable + BuildProperties buildProperties; + + @Command + public void onBandChanging(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { + InputEvent event = (InputEvent) ctx.getTriggerEvent(); + log.info("onBandChanging: {}", event.getValue()); + suppliersSimpleDataModel.search(event.getValue()); + } + + @Command + public void onBandOpen(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { + OpenEvent event = (OpenEvent) ctx.getTriggerEvent(); + log.info("onBandOpen: {}", event.isOpen()); + suppliersSimpleDataModel.search(null); + } + + @Command + public void onPopupSuppliers() { + String page = "~./suppliers.zul"; + Window suppliersWindow = (Window) Executions.createComponents(page, null, null); + suppliersWindow.addEventListener("onClose", e -> { + log.info("Suppliers popup result {}", e.getData()); + if (e.getData() != null) { + suppliersSimpleDataModel.clearSelection(); + setSelectedSupplierId(((Supplier) e.getData()).getId()); + BindUtils.postNotifyChange(null, null, this, "selectedSupplierId"); + } + }); + + suppliersWindow.doModal(); + } + + @NotifyChange({"selectedSupplierId", "selectedSupplier"}) + public void setSelectedSupplier(Supplier selectedSupplier) { + this.selectedSupplier = selectedSupplier; + if (Objects.isNull(selectedSupplier)) { + setSelectedSupplierId(null); + } else { + setSelectedSupplierId(selectedSupplier.getId()); + } + } +} diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/SuppliersViewModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/SuppliersViewModel.java new file mode 100644 index 0000000..fcd3d99 --- /dev/null +++ b/lis-ui/src/main/java/hu/user/lis/ui/view/SuppliersViewModel.java @@ -0,0 +1,93 @@ +package hu.user.lis.ui.view; + +import hu.user.lis.db.Supplier; +import hu.user.lis.ui.data.FormDocument; +import hu.user.lis.ui.data.SuppliersDataModel; +import hu.user.lis.ui.form.FormValidator; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.zkoss.bind.annotation.BindingParam; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.Init; +import org.zkoss.bind.annotation.NotifyChange; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.Events; +import org.zkoss.zk.ui.select.annotation.VariableResolver; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zkplus.spring.DelegatingVariableResolver; +import org.zkoss.zul.Window; + +import java.util.Set; + +@Log4j2 +@Getter +@Setter +@VariableResolver(DelegatingVariableResolver.class) +public class SuppliersViewModel { + private FormDocument formDocument; + private boolean canEdit; + private String partialName; + private String partialZipCode; + + private Supplier selectedSupplier; + @WireVariable + SuppliersDataModel suppliersDataModel; + @Autowired + FormValidator formValidator; + + @Init + public void init() { + log.info("Initialized"); + //TODO atnevezni, mert forditva mukodik + setCanEdit(true); + } + + public String getFieldStyle(String field, String baseStyle) { +// Object error = getFormDocument().get(field + FIELD_POSTFIX_ERROR); +// if (error != null && (boolean) error) +// return baseStyle + " " + ERROR; +// else +// return baseStyle; + return baseStyle; + } + + @Command + @NotifyChange("formDocument") + public void search() { + suppliersDataModel.clearSelection(); + formDocument = null; + suppliersDataModel.search(partialName, partialZipCode); + } + + @Command + @NotifyChange({"formDocument", "partialName", "partialZipCode"}) + public void listAll() { + suppliersDataModel.clearSelection(); + formDocument = null; + partialName = null; + partialZipCode = null; + suppliersDataModel.listAll(); + } + + @Command + @NotifyChange("formDocument") + public void onListSelection() { + formDocument = null; + selectedSupplier = null; + Set selections = suppliersDataModel.getSelection(); + if (selections.iterator().hasNext()) { + selectedSupplier = selections.iterator().next(); + formDocument = FormDocument.builder().build() + .setData(selectedSupplier); + log.info("Selected {}", formDocument); + } + } + + @Command + public void onCloseWindow(@BindingParam("target") Window target, @BindingParam("select") boolean select) { + Event closeEvent = new Event("onClose", target, select ? selectedSupplier : null); + Events.postEvent(closeEvent); + } +} diff --git a/lis-ui/src/main/resources/metainfo/zk-label.properties b/lis-ui/src/main/resources/metainfo/zk-label.properties new file mode 100644 index 0000000..e69de29 diff --git a/lis-ui/src/main/resources/metainfo/zk-label_hu.properties b/lis-ui/src/main/resources/metainfo/zk-label_hu.properties new file mode 100644 index 0000000..e69de29 diff --git a/lis-ui/src/main/resources/metainfo/zk/zk.xml b/lis-ui/src/main/resources/metainfo/zk/zk.xml new file mode 100644 index 0000000..0396154 --- /dev/null +++ b/lis-ui/src/main/resources/metainfo/zk/zk.xml @@ -0,0 +1,35 @@ + + + + + org.zkoss.zk.ui.http.SerializableUiFactory + + + org.zkoss.theme.preferred + silvertail + + + org.zkoss.zul.grid.rod + true + + + org.zkoss.zul.grid.autohidePaging + false + + + org.zkoss.zul.listbox.rod + true + + + org.zkoss.zul.listbox.autohidePaging + false + + + org.zkoss.zul.nativebar + true + + + + + + \ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/address.zul b/lis-ui/src/main/resources/web/fields/address.zul new file mode 100644 index 0000000..8ab15c0 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/address.zul @@ -0,0 +1,22 @@ + + + + + +
+
+ + + + + +
+
+ + + + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/agreement.zul b/lis-ui/src/main/resources/web/fields/agreement.zul new file mode 100644 index 0000000..0b9626a --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/agreement.zul @@ -0,0 +1,7 @@ +
+
+ +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/check.zul b/lis-ui/src/main/resources/web/fields/check.zul new file mode 100644 index 0000000..f77eb53 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/check.zul @@ -0,0 +1,8 @@ +
+
+ +
+ +
diff --git a/lis-ui/src/main/resources/web/fields/checkgroup.zul b/lis-ui/src/main/resources/web/fields/checkgroup.zul new file mode 100644 index 0000000..5c46be2 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/checkgroup.zul @@ -0,0 +1,14 @@ +
+
+ +
+
+ + + + + +
+
diff --git a/lis-ui/src/main/resources/web/fields/company.zul b/lis-ui/src/main/resources/web/fields/company.zul new file mode 100644 index 0000000..fb3d7d6 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/company.zul @@ -0,0 +1,19 @@ + + + + +
+
+ + +
+
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/current-date.zul b/lis-ui/src/main/resources/web/fields/current-date.zul new file mode 100644 index 0000000..d0bca4d --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/current-date.zul @@ -0,0 +1,16 @@ +
+
diff --git a/lis-ui/src/main/resources/web/fields/date.zul b/lis-ui/src/main/resources/web/fields/date.zul new file mode 100644 index 0000000..04b2998 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/date.zul @@ -0,0 +1,9 @@ +
+
+ +
+
+ +
+
diff --git a/lis-ui/src/main/resources/web/fields/deadline.zul b/lis-ui/src/main/resources/web/fields/deadline.zul new file mode 100644 index 0000000..22216dc --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/deadline.zul @@ -0,0 +1,11 @@ + + + + +
+ + + +
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/domain.zul b/lis-ui/src/main/resources/web/fields/domain.zul new file mode 100644 index 0000000..3025172 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/domain.zul @@ -0,0 +1,14 @@ +
+
+ +
+
+ + + + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/double.zul b/lis-ui/src/main/resources/web/fields/double.zul new file mode 100644 index 0000000..8bd04d5 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/double.zul @@ -0,0 +1,9 @@ +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/field-label.zul b/lis-ui/src/main/resources/web/fields/field-label.zul new file mode 100644 index 0000000..d05d418 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/field-label.zul @@ -0,0 +1,3 @@ +
+
diff --git a/lis-ui/src/main/resources/web/fields/freeperson.zul b/lis-ui/src/main/resources/web/fields/freeperson.zul new file mode 100644 index 0000000..744c038 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/freeperson.zul @@ -0,0 +1,21 @@ + + + + +
+
+ + + +
+
+
+ + + +
+
+ + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/inline-radio.zul b/lis-ui/src/main/resources/web/fields/inline-radio.zul new file mode 100644 index 0000000..178e585 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/inline-radio.zul @@ -0,0 +1,4 @@ + diff --git a/lis-ui/src/main/resources/web/fields/location.zul b/lis-ui/src/main/resources/web/fields/location.zul new file mode 100644 index 0000000..4bbf9da --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/location.zul @@ -0,0 +1,16 @@ +
+
+ +
+
+ + + + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/nobornperson.zul b/lis-ui/src/main/resources/web/fields/nobornperson.zul new file mode 100644 index 0000000..8c3fd76 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/nobornperson.zul @@ -0,0 +1,21 @@ + + + + +
+
+ + + +
+
+
+ + + +
+
+ + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/number.zul b/lis-ui/src/main/resources/web/fields/number.zul new file mode 100644 index 0000000..a8f1f21 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/number.zul @@ -0,0 +1,16 @@ +
+
+ +
+
+ + + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/person-name.zul b/lis-ui/src/main/resources/web/fields/person-name.zul new file mode 100644 index 0000000..5d5450a --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/person-name.zul @@ -0,0 +1,14 @@ +
+
+ +
+
+ + + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/person.zul b/lis-ui/src/main/resources/web/fields/person.zul new file mode 100644 index 0000000..ead1ecd --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/person.zul @@ -0,0 +1,21 @@ + + + + +
+
+ + + +
+
+
+ + + +
+
+ + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/publicplace.zul b/lis-ui/src/main/resources/web/fields/publicplace.zul new file mode 100644 index 0000000..3d10762 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/publicplace.zul @@ -0,0 +1,9 @@ +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/radio.zul b/lis-ui/src/main/resources/web/fields/radio.zul new file mode 100644 index 0000000..86cd3ac --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/radio.zul @@ -0,0 +1,7 @@ +
+
+ +
+
diff --git a/lis-ui/src/main/resources/web/fields/radiodate.zul b/lis-ui/src/main/resources/web/fields/radiodate.zul new file mode 100644 index 0000000..45d57be --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/radiodate.zul @@ -0,0 +1,15 @@ +
+
+ + + + + + + +
+
diff --git a/lis-ui/src/main/resources/web/fields/radiodouble.zul b/lis-ui/src/main/resources/web/fields/radiodouble.zul new file mode 100644 index 0000000..f81fe75 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/radiodouble.zul @@ -0,0 +1,15 @@ +
+
+ + + + + + + ${postfix} +
+
diff --git a/lis-ui/src/main/resources/web/fields/radiogroup.zul b/lis-ui/src/main/resources/web/fields/radiogroup.zul new file mode 100644 index 0000000..c69a743 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/radiogroup.zul @@ -0,0 +1,13 @@ +
+
+ +
+
+ + +
+
diff --git a/lis-ui/src/main/resources/web/fields/radionumber.zul b/lis-ui/src/main/resources/web/fields/radionumber.zul new file mode 100644 index 0000000..bae947a --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/radionumber.zul @@ -0,0 +1,15 @@ +
+
+ + + + + + + ${postfix} +
+
diff --git a/lis-ui/src/main/resources/web/fields/rate.zul b/lis-ui/src/main/resources/web/fields/rate.zul new file mode 100644 index 0000000..5cd257b --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/rate.zul @@ -0,0 +1,13 @@ +
+
+ +
+
+ + + + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/settlement.zul b/lis-ui/src/main/resources/web/fields/settlement.zul new file mode 100644 index 0000000..439db79 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/settlement.zul @@ -0,0 +1,9 @@ +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/signature.zul b/lis-ui/src/main/resources/web/fields/signature.zul new file mode 100644 index 0000000..733455d --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/signature.zul @@ -0,0 +1,10 @@ +
+
+ +
+
+
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/stamp.zul b/lis-ui/src/main/resources/web/fields/stamp.zul new file mode 100644 index 0000000..59f23fb --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/stamp.zul @@ -0,0 +1,8 @@ +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/fields/text.zul b/lis-ui/src/main/resources/web/fields/text.zul new file mode 100644 index 0000000..78077f6 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/text.zul @@ -0,0 +1,9 @@ +
+
+ +
+
+ +
+
diff --git a/lis-ui/src/main/resources/web/fields/textarea.zul b/lis-ui/src/main/resources/web/fields/textarea.zul new file mode 100644 index 0000000..5ccf52c --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/textarea.zul @@ -0,0 +1,4 @@ +
+ +
diff --git a/lis-ui/src/main/resources/web/fields/title-deed-content.zul b/lis-ui/src/main/resources/web/fields/title-deed-content.zul new file mode 100644 index 0000000..1c07c14 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/title-deed-content.zul @@ -0,0 +1,11 @@ +
+ Megbízó + + átad egy 60 napnál nem régebbi tulajdoni lapot, vagy + + megbízza a Home Service képviselőjét, hogy szerezzen be egy tulajdoni lapot. +
diff --git a/lis-ui/src/main/resources/web/fields/title-deed.zul b/lis-ui/src/main/resources/web/fields/title-deed.zul new file mode 100644 index 0000000..072eb3f --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/title-deed.zul @@ -0,0 +1,5 @@ + +
+ + +
diff --git a/lis-ui/src/main/resources/web/fields/zipcode.zul b/lis-ui/src/main/resources/web/fields/zipcode.zul new file mode 100644 index 0000000..d357e88 --- /dev/null +++ b/lis-ui/src/main/resources/web/fields/zipcode.zul @@ -0,0 +1,11 @@ +
+
+ +
+
+ + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/index.zul b/lis-ui/src/main/resources/web/index.zul new file mode 100644 index 0000000..d0a273f --- /dev/null +++ b/lis-ui/src/main/resources/web/index.zul @@ -0,0 +1,73 @@ + + +
+ + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/lis-ui/src/main/resources/web/static/css/skeleton.css b/lis-ui/src/main/resources/web/static/css/skeleton.css new file mode 100644 index 0000000..cac7b35 --- /dev/null +++ b/lis-ui/src/main/resources/web/static/css/skeleton.css @@ -0,0 +1,168 @@ +/* Grid +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +.container { + position: relative; + width: 100%; + max-width: 960px; + margin: 0 auto; + padding: 0 20px; + box-sizing: border-box; } +.column, +.columns { + width: 100%; + float: left; + box-sizing: border-box; } + +/* For devices larger than 400px */ +@media (min-width: 400px) { + .container { + width: 85%; + padding: 0; } +} + +/* For devices larger than 550px */ +@media (min-width: 550px) { + .container { + width: 80%; + } + .column, + .columns { + margin-left: 0; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 10px; +/* + padding-right: 10px; +*/ + } + .column:first-child, + .columns:first-child { + margin-left: 0; + padding-left: 0; + } + .column:last-child, + .columns:last-child { + float: right; } +/* + .one.column, + .one.columns { width: 7.875%; } + .two.columns { width: 16.25%; } + .three.columns { width: 24.625%; } + .four.columns { width: 33%; } + + .five.columns { width: 41.375%; } + .six.columns { width: 49.75%; } + .seven.columns { width: 58.125%; } + .eight.columns { width: 66.5%; } + .nine.columns { width: 74.875%; } + .ten.columns { width: 83.25%; } + .eleven.columns { width: 91.625%; } + .twelve.columns { width: 100%; margin-left: 0; } +*/ + .one.column, + .one.columns { width: 8.3333333334%; } + .two.columns { width: 16.6666666667%; } + .three.columns { width: 25%; } + .four.columns { width: 33.3333333334%; } + .five.columns { width: 41.6666666667%; } + .six.columns { width: 50%; } + .seven.columns { width: 58.3333333334%; } + .eight.columns { width: 66.6666666667%; } + .nine.columns { width: 75%; } + .ten.columns { width: 83.3333333334%; } + .eleven.columns { width: 91.66666666667%; } + .twelve.columns { width: 100%; margin-left: 0; } + .per-five.columns { width: 20%; } + + +} + +/* +@media only screen and (min-width: 550px) { + .column:first-child, + .columns:first-child { + float: right; } +} + +@media only print and (min-width: 550px) { + .two.columns:last-child { background: red; width: 17%;} + .three.columns:last-child { background: red; width: 24.9%;} + .four.columns:last-child { background: red; width: 33.4%;} +} +*/ + + +/* Utilities +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +.u-vertical-container { + display: table; + padding: 10px; +} +.u-fill { + display: table-row; + height: 100%; + max-height: 100%; + width: 100%; +} +.u-full-width { + width: 100%; + box-sizing: border-box; +} +.u-max-full-width { + max-width: 100%; + box-sizing: border-box; +} +.u-full-height { + height: 100%; +} +.u-max-full-height { + max-height: 100%; +} +.u-form-width { + width: 94%; + box-sizing: border-box; } +.u-max-form-width { + max-width: 94%; + box-sizing: border-box; } +.u-pull-right { + float: right; } +.u-pull-left { + float: left; } + + +/* Clearing +–––––––––––––––––––––––––––––––––––––––––––––––––– */ + +/* Self Clearing Goodness */ +.container:after, +.row:after, +.u-cf { + content: ""; + display: table; + clear: both; } + + +/* Media Queries +–––––––––––––––––––––––––––––––––––––––––––––––––– */ +/* +Note: The best way to structure the use of media queries is to create the queries +near the relevant code. For example, if you wanted to change the styles for buttons +on small devices, paste the mobile query code up in the buttons section and style it +there. +*/ + + +/* Larger than mobile */ +@media (min-width: 400px) {} + +/* Larger than phablet (also point when grid becomes active) */ +@media (min-width: 550px) {} + +/* Larger than tablet */ +@media (min-width: 750px) {} + +/* Larger than desktop */ +@media (min-width: 1000px) {} + +/* Larger than Desktop HD */ +@media (min-width: 1200px) {} diff --git a/lis-ui/src/main/resources/web/static/css/webclient.css b/lis-ui/src/main/resources/web/static/css/webclient.css new file mode 100644 index 0000000..15292f5 --- /dev/null +++ b/lis-ui/src/main/resources/web/static/css/webclient.css @@ -0,0 +1,445 @@ +.z-loading { + left: 45% !important; +/* + top: 50% !important; + align: center; + font-size: 18px; + font-weight: bold; + padding: 5px; +*/ +} + +.container .form-label { + font-family: "Calibri"; + line-height: 1.5em; +} + +.container .bold { + font-weight: bold; +} + +.row .field-textbox { + font-size: 12px; + padding: 0px; + padding-left: 5px; + line-height: 1.5em; + height: auto; + width: 100%; + border-radius: 0px; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border: none; +} + +.field-top { + background: white; +} + +.container .separator { + height: 20px; + min-height: 20px; +} + +.field { + padding-left: 1px; + padding-bottom: 1px; + background: black; +} + +.agreement-field { + border-left: 1px solid black; + border-bottom: 1px solid black; + padding: 10px 0px 10px 10px; +} + +.stamp-field { + border-left: 1px solid black; + border-bottom: 1px solid black; + padding: 10px 0px 10px 10px; + height: 124px; +} + +.row .center { + text-align: center; +} + +.row .field-label { + font-weight: normal; + /* + background-image: url('../img/label.png'); + background-repeat: no-repeat; + background-position: right top;*/ + padding-right: 5px; + background-color: #CCCCCC; + border: none; + /*margin: 4px 0px 0px 0px;trbl*/ + padding-left: 5px; + padding-top: 1px; + padding-bottom: 1px; + /*line-height: 1em; + text-overflow: ellipsis; + overflow: hidden;*/ + white-space: nowrap; +} +.row .field-label .error { + background: #ffbcaf; + border: 1px solid #ffbcaf; +} +.row .error { + background-color: #ffbcaf; +/* + background-image: url('../img/label-error.png'); + background-repeat: no-repeat; + background-position: right top; +*/ +} +/* +.row .field-label * { + margin: 0px; + /*overflow: hidden; inline date problem*/ +} +*/ +.row .field-vlayout { + line-height: 1em; +} + +.container .group-label { + display: block; + font-weight: bold; + font-size: 12px; +} + +.container .buttongroup { + border-top: 1px solid #676767; + border-bottom: 1px solid #676767; + margin-top: 20px; + margin-bottom: 20px; + padding-top: 10px; + padding-bottom: 10px; + text-align: right; +} + +.container .thinbuttongroup { +/* + border-top: 1px solid #676767; + border-bottom: 1px solid #676767; +*/ + margin-top: 5px; + margin-bottom: 5px; + padding-top: 5px; + padding-bottom: 5px; + text-align: right; +} + +.z-checkbox-content { + margin-bottom: 0px; +} + +.row .z-datebox { + height: auto; + display: inline-block; +} + +.row .radio-intbox { + height: auto; + display: initial; + padding: 0px; + line-height: 1em; + border-radius: 0; + webkit-border-radius: 0px; +} + +.row .z-datebox-input { + padding: 0px; + height: auto; + border: none; +} + +.row .z-datebox-button { + padding: 0px; + padding-top: 0px; + height: auto; + min-height: initial; +} + +.row textarea.z-textbox { + overflow: hidden; + overflow-wrap: break-word; + resize: none; +} + +.hidden { + display: none; +} +/* +.bigfont { + font-size: 14px; +} +.bigfont * { + font-size: 14px; +} +.biggerfont { + font-size: 16px; +} +*/ + +input[type="radio"] { + font-family: ZK85Icons,FontAwesome; +} + +input[type="radio"]:focus { + outline: none; +} +input[type="radio"]:hover { + border-color: black +} + +input[type="radio"]:checked { + border-color: black +} + +input[type="radio"][disabled] { + border-color: black; + cursor: not-allowed; +} + +input[type="radio"][disabled]:checked:before { + border-color: black; + background: black; +} + + +input[type="radio"][disabled]:checked { + border-color: black; +} + +input[type="radio"][disabled]:checked:hover { + border-color: black; +} + +.field-textbox[disabled] { + background: white !important; + color: black !important; + cursor: not-allowed !important; +} + +input[type="radio"]:checked:before { + content: "\f00c"; + color: white; +} + +input[type="checkbox"]:focus { + outline: none; +} + +input[type="radio"] { + width: 14px; + height: 14px; + margin: 0px 4px 2px 8px; + border-radius: 0px; + border: 1px solid black; +} + +input[type="radio"]:before { +/* + width: 12px; + height: 12px; + margin-right: 20px;*/ + border-radius: 0px; +} + +input[type="radio"]:checked:before { + background-color: black; +} + +input[type="checkbox"] { + font-size: inherit; + width: 14px; + height: 14px; + border: 1px solid black; + border-radius: 0px; + margin: 2px 4px 2px 8px; +} + +input[type="checkbox"]:checked { + background-color: black; +} + +input[type="checkbox"]:hover { + border-color: black; +} + +.row .agreement { + padding: 0px 0px 0px 0px; + line-height: 1em; + border: none; + margin: 2px 0px 0px 0px; +} + +.row .agreement span { + font-family: "Calibri"; + font-weight: normal; + line-height: 1em; + margin: 0px; +} + +.agreement-small { + padding: 0px 0px 0px 0px; + line-height: 1em; + border: none; + margin: 2px 0px 0px 20px; +} + +.row .agreement-small span { + font-family: "Calibri"; + font-weight: normal; + line-height: 1em; + margin: 0px; +} + +.row .agreement p { + margin: 10px 0px 10px 10px; +} + +.row .md-content { + padding: 0px 0px 0px 0px; + line-height: 1em; + margin: 20px; +} + +.row .md-content span { + font-family: "Calibri"; + font-weight: normal; + font-size: 14px; + line-height: 1.5em; + margin: 0px; +} + +.row .md-content p { + margin: 10px 0px 10px 10px; +} + +.row .inline-textbox { + background: transparent; + height: auto; + margin: 0px; + padding: 0px; + border: none; + border-bottom: 1px dotted; + border-radius: 0; + webkit-border-radius: 0px; +} + + +.inline-intbox { + font-family: "Calibri"; + font-weight: bolder; + font-size: 12px; + padding: 0px; + line-height: 1em; + height: auto; + border: none; + border-bottom: 1px dotted; + border-radius: 0; + webkit-border-radius: 0px; +} +/* +.inline-radio { + width: 20px; + height: 20px; +} +*/ +.inline { + display: inline; +} + +.row .z-combobox { + display: inline-block; + height: auto; + white-space: nowrap +} + +.row .z-datebox-input { + color: rgba(0, 0, 0, 0.9); + height: auto; + border: none; + margin: 0px; + padding: 0px; + line-height: 1em; + background: white; + width: 100%; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + -o-border-radius: 0px; + -ms-border-radius: 0px; + border-radius: 0px; +} + +.row .z-combobox-input { + color: rgba(0, 0, 0, 0.9); + height: auto; + border: none; + margin: 0px; + padding: 0px; + line-height: 1em; + background: transparent; + width: 100%; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + -o-border-radius: 0px; + -ms-border-radius: 0px; + border-radius: 0px; +} + +.row .z-combobox-button, +.row .z-datebox-button { + font-size: 1em; + color: rgba(0, 0, 0, 0.9); + display: inline-block; + min-width: 0px; + min-height: 0px; + height: auto; + -webkit-border-radius: 0 5px 5px 0; + -moz-border-radius: 0 5px 5px 0; + -o-border-radius: 0 5px 5px 0; + -ms-border-radius: 0 5px 5px 0; + border-radius: 0 5px 5px 0; + border: none; + border-left: 1px solid black; + position: relative; + left: -18px; + padding: 0px; + line-height: 1em; + background: #fff; + text-align: center; + vertical-align: middle; + cursor: pointer; + background: white; + overflow: hidden; +/* display: inline-block;*/ +} + + +.hairline { + height: 2px; + width: 100%; + background-color: black; +} + +.a4page-content { + min-height: 1010px; + /* az alábbiakat kivenni releaskor! + max-height: 1010px; + height: 1010px; + */ +} + +.a4page { + border: 1px solid #676767; + margin: 40px; + -webkit-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75); + -moz-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75); + box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75); +} + + diff --git a/lis-ui/src/main/resources/web/static/print.min.css b/lis-ui/src/main/resources/web/static/print.min.css new file mode 100644 index 0000000..78412d7 --- /dev/null +++ b/lis-ui/src/main/resources/web/static/print.min.css @@ -0,0 +1 @@ +.printModal{font-family:sans-serif;display:flex;text-align:center;font-weight:300;font-size:30px;left:0;top:0;position:absolute;color:#0460b5;width:100%;height:100%;background-color:hsla(0,0%,100%,.91)}.printClose{position:absolute;right:10px;top:10px}.printClose:before{content:"\00D7";font-family:Helvetica Neue,sans-serif;font-weight:100;line-height:1px;padding-top:.5em;display:block;font-size:2em;text-indent:1px;overflow:hidden;height:1.25em;width:1.25em;text-align:center;cursor:pointer} \ No newline at end of file diff --git a/lis-ui/src/main/resources/web/static/print.min.js b/lis-ui/src/main/resources/web/static/print.min.js new file mode 100644 index 0000000..91be90e --- /dev/null +++ b/lis-ui/src/main/resources/web/static/print.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.printJS=t():e.printJS=t()}(window,function(){return function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),i=(r=o)&&r.__esModule?r:{default:r},a=n(1);var l={send:function(r,e){document.getElementsByTagName("body")[0].appendChild(e);var o=document.getElementById(r.frameId);o.onload=function(){if("pdf"!==r.type){var e=o.contentWindow||o.contentDocument;if(e.document&&(e=e.document),e.body.appendChild(r.printableElement),"pdf"!==r.type&&r.style){var t=document.createElement("style");t.innerHTML=r.style,e.head.appendChild(t)}var n=e.getElementsByTagName("img");0'+e+""},t.capitalizePrint=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.collectStyles=function(e,t){var n=document.defaultView||window,r="",o=n.getComputedStyle(e,"");return Object.keys(o).map(function(e){(-1!==t.targetStyles.indexOf("*")||-1!==t.targetStyle.indexOf(o[e])||function(e,t){for(var n=0;n]*>(.*?)").test(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={isFirefox:function(){return"undefined"!=typeof InstallTrigger},isIE:function(){return-1!==navigator.userAgent.indexOf("MSIE")||!!document.documentMode},isEdge:function(){return!r.isIE()&&!!window.StyleMedia},isChrome:function(){return!!(0"+t.documentTitle+"",t.css&&(Array.isArray(t.css)||(t.css=[t.css]),t.css.forEach(function(e){o.srcdoc+=''})),o.srcdoc+=""),t.type){case"pdf":if(a.default.isFirefox()||a.default.isEdge()||a.default.isIE())try{if(console.info("PrintJS currently doesn't support PDF printing in Firefox, Internet Explorer and Edge."),!0===t.onBrowserIncompatible())window.open(t.fallbackPrintable,"_blank").focus(),t.onPdfOpen&&t.onPdfOpen()}catch(e){t.onError(e)}finally{t.showModal&&l.default.close(),t.onLoadingEnd&&t.onLoadingEnd()}else d.default.print(t,o);break;case"image":f.default.print(t,o);break;case"html":u.default.print(t,o);break;case"raw-html":c.default.print(t,o);break;case"json":s.default.print(t,o)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r},a=n(1);function l(e,t,n){var r=new window.Blob([n],{type:"application/pdf"});r=window.URL.createObjectURL(r),t.setAttribute("src",r),i.default.send(e,t)}t.default={print:function(e,t){if(e.base64){var n=Uint8Array.from(atob(e.printable),function(e){return e.charCodeAt(0)});l(e,t,n)}else{e.printable=/^(blob|http)/i.test(e.printable)?e.printable:window.location.origin+("/"!==e.printable.charAt(0)?"/"+e.printable:e.printable);var r=new window.XMLHttpRequest;r.responseType="arraybuffer",r.addEventListener("load",function(){if(-1===[200,201].indexOf(r.status))return(0,a.cleanUp)(e),void e.onError(r.statusText);l(e,t,r.response)}),r.open("GET",e.printable,!0),r.send()}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,f=n(1),o=n(0),i=(r=o)&&r.__esModule?r:{default:r};t.default={print:function(e,t){var n=document.getElementById(e.printable);n?(e.printableElement=function e(t,n){var r=t.cloneNode();var o=!0;var i=!1;var a=void 0;try{for(var l,d=t.childNodes[Symbol.iterator]();!(o=(l=d.next()).done);o=!0){var u=l.value;if(-1===n.ignoreElements.indexOf(u.id)){var c=e(u,n);r.appendChild(c)}}}catch(e){i=!0,a=e}finally{try{!o&&d.return&&d.return()}finally{if(i)throw a}}n.scanStyles&&1===t.nodeType&&r.setAttribute("style",(0,f.collectStyles)(t,n));switch(t.tagName){case"SELECT":r.value=t.value;break;case"CANVAS":r.getContext("2d").drawImage(t,0,0)}return r}(n,e),e.header&&(0,f.addHeader)(e.printableElement,e),i.default.send(e,t)):window.console.error("Invalid HTML element id: "+e.printable)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};t.default={print:function(e,t){e.printableElement=document.createElement("div"),e.printableElement.setAttribute("style","width:100%"),e.printableElement.innerHTML=e.printable,i.default.send(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(r,e){r.printable.constructor!==Array&&(r.printable=[r.printable]),r.printableElement=document.createElement("div"),r.printable.forEach(function(e){var t=document.createElement("img");t.setAttribute("style",r.imageStyle),t.src=e;var n=document.createElement("div");n.appendChild(t),r.printableElement.appendChild(n)}),r.header&&(0,o.addHeader)(r.printableElement,r),a.default.send(r,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(t,e){if("object"!==o(t.printable))throw new Error("Invalid javascript data object (JSON).");if("boolean"!=typeof t.repeatTableHeader)throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!t.properties||!Array.isArray(t.properties))throw new Error("Invalid properties array for your JSON data.");t.properties=t.properties.map(function(e){return{field:"object"===(void 0===e?"undefined":o(e))?e.field:e,displayName:"object"===(void 0===e?"undefined":o(e))?e.displayName:e,columnSize:"object"===(void 0===e?"undefined":o(e))&&e.columnSize?e.columnSize+";":100/t.properties.length+"%;"}}),t.printableElement=document.createElement("div"),t.header&&(0,c.addHeader)(t.printableElement,t),t.printableElement.innerHTML+=function(e){var t=e.printable,n=e.properties,r='';e.repeatTableHeader&&(r+="");r+="";for(var o=0;o'+(0,c.capitalizePrint)(n[o].displayName)+"";r+="",e.repeatTableHeader&&(r+="");r+="";for(var i=0;i";for(var a=0;a'+l+""}r+=""}return r+="
"}(t),a.default.send(t,e)}}}]).default}); \ No newline at end of file diff --git a/lis-ui/src/main/resources/web/suppliers.zul b/lis-ui/src/main/resources/web/suppliers.zul new file mode 100644 index 0000000..b01836e --- /dev/null +++ b/lis-ui/src/main/resources/web/suppliers.zul @@ -0,0 +1,83 @@ + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + +