From a637a077c007e6fc7d1083468b049a8a44a40a3f Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Mon, 30 Jun 2014 14:27:52 +0200 Subject: [PATCH] =?UTF-8?q?Vytvo=C5=99en=C3=A1=20agenda=20Slu=C5=BEby.=20S?= =?UTF-8?q?ervisn=C3=AD=20t=C5=99=C3=ADdy=20agendy=20Materi=C3=A1l=20byly?= =?UTF-8?q?=20p=C5=99esunuty=20do=20bal=C3=ADku=20reqsubjects.=20closes=20?= =?UTF-8?q?#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 zcmV-P4z}@$P)d zpZmGzIp=r2_j#Us&I8;?8$3l_-PpRI~7&+&h8d}@k^M3!vs2kDy^vknbOkEDC&F-R> zP6stw>{NQ9s_cefqTxuK(PGmBz}5pNzhS>?)^Cb`H0?kABPTvYb@ff0h=>#CM8xZw z%)S@bZSDsE3txZxE9>SgeH|+{?ohw;ap_T~H$YaWhgGY7L+fBPlk6Qp>-R6(K+k2uaGwbmuo^lWoCnB=DJf6S&ZGSNUytr=jHE>e^ z0Jn|2i@Iz!ib@g%!%^}DL)7CB^4cbgZ@xemn1frV)LClR|xycSJJUcrB8m*SN%pr3Q&IvLHv@vRMqFL8&=ymnj?VUFG{XuX}04H!FCd(Wnh7S7W zm3adTCnG6!M9PD+OHQSxrtS)Ly9{3;PsfnBJxW612%W7pQhk$&y1Jbd zkt8A_9tcOt7Yviz7a)hnPj;3*Kqi7x zsempa5xRIS)2fvzYK7v6OjNz^XvO}SkN#}7K1~k-5ROC!idQJovkK8^sjgLPQyw~X z^2?M*OCA9cKv%*+9J0)r%n35*kU4=sP$`sXF}IChk0mUk($QaXUVzvEq`eaj7l9?2h;q?dp zPxyK$6r%WGO|2>Xt6wi6N#=;k9MYA}|Jjua5gL^eoCBTa^_X6~0>x=_VLQKwRN6$m z@bnY=0I&%&<^cfW6E!9G&zOeuRVVRC&Kr1a;u#EeF2lK|E>t$QqOzfdHJh!7L?i|< zL?s!V^Oma~^m)3jJZ-&Fb0TdWwtIr1D25dkKoA7ToGv9e5j1Kg7#L*E;SEMm)nLL< zLn#C%ASkZEc;RC6Ps`6;pkalBp-W6)LRt`WwZc+_XJB{Q^_({Qlfq8RgKK#g(UIqgjV1Jg4 z%`rnJ0Rji!H$H&m>|#VE36d;bN*!4yM~|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mts<;dqpV7B%^jzst0v`B>>IrLrzaa(77 z`GZNl^9RoV?K(sv5(H8Cr~2dX*4?xRqomk2ptk`@sd{J<5{mK)r`&d}{m#NZf3#aH zh%k{kJFSP0e)4t=09>p+cwIflm~3sYnaRK&cA9F}hWzelM1^{M{mD&>2Hi35=IX&C zRZW<1TR)trZCU!sp_3~c>YGvj<#88)B{k>%{$abh?#p}4nQh^R3g$dff;0hO>lUF6C_cQ1dzZ0D2X>~1-3z} zRGuKf&KR=+a0B4ie&|gVCEsSaMo - + 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