Merge branch 'master' of https://git.bukova.info/repos/git/isspst
Conflicts: src/main/java/info/bukova/isspst/Constants.java src/main/resources/ValidationMessages.properties src/main/resources/hibernate.cfg.xml
This commit is contained in:
@@ -6,6 +6,7 @@ import info.bukova.isspst.reporting.Report;
|
||||
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.users.RoleService;
|
||||
import info.bukova.isspst.services.users.UserService;
|
||||
@@ -50,14 +51,16 @@ public class Constants {
|
||||
public final static String MOD_PERMISSIONS = "PERMISSIONS";
|
||||
public final static String MOD_ADDRESSBOOK = "ADDRESSBOOK";
|
||||
public final static String MOD_BUILDINGS = "BUILDINGS";
|
||||
public final static String MOD_MUNITS = "MUNITS";
|
||||
public final static String MOD_MATERIAL = "MATERIAL";
|
||||
public final static Module MODULES[] = {
|
||||
new Module(MOD_USERS, "Uživatelé", UserService.class),
|
||||
new Module(MOD_PERMISSIONS, "Práva", RoleService.class),
|
||||
new Module(MOD_ADDRESSBOOK, "Dodavatelé", AdbService.class),
|
||||
new Module(MOD_BUILDINGS, "Budovy", BuildingService.class),
|
||||
new Module(MOD_MATERIAL, "Materiál", MaterialService.class)
|
||||
};
|
||||
new Module(MOD_USERS, "Uživatelé", UserService.class)
|
||||
, new Module(MOD_PERMISSIONS, "Práva", RoleService.class)
|
||||
, new Module(MOD_ADDRESSBOOK, "Dodavatelé", AdbService.class)
|
||||
, new Module(MOD_BUILDINGS, "Budovy", BuildingService.class)
|
||||
, new Module(MOD_MUNITS, "Měrné jednotky", MUnitService.class)
|
||||
, new Module(MOD_MATERIAL, "Materiál", MaterialService.class)
|
||||
};
|
||||
|
||||
public final static String DYNAMIC_REPORT_NAME = "Tabulková sestava";
|
||||
public final static ReportMapping REPORTS[] = {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package info.bukova.isspst.dao;
|
||||
|
||||
import info.bukova.isspst.data.MUnit;
|
||||
|
||||
public interface MUnitDao extends BaseDao<MUnit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package info.bukova.isspst.dao.jpa;
|
||||
|
||||
import info.bukova.isspst.dao.MUnitDao;
|
||||
import info.bukova.isspst.data.MUnit;
|
||||
|
||||
public class MUnitDaoJPA extends BaseDaoJPA<MUnit> implements MUnitDao {
|
||||
|
||||
@Override
|
||||
public String getEntityName() {
|
||||
return "MUnit";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MUNIT")
|
||||
public class MUnit extends BaseData implements DataModel {
|
||||
|
||||
@Column(name = "CODE", unique = true)
|
||||
private String code;
|
||||
|
||||
@Column(name = "NAME")
|
||||
private String name;
|
||||
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* @return the code
|
||||
*/
|
||||
@NotBlank(message = "{MUnitsFormCodeConstr}")
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param code
|
||||
* the code to set
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* the name to set
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package info.bukova.isspst.filters;
|
||||
|
||||
import static info.bukova.isspst.StringUtils.nullStr;
|
||||
import info.bukova.isspst.data.MUnit;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeMatcher;
|
||||
|
||||
public class MUnitFilter implements Filter<MUnit> {
|
||||
|
||||
private MUnit condMUnit;
|
||||
|
||||
public MUnitFilter(MUnit condMUnit) {
|
||||
this.condMUnit = condMUnit;
|
||||
}
|
||||
|
||||
private static class MUnitMatcher extends TypeSafeMatcher<MUnit> {
|
||||
|
||||
private MUnit condMUnit;
|
||||
|
||||
public MUnitMatcher(MUnit cond) {
|
||||
this.condMUnit = cond;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void describeTo(Description desc) {
|
||||
desc.appendText("munits matches");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesSafely(MUnit item) {
|
||||
return nullStr(item.getCode()).toLowerCase().contains(nullStr(condMUnit.getCode()).toLowerCase())
|
||||
&& nullStr(item.getName()).toLowerCase().contains(nullStr(condMUnit.getName()).toLowerCase())
|
||||
&& nullStr(item.getDescription()).toLowerCase().contains(nullStr(condMUnit.getDescription()).toLowerCase());
|
||||
}
|
||||
|
||||
@Factory
|
||||
public static Matcher<MUnit> matchMUnit(MUnit munit) {
|
||||
return new MUnitMatcher(munit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MUnitMatcher matcher() {
|
||||
return new MUnitMatcher(condMUnit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String queryString() {
|
||||
// TODO query string
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package info.bukova.isspst.services.munits;
|
||||
|
||||
import info.bukova.isspst.data.MUnit;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
public interface MUnitService extends Service<MUnit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package info.bukova.isspst.services.munits;
|
||||
|
||||
import info.bukova.isspst.data.MUnit;
|
||||
import info.bukova.isspst.services.AbstractService;
|
||||
|
||||
public class MUnitServiceImpl extends AbstractService<MUnit> implements MUnitService{
|
||||
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package info.bukova.isspst.ui;
|
||||
package info.bukova.isspst.ui.buildings;
|
||||
|
||||
import info.bukova.isspst.data.Building;
|
||||
import info.bukova.isspst.ui.FormViewModel;
|
||||
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
package info.bukova.isspst.ui;
|
||||
package info.bukova.isspst.ui.buildings;
|
||||
|
||||
import info.bukova.isspst.data.Building;
|
||||
import info.bukova.isspst.filters.BuildingFilter;
|
||||
import info.bukova.isspst.services.buildings.BuildingService;
|
||||
import info.bukova.isspst.ui.ListViewModel;
|
||||
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
@@ -0,0 +1,14 @@
|
||||
package info.bukova.isspst.ui.munits;
|
||||
|
||||
import info.bukova.isspst.data.MUnit;
|
||||
import info.bukova.isspst.ui.FormViewModel;
|
||||
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
|
||||
public class MUnitsForm extends FormViewModel<MUnit> {
|
||||
|
||||
@Init(superclass = true)
|
||||
public void init() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package info.bukova.isspst.ui.munits;
|
||||
|
||||
import info.bukova.isspst.data.MUnit;
|
||||
import info.bukova.isspst.filters.MUnitFilter;
|
||||
import info.bukova.isspst.services.munits.MUnitService;
|
||||
import info.bukova.isspst.ui.ListViewModel;
|
||||
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
|
||||
public class MUnitsList extends ListViewModel<MUnit> {
|
||||
|
||||
@WireVariable
|
||||
private MUnitService munitService;
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
service = munitService;
|
||||
dataClass = MUnit.class;
|
||||
formZul = "munitsForm.zul";
|
||||
dataFilter = new MUnitFilter(getFilterTemplate());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user