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 00000000..51bed1a4 Binary files /dev/null and b/src/main/webapp/img/service.png differ diff --git a/src/main/webapp/lists/material/material.zul b/src/main/webapp/lists/material/material.zul index cd71cc64..6a135bcb 100644 --- a/src/main/webapp/lists/material/material.zul +++ b/src/main/webapp/lists/material/material.zul @@ -1,7 +1,7 @@ - + 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