From 0e0fb3a43cda3ce357859be08fec7140d01d493f Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Mon, 30 Jun 2014 11:49:30 +0200 Subject: [PATCH 01/11] =?UTF-8?q?Nastavena=20servisn=C3=AD=20t=C5=99=C3=AD?= =?UTF-8?q?da=20k=20agend=C4=9B=20Po=C5=BEadavky.=20refs=20#100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/info/bukova/isspst/Constants.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/info/bukova/isspst/Constants.java b/src/main/java/info/bukova/isspst/Constants.java index 92704251..29e08c41 100644 --- a/src/main/java/info/bukova/isspst/Constants.java +++ b/src/main/java/info/bukova/isspst/Constants.java @@ -10,6 +10,7 @@ import info.bukova.isspst.services.addressbook.AdbService; import info.bukova.isspst.services.buildings.BuildingService; import info.bukova.isspst.services.munits.MUnitService; import info.bukova.isspst.services.material.MaterialService; +import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.requirements.RequirementTypeService; import info.bukova.isspst.services.users.RoleService; import info.bukova.isspst.services.users.UserService; @@ -68,7 +69,7 @@ public class Constants { new Module(MOD_MUNITS, "Měrné jednotky", MUnitService.class), new Module(MOD_MATERIAL, "Materiál", MaterialService.class), new Module(MOD_WORKGROUPS, "Pracovní skupiny", WorkgroupService.class), - new Module(MOD_REQUIREMENTS, "Požadavky", null), + new Module(MOD_REQUIREMENTS, "Požadavky", RequirementService.class), new Module(MOD_WORKFLOW, "Procesy schválení", RequirementTypeService.class) }; From 35131d555df3d0a58627e9d43ae022da3305e1ff Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Mon, 30 Jun 2014 13:13:36 +0200 Subject: [PATCH 02/11] =?UTF-8?q?Do=20agendy=20materi=C3=A1l=20byla=20p?= =?UTF-8?q?=C5=99idan=C3=A1=20m=C4=9Brn=C3=A1=20jednotka.=20refs=20#94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/bukova/isspst/data/MUnitEmb.java | 81 +++++++++++++++++++ .../info/bukova/isspst/data/Material.java | 12 ++- .../isspst/ui/material/MaterialForm.java | 22 ++++- .../webapp/WEB-INF/locales/columns.properties | 5 +- src/main/webapp/lists/material/material.zul | 6 +- .../webapp/lists/material/materialForm.zul | 10 +++ 6 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 src/main/java/info/bukova/isspst/data/MUnitEmb.java diff --git a/src/main/java/info/bukova/isspst/data/MUnitEmb.java b/src/main/java/info/bukova/isspst/data/MUnitEmb.java new file mode 100644 index 00000000..19ee5cfc --- /dev/null +++ b/src/main/java/info/bukova/isspst/data/MUnitEmb.java @@ -0,0 +1,81 @@ +package info.bukova.isspst.data; + +import javax.persistence.Column; +import javax.persistence.Embeddable; + +@Embeddable +public class MUnitEmb { + @Column(name = "MUNIT_ID") + private Integer id; + @Column(name = "MUNIT_CODE") + private String code; + @Column(name = "MUNIT_DESCRIPTION") + private String description; + @Column(name = "MUNIT_NAME") + private String name; + + public MUnitEmb() { + + } + + public MUnitEmb(MUnit munit) { + this.id = munit.getId(); + this.code = munit.getCode(); + this.description = munit.getDescription(); + this.name = munit.getName(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean eqWith(MUnit munit) { + return this.id == munit.getId() + && this.code.equals(munit.getCode()) + && this.name.equals(munit.getName()) + && this.description.equals(munit.getDescription()); + } + + @Override + public boolean equals(Object munit) { + return munit != null + && (munit instanceof MUnitEmb) + && this.id == ((MUnitEmb)munit).getId() + && (this.code == ((MUnitEmb)munit).getCode() || this.code.equals(((MUnitEmb)munit).getCode())) + && (this.name == ((MUnitEmb)munit).getName() || this.name.equals(((MUnitEmb)munit).getName())) + && (this.description == ((MUnitEmb)munit).getDescription() || this.description.equals(((MUnitEmb)munit).getDescription())); + } + + @Override + public String toString() { + return this.code + " - " + this.name; + } +} diff --git a/src/main/java/info/bukova/isspst/data/Material.java b/src/main/java/info/bukova/isspst/data/Material.java index 0b57148a..1aee860c 100644 --- a/src/main/java/info/bukova/isspst/data/Material.java +++ b/src/main/java/info/bukova/isspst/data/Material.java @@ -1,5 +1,6 @@ package info.bukova.isspst.data; +import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.Table; @@ -7,6 +8,15 @@ import javax.persistence.Table; @Table(name="MATERIAL") public class Material extends RequirementSubject { - + @Embedded + private MUnitEmb munit; + + public MUnitEmb getMunit() { + return munit; + } + + public void setMunit(MUnitEmb munit) { + this.munit = munit; + } } diff --git a/src/main/java/info/bukova/isspst/ui/material/MaterialForm.java b/src/main/java/info/bukova/isspst/ui/material/MaterialForm.java index 2bab7210..aaf52ee8 100644 --- a/src/main/java/info/bukova/isspst/ui/material/MaterialForm.java +++ b/src/main/java/info/bukova/isspst/ui/material/MaterialForm.java @@ -1,15 +1,35 @@ package info.bukova.isspst.ui.material; +import java.util.ArrayList; +import java.util.List; + import org.zkoss.bind.annotation.Init; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import info.bukova.isspst.data.MUnit; +import info.bukova.isspst.data.MUnitEmb; import info.bukova.isspst.data.Material; +import info.bukova.isspst.services.munits.MUnitService; import info.bukova.isspst.ui.FormViewModel; public class MaterialForm extends FormViewModel { + @WireVariable + private MUnitService munitService; + private List munits; + @Init(superclass = true) public void init() { - + List mu = munitService.getAll(); + munits = new ArrayList(); + for (MUnit m : mu) { + MUnitEmb muEmb = new MUnitEmb(m); + munits.add(muEmb); + } + } + + public List getMunits() { + return munits; } } diff --git a/src/main/webapp/WEB-INF/locales/columns.properties b/src/main/webapp/WEB-INF/locales/columns.properties index 0c067f53..e86db2e6 100644 --- a/src/main/webapp/WEB-INF/locales/columns.properties +++ b/src/main/webapp/WEB-INF/locales/columns.properties @@ -39,4 +39,7 @@ username=Uživatelské jméno #Skupiny centre=Středisko -members=Členové \ No newline at end of file +members=Členové + +#Materiál +munit=Měrná jednotka \ No newline at end of file diff --git a/src/main/webapp/lists/material/material.zul b/src/main/webapp/lists/material/material.zul index fc549c14..cd71cc64 100644 --- a/src/main/webapp/lists/material/material.zul +++ b/src/main/webapp/lists/material/material.zul @@ -8,8 +8,9 @@ - - + + + @@ -50,6 +51,7 @@ + diff --git a/src/main/webapp/lists/material/materialForm.zul b/src/main/webapp/lists/material/materialForm.zul index 0270c94b..356a4a05 100644 --- a/src/main/webapp/lists/material/materialForm.zul +++ b/src/main/webapp/lists/material/materialForm.zul @@ -28,6 +28,16 @@ + + ${labels.munit} : + + + + + + From a637a077c007e6fc7d1083468b049a8a44a40a3f Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Mon, 30 Jun 2014 14:27:52 +0200 Subject: [PATCH 03/11] =?UTF-8?q?Vytvo=C5=99en=C3=A1=20agenda=20Slu=C5=BEb?= =?UTF-8?q?y.=20Servisn=C3=AD=20t=C5=99=C3=ADdy=20agendy=20Materi=C3=A1l?= =?UTF-8?q?=20byly=20p=C5=99esunuty=20do=20bal=C3=ADku=20reqsubjects.=20cl?= =?UTF-8?q?oses=20#106?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/info/bukova/isspst/Constants.java | 5 +- .../bukova/isspst/dao/ServiceItemDao.java | 7 +++ .../isspst/dao/jpa/ServiceItemDaoJPA.java | 8 +++ .../info/bukova/isspst/data/ServiceItem.java | 10 +++ .../isspst/filters/ServiceItemFilter.java | 56 +++++++++++++++++ .../MaterialService.java | 2 +- .../MaterialServiceImpl.java | 2 +- .../reqsubjects/ServiceItemService.java | 8 +++ .../reqsubjects/ServiceItemServiceImpl.java | 9 +++ .../MaterialForm.java | 2 +- .../MaterialList.java | 4 +- .../ui/reqsubjects/ServiceItemForm.java | 15 +++++ .../ui/reqsubjects/ServiceItemList.java | 24 ++++++++ src/main/resources/hibernate.cfg.xml | 1 + .../WEB-INF/locales/zk-label.properties | 3 + .../webapp/WEB-INF/spring/root-context.xml | 11 +++- src/main/webapp/app/navigation.zul | 1 + src/main/webapp/img/service.png | Bin 0 -> 3657 bytes src/main/webapp/lists/material/material.zul | 2 +- .../webapp/lists/material/materialForm.zul | 2 +- src/main/webapp/lists/service/index.zul | 10 +++ src/main/webapp/lists/service/service.zul | 58 ++++++++++++++++++ src/main/webapp/lists/service/serviceForm.zul | 36 +++++++++++ 23 files changed, 267 insertions(+), 9 deletions(-) create mode 100644 src/main/java/info/bukova/isspst/dao/ServiceItemDao.java create mode 100644 src/main/java/info/bukova/isspst/dao/jpa/ServiceItemDaoJPA.java create mode 100644 src/main/java/info/bukova/isspst/data/ServiceItem.java create mode 100644 src/main/java/info/bukova/isspst/filters/ServiceItemFilter.java rename src/main/java/info/bukova/isspst/services/{material => reqsubjects}/MaterialService.java (75%) rename src/main/java/info/bukova/isspst/services/{material => reqsubjects}/MaterialServiceImpl.java (80%) create mode 100644 src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemService.java create mode 100644 src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemServiceImpl.java rename src/main/java/info/bukova/isspst/ui/{material => reqsubjects}/MaterialForm.java (94%) rename src/main/java/info/bukova/isspst/ui/{material => reqsubjects}/MaterialList.java (83%) create mode 100644 src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemForm.java create mode 100644 src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemList.java create mode 100644 src/main/webapp/img/service.png create mode 100644 src/main/webapp/lists/service/index.zul create mode 100644 src/main/webapp/lists/service/service.zul create mode 100644 src/main/webapp/lists/service/serviceForm.zul diff --git a/src/main/java/info/bukova/isspst/Constants.java b/src/main/java/info/bukova/isspst/Constants.java index 29e08c41..d1455733 100644 --- a/src/main/java/info/bukova/isspst/Constants.java +++ b/src/main/java/info/bukova/isspst/Constants.java @@ -9,7 +9,8 @@ import info.bukova.isspst.reporting.ReportMapping; import info.bukova.isspst.services.addressbook.AdbService; import info.bukova.isspst.services.buildings.BuildingService; import info.bukova.isspst.services.munits.MUnitService; -import info.bukova.isspst.services.material.MaterialService; +import info.bukova.isspst.services.reqsubjects.MaterialService; +import info.bukova.isspst.services.reqsubjects.ServiceItemService; import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.requirements.RequirementTypeService; import info.bukova.isspst.services.users.RoleService; @@ -58,6 +59,7 @@ public class Constants { public final static String MOD_BUILDINGS = "BUILDINGS"; public final static String MOD_MUNITS = "MUNITS"; public final static String MOD_MATERIAL = "MATERIAL"; + public final static String MOD_SERVICES = "SERVICES"; public final static String MOD_WORKGROUPS = "WORKGROUPS"; public final static String MOD_REQUIREMENTS = "REQUIREMENTS"; public final static String MOD_WORKFLOW = "WORKFLOW"; @@ -68,6 +70,7 @@ public class Constants { new Module(MOD_BUILDINGS, "Budovy", BuildingService.class), new Module(MOD_MUNITS, "Měrné jednotky", MUnitService.class), new Module(MOD_MATERIAL, "Materiál", MaterialService.class), + new Module(MOD_SERVICES, "Služby", ServiceItemService.class), new Module(MOD_WORKGROUPS, "Pracovní skupiny", WorkgroupService.class), new Module(MOD_REQUIREMENTS, "Požadavky", RequirementService.class), new Module(MOD_WORKFLOW, "Procesy schválení", RequirementTypeService.class) diff --git a/src/main/java/info/bukova/isspst/dao/ServiceItemDao.java b/src/main/java/info/bukova/isspst/dao/ServiceItemDao.java new file mode 100644 index 00000000..3f81f8aa --- /dev/null +++ b/src/main/java/info/bukova/isspst/dao/ServiceItemDao.java @@ -0,0 +1,7 @@ +package info.bukova.isspst.dao; + +import info.bukova.isspst.data.ServiceItem; + +public interface ServiceItemDao extends BaseDao { + +} diff --git a/src/main/java/info/bukova/isspst/dao/jpa/ServiceItemDaoJPA.java b/src/main/java/info/bukova/isspst/dao/jpa/ServiceItemDaoJPA.java new file mode 100644 index 00000000..dc18ed76 --- /dev/null +++ b/src/main/java/info/bukova/isspst/dao/jpa/ServiceItemDaoJPA.java @@ -0,0 +1,8 @@ +package info.bukova.isspst.dao.jpa; + +import info.bukova.isspst.dao.ServiceItemDao; +import info.bukova.isspst.data.ServiceItem; + +public class ServiceItemDaoJPA extends BaseDaoJPA implements ServiceItemDao { + +} diff --git a/src/main/java/info/bukova/isspst/data/ServiceItem.java b/src/main/java/info/bukova/isspst/data/ServiceItem.java new file mode 100644 index 00000000..7ab42142 --- /dev/null +++ b/src/main/java/info/bukova/isspst/data/ServiceItem.java @@ -0,0 +1,10 @@ +package info.bukova.isspst.data; + +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "SERVICE") +public class ServiceItem extends RequirementSubject { + +} diff --git a/src/main/java/info/bukova/isspst/filters/ServiceItemFilter.java b/src/main/java/info/bukova/isspst/filters/ServiceItemFilter.java new file mode 100644 index 00000000..d12dc3b2 --- /dev/null +++ b/src/main/java/info/bukova/isspst/filters/ServiceItemFilter.java @@ -0,0 +1,56 @@ +package info.bukova.isspst.filters; + +import static info.bukova.isspst.StringUtils.nullStr; +import info.bukova.isspst.data.ServiceItem; + +import org.hamcrest.Description; +import org.hamcrest.Factory; +import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; + +public class ServiceItemFilter implements Filter { + + private ServiceItem condServiceItem; + + public ServiceItemFilter(ServiceItem condServiceItem) { + this.condServiceItem = condServiceItem; + } + + private static class ServiceItemMatcher extends TypeSafeMatcher { + + private ServiceItem condServiceItem; + + public ServiceItemMatcher(ServiceItem cond) { + this.condServiceItem = cond; + } + + @Override + public void describeTo(Description desc) { + desc.appendText("material matches"); + } + + @Override + public boolean matchesSafely(ServiceItem item) { + return nullStr(item.getCode()).toLowerCase().contains(nullStr(condServiceItem.getCode()).toLowerCase()) + && nullStr(item.getName()).toLowerCase().contains(nullStr(condServiceItem.getName()).toLowerCase()) + && nullStr(item.getDescription()).toLowerCase().contains(nullStr(condServiceItem.getDescription()).toLowerCase()); + } + + @Factory + public static Matcher matchBuilding(ServiceItem material) { + return new ServiceItemMatcher(material); + } + } + + @Override + public ServiceItemMatcher matcher() { + return new ServiceItemMatcher(condServiceItem); + } + + @Override + public String queryString() { + // TODO query string + return ""; + } + +} diff --git a/src/main/java/info/bukova/isspst/services/material/MaterialService.java b/src/main/java/info/bukova/isspst/services/reqsubjects/MaterialService.java similarity index 75% rename from src/main/java/info/bukova/isspst/services/material/MaterialService.java rename to src/main/java/info/bukova/isspst/services/reqsubjects/MaterialService.java index aa40c282..a62f4e2a 100644 --- a/src/main/java/info/bukova/isspst/services/material/MaterialService.java +++ b/src/main/java/info/bukova/isspst/services/reqsubjects/MaterialService.java @@ -1,4 +1,4 @@ -package info.bukova.isspst.services.material; +package info.bukova.isspst.services.reqsubjects; import info.bukova.isspst.data.Material; import info.bukova.isspst.services.Service; diff --git a/src/main/java/info/bukova/isspst/services/material/MaterialServiceImpl.java b/src/main/java/info/bukova/isspst/services/reqsubjects/MaterialServiceImpl.java similarity index 80% rename from src/main/java/info/bukova/isspst/services/material/MaterialServiceImpl.java rename to src/main/java/info/bukova/isspst/services/reqsubjects/MaterialServiceImpl.java index 2e9a63e1..1e3e8086 100644 --- a/src/main/java/info/bukova/isspst/services/material/MaterialServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/reqsubjects/MaterialServiceImpl.java @@ -1,4 +1,4 @@ -package info.bukova.isspst.services.material; +package info.bukova.isspst.services.reqsubjects; import info.bukova.isspst.data.Material; import info.bukova.isspst.services.AbstractOwnedService; diff --git a/src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemService.java b/src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemService.java new file mode 100644 index 00000000..a8b2d95c --- /dev/null +++ b/src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemService.java @@ -0,0 +1,8 @@ +package info.bukova.isspst.services.reqsubjects; + +import info.bukova.isspst.data.ServiceItem; +import info.bukova.isspst.services.Service; + +public interface ServiceItemService extends Service { + +} diff --git a/src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemServiceImpl.java b/src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemServiceImpl.java new file mode 100644 index 00000000..cc704c86 --- /dev/null +++ b/src/main/java/info/bukova/isspst/services/reqsubjects/ServiceItemServiceImpl.java @@ -0,0 +1,9 @@ +package info.bukova.isspst.services.reqsubjects; + +import info.bukova.isspst.data.ServiceItem; +import info.bukova.isspst.services.AbstractOwnedService; + +public class ServiceItemServiceImpl extends AbstractOwnedService implements + ServiceItemService { + +} diff --git a/src/main/java/info/bukova/isspst/ui/material/MaterialForm.java b/src/main/java/info/bukova/isspst/ui/reqsubjects/MaterialForm.java similarity index 94% rename from src/main/java/info/bukova/isspst/ui/material/MaterialForm.java rename to src/main/java/info/bukova/isspst/ui/reqsubjects/MaterialForm.java index aaf52ee8..3f789bc3 100644 --- a/src/main/java/info/bukova/isspst/ui/material/MaterialForm.java +++ b/src/main/java/info/bukova/isspst/ui/reqsubjects/MaterialForm.java @@ -1,4 +1,4 @@ -package info.bukova.isspst.ui.material; +package info.bukova.isspst.ui.reqsubjects; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/info/bukova/isspst/ui/material/MaterialList.java b/src/main/java/info/bukova/isspst/ui/reqsubjects/MaterialList.java similarity index 83% rename from src/main/java/info/bukova/isspst/ui/material/MaterialList.java rename to src/main/java/info/bukova/isspst/ui/reqsubjects/MaterialList.java index b2dc9137..ab730b9a 100644 --- a/src/main/java/info/bukova/isspst/ui/material/MaterialList.java +++ b/src/main/java/info/bukova/isspst/ui/reqsubjects/MaterialList.java @@ -1,11 +1,11 @@ -package info.bukova.isspst.ui.material; +package info.bukova.isspst.ui.reqsubjects; import org.zkoss.bind.annotation.Init; import org.zkoss.zk.ui.select.annotation.WireVariable; import info.bukova.isspst.data.Material; import info.bukova.isspst.filters.MaterialFilter; -import info.bukova.isspst.services.material.MaterialService; +import info.bukova.isspst.services.reqsubjects.MaterialService; import info.bukova.isspst.ui.ListViewModel; public class MaterialList extends ListViewModel { diff --git a/src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemForm.java b/src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemForm.java new file mode 100644 index 00000000..a956c693 --- /dev/null +++ b/src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemForm.java @@ -0,0 +1,15 @@ +package info.bukova.isspst.ui.reqsubjects; + +import info.bukova.isspst.data.Material; +import info.bukova.isspst.ui.FormViewModel; + +import org.zkoss.bind.annotation.Init; + +public class ServiceItemForm extends FormViewModel { + + @Init(superclass = true) + public void init() { + + } + +} diff --git a/src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemList.java b/src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemList.java new file mode 100644 index 00000000..f0298c40 --- /dev/null +++ b/src/main/java/info/bukova/isspst/ui/reqsubjects/ServiceItemList.java @@ -0,0 +1,24 @@ +package info.bukova.isspst.ui.reqsubjects; + +import info.bukova.isspst.data.ServiceItem; +import info.bukova.isspst.filters.ServiceItemFilter; +import info.bukova.isspst.services.reqsubjects.ServiceItemService; +import info.bukova.isspst.ui.ListViewModel; + +import org.zkoss.bind.annotation.Init; +import org.zkoss.zk.ui.select.annotation.WireVariable; + +public class ServiceItemList extends ListViewModel { + + @WireVariable + private ServiceItemService serviceItemService; + + @Init + public void init() { + service = serviceItemService; + dataClass = ServiceItem.class; + formZul = "serviceForm.zul"; + dataFilter = new ServiceItemFilter(getFilterTemplate()); + } + +} diff --git a/src/main/resources/hibernate.cfg.xml b/src/main/resources/hibernate.cfg.xml index 3471a052..5b798d77 100644 --- a/src/main/resources/hibernate.cfg.xml +++ b/src/main/resources/hibernate.cfg.xml @@ -20,5 +20,6 @@ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index f66657a0..946c81e4 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -90,6 +90,9 @@ UsersGridColumnSureName=Příjmení AgendaMaterial=Materiál MaterialFormTitle=Materiál +AgendaServices=Služby +ServiceFormTitle=Služba + AgendaWorkgroups=Střediska / komise WorkgroupFormTitle=Pracvní skupina diff --git a/src/main/webapp/WEB-INF/spring/root-context.xml b/src/main/webapp/WEB-INF/spring/root-context.xml index b503cbbc..d4b47b1c 100644 --- a/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/src/main/webapp/WEB-INF/spring/root-context.xml @@ -140,6 +140,10 @@ + + + + @@ -192,7 +196,7 @@ - + @@ -216,4 +220,9 @@ + + + + + diff --git a/src/main/webapp/app/navigation.zul b/src/main/webapp/app/navigation.zul index ce0b8d81..c115ee0d 100644 --- a/src/main/webapp/app/navigation.zul +++ b/src/main/webapp/app/navigation.zul @@ -30,6 +30,7 @@ + diff --git a/src/main/webapp/img/service.png b/src/main/webapp/img/service.png new file mode 100644 index 0000000000000000000000000000000000000000..51bed1a4311c9efa48ec6091699795254cfb4dbb GIT binary patch literal 3657 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 - + diff --git a/src/main/webapp/lists/material/materialForm.zul b/src/main/webapp/lists/material/materialForm.zul index 356a4a05..54a9321d 100644 --- a/src/main/webapp/lists/material/materialForm.zul +++ b/src/main/webapp/lists/material/materialForm.zul @@ -1,7 +1,7 @@ + viewModel="@id('vm') @init('info.bukova.isspst.ui.reqsubjects.MaterialForm')"> diff --git a/src/main/webapp/lists/service/index.zul b/src/main/webapp/lists/service/index.zul new file mode 100644 index 00000000..e963369b --- /dev/null +++ b/src/main/webapp/lists/service/index.zul @@ -0,0 +1,10 @@ + + + + + String gridZul = "service.zul"; + + + + + \ No newline at end of file diff --git a/src/main/webapp/lists/service/service.zul b/src/main/webapp/lists/service/service.zul new file mode 100644 index 00000000..2e902757 --- /dev/null +++ b/src/main/webapp/lists/service/service.zul @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +
+
\ No newline at end of file diff --git a/src/main/webapp/lists/service/serviceForm.zul b/src/main/webapp/lists/service/serviceForm.zul new file mode 100644 index 00000000..46f44e7b --- /dev/null +++ b/src/main/webapp/lists/service/serviceForm.zul @@ -0,0 +1,36 @@ + + + + + + + + + + + + + ${labels.code} : + + + + + + ${labels.name} : + + + + + + ${labels.description} : + + + + + + + + + + \ No newline at end of file From e26f56fcb9c44feaaaec718553af253b37872943 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Tue, 1 Jul 2014 22:46:33 +0200 Subject: [PATCH 04/11] =?UTF-8?q?V=20procesech=20schv=C3=A1len=C3=AD=20lze?= =?UTF-8?q?=20zadat=20limit=20pro=20schv=C3=A1len=C3=AD=20k=20dan=C3=A9=20?= =?UTF-8?q?roli.=20closes=20#107?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/bukova/isspst/data/Workflow.java | 12 +++++ .../isspst/ui/requirements/LimitVM.java | 33 ++++++++++++++ .../ui/requirements/RequirementTypesVM.java | 45 +++++++++++++++++++ .../WEB-INF/locales/zk-label.properties | 3 ++ src/main/webapp/settings/workflow/limit.zul | 15 +++++++ .../webapp/settings/workflow/workflow.zul | 26 +++++++++-- 6 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 src/main/java/info/bukova/isspst/ui/requirements/LimitVM.java create mode 100644 src/main/webapp/settings/workflow/limit.zul diff --git a/src/main/java/info/bukova/isspst/data/Workflow.java b/src/main/java/info/bukova/isspst/data/Workflow.java index a5d839cd..ac489428 100644 --- a/src/main/java/info/bukova/isspst/data/Workflow.java +++ b/src/main/java/info/bukova/isspst/data/Workflow.java @@ -1,5 +1,7 @@ package info.bukova.isspst.data; +import java.math.BigDecimal; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.JoinColumn; @@ -21,6 +23,8 @@ public class Workflow extends BaseData { private Role role; @Column(name = "WORDER") private Integer wOrder; + @Column(name = "WLIMIT", precision=15, scale=4) + private BigDecimal limit; public Boolean getCentre() { return centre; @@ -56,4 +60,12 @@ public class Workflow extends BaseData { this.wOrder = order; } + public BigDecimal getLimit() { + return limit; + } + + public void setLimit(BigDecimal limit) { + this.limit = limit; + } + } diff --git a/src/main/java/info/bukova/isspst/ui/requirements/LimitVM.java b/src/main/java/info/bukova/isspst/ui/requirements/LimitVM.java new file mode 100644 index 00000000..45597f4c --- /dev/null +++ b/src/main/java/info/bukova/isspst/ui/requirements/LimitVM.java @@ -0,0 +1,33 @@ +package info.bukova.isspst.ui.requirements; + +import info.bukova.isspst.data.Workflow; + +import org.zkoss.bind.annotation.BindingParam; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.ExecutionArgParam; +import org.zkoss.bind.annotation.Init; +import org.zkoss.zul.Window; + +public class LimitVM { + + private Workflow workflow; + + @Init + public void init(@ExecutionArgParam("workflow") Workflow workflow) { + this.workflow = workflow; + } + + public Workflow getWorkflow() { + return workflow; + } + + @Command + public void save(@BindingParam("window") Window window) { + window.detach(); + } + + public boolean isCanSave() { + return true; + } + +} diff --git a/src/main/java/info/bukova/isspst/ui/requirements/RequirementTypesVM.java b/src/main/java/info/bukova/isspst/ui/requirements/RequirementTypesVM.java index 0b6807a9..6d7340e6 100644 --- a/src/main/java/info/bukova/isspst/ui/requirements/RequirementTypesVM.java +++ b/src/main/java/info/bukova/isspst/ui/requirements/RequirementTypesVM.java @@ -7,16 +7,22 @@ import info.bukova.isspst.data.Workflow; import info.bukova.isspst.services.requirements.RequirementTypeService; import info.bukova.isspst.services.users.RoleService; +import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.GlobalCommand; import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.NotifyChange; +import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.DropEvent; import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zul.Listitem; +import org.zkoss.zul.Window; public class RequirementTypesVM { @@ -28,6 +34,8 @@ public class RequirementTypesVM { private List centreRoles; private List workgroupRoles; private RequirementType selected; + private Workflow wgSelWorkflow; + private Workflow centreSelWorkflow; @Init public void init() { @@ -199,5 +207,42 @@ public class RequirementTypesVM { this.selected = selected; } + + @Command + @NotifyChange({"selected", "centreSelWorkflow", "wgSelWorkflow"}) + public void overLimit(@BindingParam("workflow") Workflow workflow) { + if (workflow.getLimit() != null && !workflow.getLimit().equals(BigDecimal.ZERO)) { + workflow.setLimit(null); + reqTypeService.update(selected); + return; + } + + Map params = new HashMap(); + params.put("workflow", workflow); + Window win = (Window) Executions.createComponents("/settings/workflow/limit.zul", null, params); + win.doModal(); + } + + @GlobalCommand + @NotifyChange("selected") + public void refresh() { + reqTypeService.update(selected); + } + + public Workflow getWgSelWorkflow() { + return wgSelWorkflow; + } + + public void setWgSelWorkflow(Workflow wgSelWorkflow) { + this.wgSelWorkflow = wgSelWorkflow; + } + + public Workflow getCentreSelWorkflow() { + return centreSelWorkflow; + } + + public void setCentreSelWorkflow(Workflow centreSelWorkflow) { + this.centreSelWorkflow = centreSelWorkflow; + } } diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 946c81e4..9aeb2b18 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -104,6 +104,9 @@ CentreRoles=Role středisek Workflow=Proces schválení WorkgroupWorkflow=Schválení v komisi CentreWorkflow=Schválení ve středisku +LimitFormTitle=Limit pro schválení +Limit=Limit: +OverLimit=Pouze nadlimitní CentresForRequirements=Střediska, pro která lze vkládat požadavky WorkgroupMembership=Členství v komisích diff --git a/src/main/webapp/settings/workflow/limit.zul b/src/main/webapp/settings/workflow/limit.zul new file mode 100644 index 00000000..1a2b8990 --- /dev/null +++ b/src/main/webapp/settings/workflow/limit.zul @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/settings/workflow/workflow.zul b/src/main/webapp/settings/workflow/workflow.zul index e38ab85d..7c13f256 100644 --- a/src/main/webapp/settings/workflow/workflow.zul +++ b/src/main/webapp/settings/workflow/workflow.zul @@ -45,27 +45,45 @@ + onDrop="@command('addRoleWg', event=event)" + selectedItem="@bind(vm.wgSelWorkflow)"> + onDrop="@command('addRoleCentre', event=event)" + selectedItem="@bind(vm.centreSelWorkflow)"> + + + + + + From 1283fe627dcbf27d4302778cb71663c2984d8385 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Wed, 2 Jul 2014 16:21:24 +0200 Subject: [PATCH 05/11] =?UTF-8?q?Formul=C3=A1=C5=99=20a=20t=C5=99=C3=ADdy?= =?UTF-8?q?=20pro=20odes=C3=ADl=C3=A1n=C3=AD=20e-mail=C5=AF.=20Implementov?= =?UTF-8?q?=C3=A1no=20odes=C3=ADl=C3=A1n=C3=AD=20PDF=20sestav=20mailem.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 7 ++ .../info/bukova/isspst/mail/MailMessage.java | 49 +++++++++++++ .../java/info/bukova/isspst/mail/Mailer.java | 7 ++ .../isspst/mail/MailerWithAttachement.java | 55 ++++++++++++++ .../info/bukova/isspst/mail/SimpleMailer.java | 31 ++++++++ .../info/bukova/isspst/ui/mail/MailForm.java | 73 +++++++++++++++++++ .../bukova/isspst/ui/reporting/ReportVM.java | 14 ++++ .../WEB-INF/locales/zk-label.properties | 6 ++ src/main/webapp/WEB-INF/mail.properties | 7 ++ .../webapp/WEB-INF/spring/mail-services.xml | 44 +++++++++++ .../webapp/WEB-INF/spring/root-context.xml | 3 + src/main/webapp/app/mailForm.zul | 31 ++++++++ src/main/webapp/app/reporting/report.zul | 2 +- 13 files changed, 328 insertions(+), 1 deletion(-) create mode 100644 src/main/java/info/bukova/isspst/mail/MailMessage.java create mode 100644 src/main/java/info/bukova/isspst/mail/Mailer.java create mode 100644 src/main/java/info/bukova/isspst/mail/MailerWithAttachement.java create mode 100644 src/main/java/info/bukova/isspst/mail/SimpleMailer.java create mode 100644 src/main/java/info/bukova/isspst/ui/mail/MailForm.java create mode 100644 src/main/webapp/WEB-INF/mail.properties create mode 100644 src/main/webapp/WEB-INF/spring/mail-services.xml create mode 100644 src/main/webapp/app/mailForm.zul diff --git a/pom.xml b/pom.xml index 4ee4cc5d..fe4a45d7 100644 --- a/pom.xml +++ b/pom.xml @@ -308,6 +308,13 @@ DynamicJasper-core-fonts 1.0 + + + + javax.mail + mail + 1.4.3 + diff --git a/src/main/java/info/bukova/isspst/mail/MailMessage.java b/src/main/java/info/bukova/isspst/mail/MailMessage.java new file mode 100644 index 00000000..43df9fe4 --- /dev/null +++ b/src/main/java/info/bukova/isspst/mail/MailMessage.java @@ -0,0 +1,49 @@ +package info.bukova.isspst.mail; + +import org.springframework.mail.SimpleMailMessage; + +public class MailMessage extends SimpleMailMessage { + + /** + * + */ + private static final long serialVersionUID = -3240551712942170018L; + + private boolean html; + private String attachementName; + private byte[] attachementData; + private String contentType; + + public boolean isHtml() { + return html; + } + + public void setHtml(boolean html) { + this.html = html; + } + + public byte[] getAttachementData() { + return attachementData; + } + + public void setAttachementData(byte[] attachementData) { + this.attachementData = attachementData; + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public String getAttachementName() { + return attachementName; + } + + public void setAttachementName(String attachementName) { + this.attachementName = attachementName; + } + +} diff --git a/src/main/java/info/bukova/isspst/mail/Mailer.java b/src/main/java/info/bukova/isspst/mail/Mailer.java new file mode 100644 index 00000000..d01e5daf --- /dev/null +++ b/src/main/java/info/bukova/isspst/mail/Mailer.java @@ -0,0 +1,7 @@ +package info.bukova.isspst.mail; + +public interface Mailer { + + public void send(MailMessage message); + +} diff --git a/src/main/java/info/bukova/isspst/mail/MailerWithAttachement.java b/src/main/java/info/bukova/isspst/mail/MailerWithAttachement.java new file mode 100644 index 00000000..5dcde5ba --- /dev/null +++ b/src/main/java/info/bukova/isspst/mail/MailerWithAttachement.java @@ -0,0 +1,55 @@ +package info.bukova.isspst.mail; + +import javax.mail.MessagingException; +import javax.mail.internet.MimeMessage; + +import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.InputStreamSource; +import org.springframework.mail.MailParseException; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; + +public class MailerWithAttachement implements Mailer { + + private JavaMailSender sender; + private String from; + + public MailerWithAttachement(JavaMailSender sender) { + this.sender = sender; + } + + @Override + public void send(MailMessage message) { + MimeMessage mimeMessage = sender.createMimeMessage(); + + try { + MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true); + + if (message.getFrom() == null || message.getFrom().isEmpty()) { + if (from == null || from.isEmpty()) { + message.setFrom("tomcat@is.bukova.info"); + } else { + message.setFrom(from); + } + } + + helper.setFrom(message.getFrom()); + helper.setTo(message.getTo()); + helper.setSubject(message.getSubject()); + helper.setText(message.getText(), message.isHtml()); + + if (message.getAttachementData() != null) { + InputStreamSource source = new ByteArrayResource(message.getAttachementData()); + helper.addAttachment(message.getAttachementName(), source, message.getContentType()); + } + } catch (MessagingException e) { + throw new MailParseException(e); + } + sender.send(mimeMessage); + } + + public void setFrom(String from) { + this.from = from; + } + +} diff --git a/src/main/java/info/bukova/isspst/mail/SimpleMailer.java b/src/main/java/info/bukova/isspst/mail/SimpleMailer.java new file mode 100644 index 00000000..0d905017 --- /dev/null +++ b/src/main/java/info/bukova/isspst/mail/SimpleMailer.java @@ -0,0 +1,31 @@ +package info.bukova.isspst.mail; + +import org.springframework.mail.javamail.JavaMailSender; + +public class SimpleMailer implements Mailer { + + private JavaMailSender sender; + private String from; + + public SimpleMailer(JavaMailSender sender) { + this.sender = sender; + } + + @Override + public void send(MailMessage message) { + if (message.getFrom() == null || message.getFrom().isEmpty()) { + if (from == null || from.isEmpty()) { + message.setFrom("tomcat@is.bukova.info"); + } else { + message.setFrom(from); + } + } + + sender.send(message); + } + + public void setFrom(String from) { + this.from = from; + } + +} diff --git a/src/main/java/info/bukova/isspst/ui/mail/MailForm.java b/src/main/java/info/bukova/isspst/ui/mail/MailForm.java new file mode 100644 index 00000000..09c42e91 --- /dev/null +++ b/src/main/java/info/bukova/isspst/ui/mail/MailForm.java @@ -0,0 +1,73 @@ +package info.bukova.isspst.ui.mail; + +import info.bukova.isspst.mail.MailMessage; +import info.bukova.isspst.mail.Mailer; +import info.bukova.isspst.reporting.Generator; +import info.bukova.isspst.reporting.GeneratorFactory; +import info.bukova.isspst.reporting.ReportDefinition; + +import org.zkoss.bind.annotation.BindingParam; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.ExecutionArgParam; +import org.zkoss.bind.annotation.Init; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zul.Window; + +public class MailForm { + + @WireVariable + private Mailer mailer; + @WireVariable + private ReportDefinition reportDefinition; + @WireVariable + private GeneratorFactory genFactory; + private MailMessage message; + private String to; + private String attachement; + private boolean report; + + @Init + public void init(@ExecutionArgParam("report") Boolean report) { + message = new MailMessage(); + message.setHtml(true); + this.report = report; + if (report) { + attachement = "report.pdf"; + } + } + + @Command + public void send(@BindingParam("window") Window window) { + message.setTo(to); + if (report) { + Generator generator = genFactory.createGenerator(reportDefinition); + message.setAttachementData(generator.generate()); + message.setAttachementName("report.pdf"); + message.setContentType("application/pdf"); + } + + mailer.send(message); + window.detach(); + } + + public MailMessage getMessage() { + return message; + } + + public void setMessage(MailMessage message) { + this.message = message; + } + + public String getTo() { + return to; + } + + public void setTo(String to) { + this.to = to; + } + + public String getAttachement() { + return attachement; + } + +} diff --git a/src/main/java/info/bukova/isspst/ui/reporting/ReportVM.java b/src/main/java/info/bukova/isspst/ui/reporting/ReportVM.java index 5fda96d7..dd0f4dcd 100644 --- a/src/main/java/info/bukova/isspst/ui/reporting/ReportVM.java +++ b/src/main/java/info/bukova/isspst/ui/reporting/ReportVM.java @@ -1,6 +1,12 @@ package info.bukova.isspst.ui.reporting; +import java.util.HashMap; +import java.util.Map; + +import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Init; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zul.Window; public class ReportVM { @@ -8,5 +14,13 @@ public class ReportVM { public void init() { } + + @Command + public void send() { + Map params = new HashMap(); + params.put("report", true); + Window mailForm = (Window) Executions.createComponents("/app/mailForm.zul", null, params); + mailForm.doModal(); + } } diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 9aeb2b18..8a66b098 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -134,6 +134,12 @@ ReportTitle=Nadpis sestavy: ReportOptions=Volby sestavy ReportNoOptions=Žádná nestavení +MailForm=Odeslání e-mailu +MailFor=Komu: +MailSubject=Předmět: +MailSend=Odeslat +MailAttachement=Příloha: + Error=Chyba ErrorRights=K vykobání této operace nemáte dostatečná oprávnění diff --git a/src/main/webapp/WEB-INF/mail.properties b/src/main/webapp/WEB-INF/mail.properties new file mode 100644 index 00000000..1dbc1730 --- /dev/null +++ b/src/main/webapp/WEB-INF/mail.properties @@ -0,0 +1,7 @@ +mail.from=kosef.rokos@gmail.com +mail.host=smtp.gmail.com +mail.port=587 +mail.useauth=true +mail.usessl=true +mail.username=josef.rokos@gmail.com +mail.password=XXXXXX \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/spring/mail-services.xml b/src/main/webapp/WEB-INF/spring/mail-services.xml new file mode 100644 index 00000000..4e58ad9a --- /dev/null +++ b/src/main/webapp/WEB-INF/spring/mail-services.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + ${mail.useauth} + ${mail.usessl} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/spring/root-context.xml b/src/main/webapp/WEB-INF/spring/root-context.xml index d4b47b1c..9074fc57 100644 --- a/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/src/main/webapp/WEB-INF/spring/root-context.xml @@ -16,6 +16,7 @@ /WEB-INF/jdbc.properties /WEB-INF/ldap.properties + /WEB-INF/mail.properties
@@ -75,6 +76,8 @@ + + diff --git a/src/main/webapp/app/mailForm.zul b/src/main/webapp/app/mailForm.zul new file mode 100644 index 00000000..971c969f --- /dev/null +++ b/src/main/webapp/app/mailForm.zul @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + +