Vytvořená agenda Služby. Servisní třídy agendy Materiál byly přesunuty

do balíku reqsubjects. 
closes #106
multitenant
Josef Rokos 11 years ago
parent 35131d555d
commit a637a077c0

@ -9,7 +9,8 @@ import info.bukova.isspst.reporting.ReportMapping;
import info.bukova.isspst.services.addressbook.AdbService; import info.bukova.isspst.services.addressbook.AdbService;
import info.bukova.isspst.services.buildings.BuildingService; import info.bukova.isspst.services.buildings.BuildingService;
import info.bukova.isspst.services.munits.MUnitService; 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.requirement.RequirementService;
import info.bukova.isspst.services.requirements.RequirementTypeService; import info.bukova.isspst.services.requirements.RequirementTypeService;
import info.bukova.isspst.services.users.RoleService; 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_BUILDINGS = "BUILDINGS";
public final static String MOD_MUNITS = "MUNITS"; public final static String MOD_MUNITS = "MUNITS";
public final static String MOD_MATERIAL = "MATERIAL"; 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_WORKGROUPS = "WORKGROUPS";
public final static String MOD_REQUIREMENTS = "REQUIREMENTS"; public final static String MOD_REQUIREMENTS = "REQUIREMENTS";
public final static String MOD_WORKFLOW = "WORKFLOW"; public final static String MOD_WORKFLOW = "WORKFLOW";
@ -68,6 +70,7 @@ public class Constants {
new Module(MOD_BUILDINGS, "Budovy", BuildingService.class), new Module(MOD_BUILDINGS, "Budovy", BuildingService.class),
new Module(MOD_MUNITS, "Měrné jednotky", MUnitService.class), new Module(MOD_MUNITS, "Měrné jednotky", MUnitService.class),
new Module(MOD_MATERIAL, "Materiál", MaterialService.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_WORKGROUPS, "Pracovní skupiny", WorkgroupService.class),
new Module(MOD_REQUIREMENTS, "Požadavky", RequirementService.class), new Module(MOD_REQUIREMENTS, "Požadavky", RequirementService.class),
new Module(MOD_WORKFLOW, "Procesy schválení", RequirementTypeService.class) new Module(MOD_WORKFLOW, "Procesy schválení", RequirementTypeService.class)

@ -0,0 +1,7 @@
package info.bukova.isspst.dao;
import info.bukova.isspst.data.ServiceItem;
public interface ServiceItemDao extends BaseDao<ServiceItem> {
}

@ -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<ServiceItem> implements ServiceItemDao {
}

@ -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 {
}

@ -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<ServiceItem> {
private ServiceItem condServiceItem;
public ServiceItemFilter(ServiceItem condServiceItem) {
this.condServiceItem = condServiceItem;
}
private static class ServiceItemMatcher extends TypeSafeMatcher<ServiceItem> {
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<ServiceItem> matchBuilding(ServiceItem material) {
return new ServiceItemMatcher(material);
}
}
@Override
public ServiceItemMatcher matcher() {
return new ServiceItemMatcher(condServiceItem);
}
@Override
public String queryString() {
// TODO query string
return "";
}
}

@ -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.data.Material;
import info.bukova.isspst.services.Service; import info.bukova.isspst.services.Service;

@ -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.data.Material;
import info.bukova.isspst.services.AbstractOwnedService; import info.bukova.isspst.services.AbstractOwnedService;

@ -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<ServiceItem> {
}

@ -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<ServiceItem> implements
ServiceItemService {
}

@ -1,4 +1,4 @@
package info.bukova.isspst.ui.material; package info.bukova.isspst.ui.reqsubjects;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

@ -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.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import info.bukova.isspst.data.Material; import info.bukova.isspst.data.Material;
import info.bukova.isspst.filters.MaterialFilter; 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; import info.bukova.isspst.ui.ListViewModel;
public class MaterialList extends ListViewModel<Material> { public class MaterialList extends ListViewModel<Material> {

@ -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<Material> {
@Init(superclass = true)
public void init() {
}
}

@ -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<ServiceItem> {
@WireVariable
private ServiceItemService serviceItemService;
@Init
public void init() {
service = serviceItemService;
dataClass = ServiceItem.class;
formZul = "serviceForm.zul";
dataFilter = new ServiceItemFilter(getFilterTemplate());
}
}

@ -20,5 +20,6 @@
<mapping class="info.bukova.isspst.data.Requirement"></mapping> <mapping class="info.bukova.isspst.data.Requirement"></mapping>
<mapping class="info.bukova.isspst.data.Workflow"></mapping> <mapping class="info.bukova.isspst.data.Workflow"></mapping>
<mapping class="info.bukova.isspst.data.RequirementType"></mapping> <mapping class="info.bukova.isspst.data.RequirementType"></mapping>
<mapping class="info.bukova.isspst.data.ServiceItem"></mapping>
</session-factory> </session-factory>
</hibernate-configuration> </hibernate-configuration>

@ -90,6 +90,9 @@ UsersGridColumnSureName=Příjmení
AgendaMaterial=Materiál AgendaMaterial=Materiál
MaterialFormTitle=Materiál MaterialFormTitle=Materiál
AgendaServices=Služby
ServiceFormTitle=Služba
AgendaWorkgroups=Střediska / komise AgendaWorkgroups=Střediska / komise
WorkgroupFormTitle=Pracvní skupina WorkgroupFormTitle=Pracvní skupina

@ -140,6 +140,10 @@
<property name="sessionFactory" ref="sessionFactory"/> <property name="sessionFactory" ref="sessionFactory"/>
</bean> </bean>
<bean id="serviceItemDao" class="info.bukova.isspst.dao.jpa.ServiceItemDaoJPA">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- Business logic --> <!-- Business logic -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/> <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
@ -192,7 +196,7 @@
<property name="dao" ref="permissionDao"/> <property name="dao" ref="permissionDao"/>
</bean> </bean>
<bean id="materialService" class="info.bukova.isspst.services.material.MaterialServiceImpl"> <bean id="materialService" class="info.bukova.isspst.services.reqsubjects.MaterialServiceImpl">
<property name="dao" ref="materialDao"/> <property name="dao" ref="materialDao"/>
<property name="validator" ref="validator"/> <property name="validator" ref="validator"/>
</bean> </bean>
@ -216,4 +220,9 @@
<property name="dao" ref="numericSeriesDao" /> <property name="dao" ref="numericSeriesDao" />
<property name="validator" ref="validator" /> <property name="validator" ref="validator" />
</bean> </bean>
<bean id="serviceItemService" class="info.bukova.isspst.services.reqsubjects.ServiceItemServiceImpl">
<property name="dao" ref="serviceItemDao" />
<property name="validator" ref="validator" />
</bean>
</beans> </beans>

@ -30,6 +30,7 @@
<menubar orient="vertical"> <menubar orient="vertical">
<menuitem label="${labels.AgendaSuppliers}" href="/lists/addressbook" disabled="${not sec:isAllGranted('PERM_READ_ADDRESSBOOK')}"/> <menuitem label="${labels.AgendaSuppliers}" href="/lists/addressbook" disabled="${not sec:isAllGranted('PERM_READ_ADDRESSBOOK')}"/>
<menuitem label="${labels.AgendaMaterial}" href="/lists/material" disabled="${not sec:isAllGranted('PERM_READ_MATERIAL')}"/> <menuitem label="${labels.AgendaMaterial}" href="/lists/material" disabled="${not sec:isAllGranted('PERM_READ_MATERIAL')}"/>
<menuitem label="${labels.AgendaServices}" href="/lists/service" disabled="${not sec:isAllGranted('PERM_READ_SERVICES')}"/>
<menuitem label="${labels.AgendaMUnits}" href="/lists/munits" disabled="${not sec:isAllGranted('PERM_READ_MUNITS')}" width="120px"/> <menuitem label="${labels.AgendaMUnits}" href="/lists/munits" disabled="${not sec:isAllGranted('PERM_READ_MUNITS')}" width="120px"/>
<menuitem label="${labels.AgendaBuildings}" href="/lists/buildings" disabled="${not sec:isAllGranted('PERM_READ_BUILDINGS')}" /> <menuitem label="${labels.AgendaBuildings}" href="/lists/buildings" disabled="${not sec:isAllGranted('PERM_READ_BUILDINGS')}" />
<menuitem label="${labels.AgendaRooms}" href="/lists/rooms" disabled="${not sec:isAllGranted('PERM_READ_ROOMS')}" /> <menuitem label="${labels.AgendaRooms}" href="/lists/rooms" disabled="${not sec:isAllGranted('PERM_READ_ROOMS')}" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

@ -1,7 +1,7 @@
<?page title="${labels.AgendaMaterial}" contentType="text/html;charset=UTF-8"?> <?page title="${labels.AgendaMaterial}" contentType="text/html;charset=UTF-8"?>
<zk> <zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window border="normal" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('info.bukova.isspst.ui.material.MaterialList')"> <window border="normal" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('info.bukova.isspst.ui.reqsubjects.MaterialList')">
<caption zclass="form-caption" label="${labels.AgendaMaterial}" /> <caption zclass="form-caption" label="${labels.AgendaMaterial}" />
<include src="/app/toolbar.zul" /> <include src="/app/toolbar.zul" />

@ -1,7 +1,7 @@
<?page title="${labels.MaterialFormTitle}" contentType="text/html;charset=UTF-8"?> <?page title="${labels.MaterialFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk> <zk>
<window id="editWin" closable="true" border="normal" position="center" apply="org.zkoss.bind.BindComposer" <window id="editWin" closable="true" border="normal" position="center" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.material.MaterialForm')"> viewModel="@id('vm') @init('info.bukova.isspst.ui.reqsubjects.MaterialForm')">
<caption src="/img/material.png" zclass="form-caption" label="${labels.MaterialFormTitle}" /> <caption src="/img/material.png" zclass="form-caption" label="${labels.MaterialFormTitle}" />
<vlayout> <vlayout>
<grid hflex="min"> <grid hflex="min">

@ -0,0 +1,10 @@
<?page title="${labels.AgendaServices}" contentType="text/html;charset=UTF-8"?>
<zk>
<zscript>
String gridZul = "service.zul";
</zscript>
<include src="/app/template.zhtml"/>
</zk>

@ -0,0 +1,58 @@
<?page title="${labels.AgendaServices}" contentType="text/html;charset=UTF-8"?>
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window border="normal" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('info.bukova.isspst.ui.reqsubjects.ServiceItemList')">
<caption zclass="form-caption" label="${labels.AgendaServices}" />
<include src="/app/toolbar.zul" />
<listbox model="@load(vm.dataList)" selectedItem="@bind(vm.dataBean)" height="500px">
<listhead menupopup="auto">
<listheader label="${labels.code}" sort="czech(code)" width="10%" />
<listheader label="${labels.name}" sort="czech(name)" width="30%" />
<listheader label="${labels.description}" sort="czech(description)" width="60%" />
</listhead>
<auxhead sclass="category-center" visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox value="@bind(vm.filterTemplate.code)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox value="@bind(vm.filterTemplate.name)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox value="@bind(vm.filterTemplate.description)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead>
<template name="model">
<listitem>
<listcell label="@load(each.code)" />
<listcell label="@load(each.name)" />
<listcell label="@load(each.description)" />
</listitem>
</template>
</listbox>
</window>
</zk>

@ -0,0 +1,36 @@
<?page title="${labels.ServiceFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="editWin" closable="true" border="normal" position="center" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.reqsubjects.ServiceItemForm')">
<caption src="/img/service.png" zclass="form-caption" label="${labels.ServiceFormTitle}" />
<vlayout>
<grid hflex="min">
<columns>
<column align="right" hflex="min" />
<column />
</columns>
<rows>
<row>
<cell sclass="row-title">${labels.code} :</cell>
<cell>
<textbox id="code" constraint="@load(vm.constriant)" width="200px" value="@bind(vm.dataBean.code)" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.name} :</cell>
<cell>
<textbox id="name" width="200px" value="@bind(vm.dataBean.name)" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.description} :</cell>
<cell>
<textbox id="description" width="300px" value="@bind(vm.dataBean.description)" />
</cell>
</row>
</rows>
</grid>
<include src="/app/formButtons.zul" />
</vlayout>
</window>
</zk>
Loading…
Cancel
Save