task: MVVM design pattern using zkoss framework. (#1678)
* MVVM design pattern using zkoss framework. * MVVM Design pattern updates for issues reported by SonarCloud. * MVVM Design pattern updates for coverage issues reported by SonarCloud. * MVVM Design pattern updates for coverage issues (removing lombok @Data) reported by SonarCloud. * MVVM Design pattern updates for coverage issues reported by Sonar - TEST cases added for Equals and ToString * MVVM Design Pattern - updating missing/todo details. * MVVM Design Pattern - adding lombok.config * MVVM Design Pattern - Removing xml, updating pom.xml and README as per suggested changes in code review * Update model-view-viewmodel/README.md * Update model-view-viewmodel/README.md * Update model-view-viewmodel/README.md * Update model-view-viewmodel/README.md * MVVM Design Pattern - Updated pom.xml and Readme based on Suggested changes * added type as xml * MVVM Design Patterm - root pom.xml and module pom.xml updated * Update pom.xml Co-authored-by: Subhrodip Mohanta <hello@subho.xyz> Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
Manifest-Version: 1.0
|
||||
Specification-Title: ZK Application
|
||||
Specification-Version: 1.0
|
||||
Specification-Vendor:
|
||||
Implementation-Title:
|
||||
Implementation-URL: http://your-website/
|
||||
Implementation-Version: 1.0
|
||||
Implementation-Vendor:
|
114
model-view-viewmodel/src/main/webapp/WEB-INF/web.xml
Normal file
114
model-view-viewmodel/src/main/webapp/WEB-INF/web.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
|
||||
|
||||
<description><![CDATA[My ZK Application]]></description>
|
||||
<display-name>model-view-viewmodel</display-name>
|
||||
|
||||
<!-- ZK -->
|
||||
<listener>
|
||||
<description>ZK listener for session cleanup</description>
|
||||
<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
|
||||
</listener>
|
||||
<servlet>
|
||||
<description>ZK loader for ZUML pages</description>
|
||||
<servlet-name>zkLoader</servlet-name>
|
||||
<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
|
||||
|
||||
<!-- Must. Specifies URI of the update engine (DHtmlUpdateServlet).
|
||||
It must be the same as <url-pattern> for the update engine.
|
||||
-->
|
||||
<init-param>
|
||||
<param-name>update-uri</param-name>
|
||||
<param-value>/zkau</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup><!-- Must -->
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>zkLoader</servlet-name>
|
||||
<url-pattern>*.zul</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>zkLoader</servlet-name>
|
||||
<url-pattern>*.zhtml</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description>The asynchronous update engine for ZK</description>
|
||||
<servlet-name>auEngine</servlet-name>
|
||||
<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>auEngine</servlet-name>
|
||||
<url-pattern>/zkau/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<session-config>
|
||||
<session-timeout>60</session-timeout>
|
||||
</session-config>
|
||||
|
||||
<!-- [Optional] MIME mapping -->
|
||||
<mime-mapping>
|
||||
<extension>doc</extension>
|
||||
<mime-type>application/vnd.ms-word</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>gif</extension>
|
||||
<mime-type>image/gif</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>htm</extension>
|
||||
<mime-type>text/html</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>html</extension>
|
||||
<mime-type>text/html</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>jpeg</extension>
|
||||
<mime-type>image/jpeg</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>jpg</extension>
|
||||
<mime-type>image/jpeg</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>js</extension>
|
||||
<mime-type>text/javascript</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>pdf</extension>
|
||||
<mime-type>application/pdf</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>png</extension>
|
||||
<mime-type>image/png</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>txt</extension>
|
||||
<mime-type>text/plain</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>xls</extension>
|
||||
<mime-type>application/vnd.ms-excel</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>xml</extension>
|
||||
<mime-type>text/xml</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>zhtml</extension>
|
||||
<mime-type>text/html</mime-type>
|
||||
</mime-mapping>
|
||||
<mime-mapping>
|
||||
<extension>zul</extension>
|
||||
<mime-type>text/html</mime-type>
|
||||
</mime-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.zul</welcome-file>
|
||||
<welcome-file>index.zhtml</welcome-file>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
34
model-view-viewmodel/src/main/webapp/index.zul
Normal file
34
model-view-viewmodel/src/main/webapp/index.zul
Normal file
@@ -0,0 +1,34 @@
|
||||
<zk>
|
||||
<window title="List of Books" border="normal" width="600px" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('com.iluwatar.model.view.viewmodel.BookViewModel')">
|
||||
<vbox hflex="true">
|
||||
<listbox model="@bind(vm.bookList)" selectedItem="@bind(vm.selectedBook)" height="400px" mold="paging">
|
||||
<listhead>
|
||||
<listheader label="Book Name"/>
|
||||
<listheader label="Author"/>
|
||||
</listhead>
|
||||
<template name="model" var="book">
|
||||
<listitem >
|
||||
<listcell label="@bind(book.name)"/>
|
||||
<listcell label="@bind(book.author)"/>
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
</vbox>
|
||||
<toolbar>
|
||||
<button label="Delete" onClick="@command('deleteBook')" disabled="@load(empty vm.selectedBook)" />
|
||||
</toolbar>
|
||||
<hbox style="margin-top:20px" visible="@bind(not empty vm.selectedBook)">
|
||||
<vbox>
|
||||
<hlayout>
|
||||
Book Name : <label value="@bind(vm.selectedBook.name)" style="font-weight:bold"/>
|
||||
</hlayout>
|
||||
<hlayout>
|
||||
Book Author : <label value="@bind(vm.selectedBook.author)" style="font-weight:bold"/>
|
||||
</hlayout>
|
||||
<hlayout>
|
||||
Book Description : <label value="@bind(vm.selectedBook.description)" style="font-weight:bold"/>
|
||||
</hlayout>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</window>
|
||||
</zk>
|
Reference in New Issue
Block a user