Merge branch 'master' of https://git.bukova.info/repos/git/isspst
Conflicts: src/main/java/info/bukova/isspst/AppInitListener.java src/main/java/info/bukova/isspst/Constants.javamultitenant
						commit
						54edc0c4cf
					
				@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.dao;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.GlobalSettings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public interface GlobalSettingsDao extends BaseDao<GlobalSettings> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.dao;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.ServiceItem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public interface ServiceItemDao extends BaseDao<ServiceItem> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.dao.jpa;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.dao.GlobalSettingsDao;
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.GlobalSettings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class GlobalSettingsDaoJPA extends BaseDaoJPA<GlobalSettings> implements
 | 
				
			||||||
 | 
							GlobalSettingsDao {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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,22 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import javax.persistence.Column;
 | 
				
			||||||
 | 
					import javax.persistence.Entity;
 | 
				
			||||||
 | 
					import javax.persistence.Table;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Entity
 | 
				
			||||||
 | 
					@Table(name = "GLOBALSETTINGS")
 | 
				
			||||||
 | 
					public class GlobalSettings extends BaseData {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Column(name = "DATA", length = 1048576)
 | 
				
			||||||
 | 
						private String data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public String getData() {
 | 
				
			||||||
 | 
							return data;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setData(String data) {
 | 
				
			||||||
 | 
							this.data = data;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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,50 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.mail.MailMessage;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class SettingsData {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private boolean enableRequirements;
 | 
				
			||||||
 | 
						private MailMessage newReqTemplate;
 | 
				
			||||||
 | 
						private MailMessage authReqTemplate;
 | 
				
			||||||
 | 
						private MailMessage confReqTemplate;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public SettingsData() {
 | 
				
			||||||
 | 
							newReqTemplate = new MailMessage();
 | 
				
			||||||
 | 
							authReqTemplate = new MailMessage();
 | 
				
			||||||
 | 
							confReqTemplate = new MailMessage();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public boolean isEnableRequirements() {
 | 
				
			||||||
 | 
							return enableRequirements;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setEnableRequirements(boolean enableRequirements) {
 | 
				
			||||||
 | 
							this.enableRequirements = enableRequirements;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public MailMessage getNewReqTemplate() {
 | 
				
			||||||
 | 
							return newReqTemplate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setNewReqTemplate(MailMessage newReqTemplate) {
 | 
				
			||||||
 | 
							this.newReqTemplate = newReqTemplate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public MailMessage getAuthReqTemplate() {
 | 
				
			||||||
 | 
							return authReqTemplate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setAuthReqTemplate(MailMessage authReqTemplate) {
 | 
				
			||||||
 | 
							this.authReqTemplate = authReqTemplate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public MailMessage getConfReqTemplate() {
 | 
				
			||||||
 | 
							return confReqTemplate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void setConfReqTemplate(MailMessage confReqTemplate) {
 | 
				
			||||||
 | 
							this.confReqTemplate = confReqTemplate;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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 "";
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.mail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public interface Mailer {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public void send(MailMessage message);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,57 @@
 | 
				
			|||||||
 | 
					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;
 | 
				
			||||||
 | 
					import org.springframework.scheduling.annotation.Async;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class MailerWithAttachement implements Mailer {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private JavaMailSender sender;
 | 
				
			||||||
 | 
						private String from;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public MailerWithAttachement(JavaMailSender sender) {
 | 
				
			||||||
 | 
							this.sender = sender;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						@Async
 | 
				
			||||||
 | 
						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;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.mail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.mail.javamail.JavaMailSender;
 | 
				
			||||||
 | 
					import org.springframework.scheduling.annotation.Async;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class SimpleMailer implements Mailer {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private JavaMailSender sender;
 | 
				
			||||||
 | 
						private String from;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public SimpleMailer(JavaMailSender sender) {
 | 
				
			||||||
 | 
							this.sender = sender;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						@Async
 | 
				
			||||||
 | 
						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;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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 {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,110 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.services.settings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.io.IOException;
 | 
				
			||||||
 | 
					import java.io.StringReader;
 | 
				
			||||||
 | 
					import java.io.StringWriter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.exolab.castor.xml.MarshalException;
 | 
				
			||||||
 | 
					import org.exolab.castor.xml.Marshaller;
 | 
				
			||||||
 | 
					import org.exolab.castor.xml.Unmarshaller;
 | 
				
			||||||
 | 
					import org.exolab.castor.xml.ValidationException;
 | 
				
			||||||
 | 
					import org.slf4j.Logger;
 | 
				
			||||||
 | 
					import org.slf4j.LoggerFactory;
 | 
				
			||||||
 | 
					import org.springframework.security.access.prepost.PreAuthorize;
 | 
				
			||||||
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.GlobalSettings;
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.SettingsData;
 | 
				
			||||||
 | 
					import info.bukova.isspst.services.AbstractOwnedService;
 | 
				
			||||||
 | 
					import info.bukova.isspst.services.IsspstException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class GlobalSettingServiceImpl extends AbstractOwnedService<GlobalSettings> implements
 | 
				
			||||||
 | 
							GlobalSettingsService {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private final static Logger log = LoggerFactory.getLogger(GlobalSettingsService.class);
 | 
				
			||||||
 | 
						private final static String MARSHAL_ERROR = "Cannot marshal settings data: ";
 | 
				
			||||||
 | 
						private final static String UNMARSHAL_ERROR = "Cannot unmarshal settings data: ";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private Marshaller marshaller;
 | 
				
			||||||
 | 
						private Unmarshaller unmarshaller;
 | 
				
			||||||
 | 
						private SettingsData settings;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public GlobalSettingServiceImpl(Marshaller marshaller, Unmarshaller unmarshaller) {
 | 
				
			||||||
 | 
							this.marshaller = marshaller;
 | 
				
			||||||
 | 
							this.unmarshaller = unmarshaller;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						@Transactional
 | 
				
			||||||
 | 
						@PreAuthorize("hasPermission(this, 'PERM_ADD')")
 | 
				
			||||||
 | 
						public void add(GlobalSettings entity) {
 | 
				
			||||||
 | 
							if (!this.getAll().isEmpty()) {
 | 
				
			||||||
 | 
								throw new IsspstException("Global settings allready exists");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							if (entity.getData() == null || entity.getData().isEmpty()) {
 | 
				
			||||||
 | 
								SettingsData data = new SettingsData();
 | 
				
			||||||
 | 
								entity.setData(marshalData(data));
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							super.add(entity);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private String marshalData(SettingsData data) {
 | 
				
			||||||
 | 
							StringWriter wr = new StringWriter();
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								marshaller.setWriter(wr);
 | 
				
			||||||
 | 
								marshaller. marshal(data);
 | 
				
			||||||
 | 
							} catch (MarshalException e) {
 | 
				
			||||||
 | 
								log.error(MARSHAL_ERROR + e.getMessage());
 | 
				
			||||||
 | 
							} catch (ValidationException e) {
 | 
				
			||||||
 | 
								log.error(MARSHAL_ERROR + e.getMessage());
 | 
				
			||||||
 | 
							} catch (IOException e) {
 | 
				
			||||||
 | 
								log.error(MARSHAL_ERROR + e.getMessage());
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							return wr.toString();
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private SettingsData unmarshalData(String data) {
 | 
				
			||||||
 | 
							StringReader sr = new StringReader(data);
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								unmarshaller.setClass(SettingsData.class);
 | 
				
			||||||
 | 
								return (SettingsData) unmarshaller.unmarshal(sr);
 | 
				
			||||||
 | 
							} catch (MarshalException e) {
 | 
				
			||||||
 | 
								log.error(UNMARSHAL_ERROR + e.getMessage());
 | 
				
			||||||
 | 
							} catch (ValidationException e) {
 | 
				
			||||||
 | 
								log.error(UNMARSHAL_ERROR + e.getMessage());
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							return null;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						@Transactional
 | 
				
			||||||
 | 
						public SettingsData getSettings() {
 | 
				
			||||||
 | 
							if (settings == null) {
 | 
				
			||||||
 | 
								GlobalSettings gs = this.getAll().get(0);
 | 
				
			||||||
 | 
								settings = unmarshalData(gs.getData());
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return settings;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Override
 | 
				
			||||||
 | 
						@Transactional
 | 
				
			||||||
 | 
						@PreAuthorize("hasPermission(this, 'PERM_EDIT')")
 | 
				
			||||||
 | 
						public void updateSettings() {
 | 
				
			||||||
 | 
							if (this.getAll().isEmpty()) {
 | 
				
			||||||
 | 
								throw new IsspstException("Global settings does not exists");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							GlobalSettings gs = this.getAll().get(0);
 | 
				
			||||||
 | 
							gs.setData(marshalData(settings));
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							super.update(gs);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.services.settings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.GlobalSettings;
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.SettingsData;
 | 
				
			||||||
 | 
					import info.bukova.isspst.services.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public interface GlobalSettingsService extends Service<GlobalSettings> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void updateSettings();
 | 
				
			||||||
 | 
						public SettingsData getSettings();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.ui.reqsubjects;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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<Material> {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@WireVariable
 | 
				
			||||||
 | 
						private MUnitService munitService;
 | 
				
			||||||
 | 
						private List<MUnitEmb> munits;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Init(superclass = true)
 | 
				
			||||||
 | 
						public void init() {
 | 
				
			||||||
 | 
							List<MUnit> mu = munitService.getAll();
 | 
				
			||||||
 | 
							munits = new ArrayList<MUnitEmb>();
 | 
				
			||||||
 | 
							for (MUnit m : mu) {
 | 
				
			||||||
 | 
								MUnitEmb muEmb = new MUnitEmb(m); 
 | 
				
			||||||
 | 
								munits.add(muEmb);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public List<MUnitEmb> getMunits() {
 | 
				
			||||||
 | 
							return munits;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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> {
 | 
				
			||||||
@ -1,15 +1,15 @@
 | 
				
			|||||||
package info.bukova.isspst.ui.material;
 | 
					package info.bukova.isspst.ui.reqsubjects;
 | 
				
			||||||
 | 
					 | 
				
			||||||
import org.zkoss.bind.annotation.Init;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import info.bukova.isspst.data.Material;
 | 
					import info.bukova.isspst.data.Material;
 | 
				
			||||||
import info.bukova.isspst.ui.FormViewModel;
 | 
					import info.bukova.isspst.ui.FormViewModel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class MaterialForm extends FormViewModel<Material> {
 | 
					import org.zkoss.bind.annotation.Init;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class ServiceItemForm extends FormViewModel<Material> {
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	@Init(superclass = true)
 | 
						@Init(superclass = true)
 | 
				
			||||||
	public void init() {
 | 
						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());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,60 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.ui.settings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.zkoss.bind.annotation.BindingParam;
 | 
				
			||||||
 | 
					import org.zkoss.bind.annotation.Command;
 | 
				
			||||||
 | 
					import org.zkoss.bind.annotation.Init;
 | 
				
			||||||
 | 
					import org.zkoss.bind.annotation.NotifyChange;
 | 
				
			||||||
 | 
					import org.zkoss.zk.ui.select.annotation.WireVariable;
 | 
				
			||||||
 | 
					import org.zkoss.zul.Window;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.Requirement;
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.SettingsData;
 | 
				
			||||||
 | 
					import info.bukova.isspst.mail.MailMessage;
 | 
				
			||||||
 | 
					import info.bukova.isspst.services.settings.GlobalSettingsService;
 | 
				
			||||||
 | 
					import info.bukova.isspst.sort.ReflectionTools;
 | 
				
			||||||
 | 
					import info.bukova.isspst.ui.LocaleConverter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class GlobalSettingsVM {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@WireVariable
 | 
				
			||||||
 | 
						private GlobalSettingsService settingsService;
 | 
				
			||||||
 | 
						private SettingsData settings;
 | 
				
			||||||
 | 
						private LocaleConverter locConverter;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Init
 | 
				
			||||||
 | 
						public void init() {
 | 
				
			||||||
 | 
							settings = settingsService.getSettings();
 | 
				
			||||||
 | 
							locConverter = new LocaleConverter();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public SettingsData getSettings() {
 | 
				
			||||||
 | 
							return settings;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Command
 | 
				
			||||||
 | 
						public void save(@BindingParam("window") Window window) {
 | 
				
			||||||
 | 
							settingsService.updateSettings();
 | 
				
			||||||
 | 
							window.detach();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public List<String> getRequirementFields() {
 | 
				
			||||||
 | 
							return ReflectionTools.getEntityFields(Requirement.class);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public boolean isCanSave() {
 | 
				
			||||||
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public LocaleConverter getLocConverter() {
 | 
				
			||||||
 | 
							return locConverter;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Command
 | 
				
			||||||
 | 
						@NotifyChange("settings")
 | 
				
			||||||
 | 
						public void insertField(@BindingParam("field") String field, @BindingParam("message") MailMessage message) {
 | 
				
			||||||
 | 
							message.setText(message.getText() + ":" + field + ":");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,55 @@
 | 
				
			|||||||
 | 
					package info.bukova.isspst.ui.settings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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.Init;
 | 
				
			||||||
 | 
					import org.zkoss.zk.ui.select.annotation.WireVariable;
 | 
				
			||||||
 | 
					import org.zkoss.zul.Window;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import info.bukova.isspst.Constants;
 | 
				
			||||||
 | 
					import info.bukova.isspst.Module;
 | 
				
			||||||
 | 
					import info.bukova.isspst.data.NumberSeries;
 | 
				
			||||||
 | 
					import info.bukova.isspst.services.numberseries.NumberSeriesService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class NumberSeriesVM {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@WireVariable
 | 
				
			||||||
 | 
						private NumberSeriesService numericSeriesService;
 | 
				
			||||||
 | 
						private List<NumberSeries> numberSeriesList;
 | 
				
			||||||
 | 
						private Map<String, Module> moduleMap;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Init
 | 
				
			||||||
 | 
						public void init() {
 | 
				
			||||||
 | 
							numberSeriesList = new ArrayList<NumberSeries>(numericSeriesService.getAll());
 | 
				
			||||||
 | 
							moduleMap = new HashMap<String, Module>();
 | 
				
			||||||
 | 
							for (Module m : Constants.MODULES) {
 | 
				
			||||||
 | 
								moduleMap.put(m.getId(), m);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public List<NumberSeries> getNumberSeriesList() {
 | 
				
			||||||
 | 
							return numberSeriesList;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public boolean isCanSave() {
 | 
				
			||||||
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Command
 | 
				
			||||||
 | 
						public void save(@BindingParam("window") Window window) {
 | 
				
			||||||
 | 
							for (NumberSeries ns : numberSeriesList) {
 | 
				
			||||||
 | 
								numericSeriesService.update(ns);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							window.detach();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public Map<String, Module> getModuleMap() {
 | 
				
			||||||
 | 
							return moduleMap;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -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
 | 
				
			||||||
@ -0,0 +1,44 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<beans xmlns="http://www.springframework.org/schema/beans"
 | 
				
			||||||
 | 
						xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
						xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
 | 
				
			||||||
 | 
							<property name="host" value="${mail.host}"/>
 | 
				
			||||||
 | 
							<property name="port" value="${mail.port}"/>
 | 
				
			||||||
 | 
							<property name="username" value="${mail.username}"/>
 | 
				
			||||||
 | 
							<property name="password" value="${mail.password}"/>
 | 
				
			||||||
 | 
							<property name="defaultEncoding" value="UTF-8"/>
 | 
				
			||||||
 | 
							<property name="javaMailProperties">
 | 
				
			||||||
 | 
								<props>
 | 
				
			||||||
 | 
									<prop key="mail.smtp.auth">${mail.useauth}</prop>
 | 
				
			||||||
 | 
									<prop key="mail.smtp.starttls.enable">${mail.usessl}</prop>
 | 
				
			||||||
 | 
								</props>
 | 
				
			||||||
 | 
							</property>
 | 
				
			||||||
 | 
						</bean>
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						<bean id="mailer" class="info.bukova.isspst.mail.MailerWithAttachement">
 | 
				
			||||||
 | 
							<constructor-arg ref="mailSender"/>
 | 
				
			||||||
 | 
							<property name="from" value="${mail.from}"/>
 | 
				
			||||||
 | 
						</bean>
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						<bean id="simpleMailer" class="info.bukova.isspst.mail.SimpleMailer">
 | 
				
			||||||
 | 
							<constructor-arg ref="mailSender"/>
 | 
				
			||||||
 | 
							<property name="from" value="${mail.from}"/>
 | 
				
			||||||
 | 
						</bean>
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					<!-- 	<bean id="mailer" class="info.bukova.rsfaktura.services.mail.ThreadMailer"> -->
 | 
				
			||||||
 | 
					<!-- 		<constructor-arg ref="attachementMailer"/> -->
 | 
				
			||||||
 | 
					<!-- 	</bean> -->
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					<!-- 	<bean id="attachementMailer" class="info.bukova.rsfaktura.services.mail.AttachementMailer"> -->
 | 
				
			||||||
 | 
					<!-- 		<constructor-arg ref="tmpStorage"/> -->
 | 
				
			||||||
 | 
					<!-- 		<property name="from" value="josef.rokos@gmail.com"/> -->
 | 
				
			||||||
 | 
					<!-- 		<property name="sender" ref="mailSender"/> -->
 | 
				
			||||||
 | 
					<!-- 	</bean> -->
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					<!-- 	<bean id="messageBuilder" class="info.bukova.rsfaktura.services.mail.MailMessageBuilder"> -->
 | 
				
			||||||
 | 
					<!-- 		<constructor-arg ref="tmpStorage"/> -->
 | 
				
			||||||
 | 
					<!-- 	</bean> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</beans>
 | 
				
			||||||
@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					<?page title="Mail" contentType="text/html;charset=UTF-8"?>
 | 
				
			||||||
 | 
					<zk>
 | 
				
			||||||
 | 
					<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
 | 
				
			||||||
 | 
					<window id="mailWin" border="normal" apply="org.zkoss.bind.BindComposer"
 | 
				
			||||||
 | 
					viewModel="@id('vm') @init('info.bukova.isspst.ui.mail.MailForm')" width="500px" closable="true">
 | 
				
			||||||
 | 
						<caption zclass="form-caption" label="${labels.MailForm}" />
 | 
				
			||||||
 | 
						<grid>
 | 
				
			||||||
 | 
							<columns>
 | 
				
			||||||
 | 
								<column hflex="min"/>
 | 
				
			||||||
 | 
								<column/>
 | 
				
			||||||
 | 
							</columns>
 | 
				
			||||||
 | 
							<rows>
 | 
				
			||||||
 | 
								<row>
 | 
				
			||||||
 | 
									<label value="${labels.MailFor}"/> <textbox value="@bind(vm.to)" width="100%"/>
 | 
				
			||||||
 | 
								</row>
 | 
				
			||||||
 | 
								<row>
 | 
				
			||||||
 | 
									<label value="${labels.MailSubject }"/> <textbox value="@bind(vm.message.subject)" width="100%"/>
 | 
				
			||||||
 | 
								</row>
 | 
				
			||||||
 | 
								<row>
 | 
				
			||||||
 | 
									<label value="${labels.MailAttachement}"/> <textbox value="@load(vm.attachement)" readonly="true" width="100%"/>
 | 
				
			||||||
 | 
								</row>
 | 
				
			||||||
 | 
							</rows>
 | 
				
			||||||
 | 
						</grid>
 | 
				
			||||||
 | 
						<vbox>
 | 
				
			||||||
 | 
							<ckeditor width="470px" height="200px" value="@bind(vm.message.text)" toolbar="Basic"/>
 | 
				
			||||||
 | 
							<hbox>
 | 
				
			||||||
 | 
								<button label="${labels.MailSend}" onClick="@command('send', window=mailWin)"/> <button label="${labels.ButtonStorno}" onClick="mailWin.detach()"/>
 | 
				
			||||||
 | 
							</hbox>
 | 
				
			||||||
 | 
						</vbox>
 | 
				
			||||||
 | 
					</window>
 | 
				
			||||||
 | 
					</zk>
 | 
				
			||||||
											
												Binary file not shown.
											
										
									
								| 
		 After Width: | Height: | Size: 3.6 KiB  | 
											
												Binary file not shown.
											
										
									
								| 
		 After Width: | Height: | Size: 3.1 KiB  | 
@ -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>
 | 
				
			||||||
@ -0,0 +1,108 @@
 | 
				
			|||||||
 | 
					<?page title="EMail" contentType="text/html;charset=UTF-8"?>
 | 
				
			||||||
 | 
					<zk>
 | 
				
			||||||
 | 
					<window id="editWin" border="normal" closable="true" apply="org.zkoss.bind.BindComposer"
 | 
				
			||||||
 | 
					viewModel="@id('vm') @init('info.bukova.isspst.ui.settings.GlobalSettingsVM')" width="620px"
 | 
				
			||||||
 | 
					binder="@init(queueName='email')">
 | 
				
			||||||
 | 
					<caption src="/img/settings.png" zclass="form-caption" label="${labels.GlobalSettings}" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						<tabbox orient="vertical" height="400px">
 | 
				
			||||||
 | 
							<tabs width="100px">
 | 
				
			||||||
 | 
								<tab label="${labels.Requirements}"/>
 | 
				
			||||||
 | 
								<tab label="${labels.EMails}"/>
 | 
				
			||||||
 | 
							</tabs>
 | 
				
			||||||
 | 
							<tabpanels>
 | 
				
			||||||
 | 
								<tabpanel>
 | 
				
			||||||
 | 
									<div>
 | 
				
			||||||
 | 
										<checkbox label="${labels.EnableRequirements}" checked="@bind(vm.settings.enableRequirements)"/>
 | 
				
			||||||
 | 
									</div>
 | 
				
			||||||
 | 
								</tabpanel>
 | 
				
			||||||
 | 
								<tabpanel>
 | 
				
			||||||
 | 
									<tabbox>
 | 
				
			||||||
 | 
										<tabs>
 | 
				
			||||||
 | 
											<tab label="${labels.NewRequirement}"/>
 | 
				
			||||||
 | 
											<tab label="${labels.AuthRequirement}"/>
 | 
				
			||||||
 | 
											<tab label="${labels.ConfirmRequirement}"/>
 | 
				
			||||||
 | 
										</tabs>
 | 
				
			||||||
 | 
										<tabpanels>
 | 
				
			||||||
 | 
											<tabpanel>
 | 
				
			||||||
 | 
												<grid>
 | 
				
			||||||
 | 
													<columns>
 | 
				
			||||||
 | 
														<column hflex="min"/>
 | 
				
			||||||
 | 
														<column/>
 | 
				
			||||||
 | 
													</columns>
 | 
				
			||||||
 | 
													<rows>
 | 
				
			||||||
 | 
														<row>
 | 
				
			||||||
 | 
															<label value="${labels.MailSubject}"/> <textbox value="@bind(vm.settings.newReqTemplate.subject)" width="100%"/>
 | 
				
			||||||
 | 
														</row>
 | 
				
			||||||
 | 
														<row spans="2">
 | 
				
			||||||
 | 
															<vbox>
 | 
				
			||||||
 | 
																<ckeditor toolbar="Basic" value="@bind(vm.settings.newReqTemplate.text)" width="460px" height="180px"/>
 | 
				
			||||||
 | 
																<button label="${labels.InsertField}" popup="fieldsNew, position=after_start"/>
 | 
				
			||||||
 | 
															</vbox>
 | 
				
			||||||
 | 
														</row>
 | 
				
			||||||
 | 
													</rows>
 | 
				
			||||||
 | 
												</grid>
 | 
				
			||||||
 | 
											</tabpanel>
 | 
				
			||||||
 | 
											<tabpanel>
 | 
				
			||||||
 | 
												<grid>
 | 
				
			||||||
 | 
													<columns>
 | 
				
			||||||
 | 
														<column hflex="min"/>
 | 
				
			||||||
 | 
														<column/>
 | 
				
			||||||
 | 
													</columns>
 | 
				
			||||||
 | 
													<rows>
 | 
				
			||||||
 | 
														<row>
 | 
				
			||||||
 | 
															<label value="${labels.MailSubject}"/> <textbox value="@bind(vm.settings.authReqTemplate.subject)" width="100%"/>
 | 
				
			||||||
 | 
														</row>
 | 
				
			||||||
 | 
														<row spans="2">
 | 
				
			||||||
 | 
															<vbox>
 | 
				
			||||||
 | 
																<ckeditor toolbar="Basic" value="@bind(vm.settings.authReqTemplate.text)" width="460px" height="180px"/>
 | 
				
			||||||
 | 
																<button label="${labels.InsertField}" popup="fieldsAuth, position=after_start"/>
 | 
				
			||||||
 | 
															</vbox>
 | 
				
			||||||
 | 
														</row>
 | 
				
			||||||
 | 
													</rows>
 | 
				
			||||||
 | 
												</grid>
 | 
				
			||||||
 | 
											</tabpanel>
 | 
				
			||||||
 | 
											<tabpanel>
 | 
				
			||||||
 | 
												<grid>
 | 
				
			||||||
 | 
													<columns>
 | 
				
			||||||
 | 
														<column hflex="min"/>
 | 
				
			||||||
 | 
														<column/>
 | 
				
			||||||
 | 
													</columns>
 | 
				
			||||||
 | 
													<rows>
 | 
				
			||||||
 | 
														<row>
 | 
				
			||||||
 | 
															<label value="${labels.MailSubject}"/> <textbox value="@bind(vm.settings.confReqTemplate.subject)" width="100%"/>
 | 
				
			||||||
 | 
														</row>
 | 
				
			||||||
 | 
														<row spans="2">
 | 
				
			||||||
 | 
															<vbox>
 | 
				
			||||||
 | 
																<ckeditor toolbar="Basic" value="@bind(vm.settings.confReqTemplate.text)" width="460px" height="180px"/>
 | 
				
			||||||
 | 
																<button label="${labels.InsertField}" popup="fieldsConfirm, position=after_start"/>
 | 
				
			||||||
 | 
															</vbox>
 | 
				
			||||||
 | 
														</row>
 | 
				
			||||||
 | 
													</rows>
 | 
				
			||||||
 | 
												</grid>
 | 
				
			||||||
 | 
											</tabpanel>
 | 
				
			||||||
 | 
										</tabpanels>
 | 
				
			||||||
 | 
									</tabbox>
 | 
				
			||||||
 | 
									<menupopup id="fieldsNew" children="@load(vm.requirementFields)">
 | 
				
			||||||
 | 
										<template name="children">
 | 
				
			||||||
 | 
											<menuitem label="@load(each) @converter(vm.locConverter)" onClick="@command('insertField', field=each, message=vm.settings.newReqTemplate)"/>
 | 
				
			||||||
 | 
										</template>	
 | 
				
			||||||
 | 
									</menupopup>
 | 
				
			||||||
 | 
									<menupopup id="fieldsAuth" children="@load(vm.requirementFields)">
 | 
				
			||||||
 | 
										<template name="children">
 | 
				
			||||||
 | 
											<menuitem label="@load(each) @converter(vm.locConverter)" onClick="@command('insertField', field=each, message=vm.settings.authReqTemplate)"/>
 | 
				
			||||||
 | 
										</template>	
 | 
				
			||||||
 | 
									</menupopup>
 | 
				
			||||||
 | 
									<menupopup id="fieldsConfirm" children="@load(vm.requirementFields)">
 | 
				
			||||||
 | 
										<template name="children">
 | 
				
			||||||
 | 
											<menuitem label="@load(each) @converter(vm.locConverter)" onClick="@command('insertField', field=each, message=vm.settings.confReqTemplate)"/>
 | 
				
			||||||
 | 
										</template>	
 | 
				
			||||||
 | 
									</menupopup>		
 | 
				
			||||||
 | 
								</tabpanel>
 | 
				
			||||||
 | 
							</tabpanels>
 | 
				
			||||||
 | 
						</tabbox>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						<include src="/app/formButtons.zul"/>
 | 
				
			||||||
 | 
					</window>
 | 
				
			||||||
 | 
					</zk>
 | 
				
			||||||
@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					<?page title="NumberSeriesFormTitle" contentType="text/html;charset=UTF-8"?>
 | 
				
			||||||
 | 
					<zk>
 | 
				
			||||||
 | 
					<window id="editWin" border="normal" apply="org.zkoss.bind.BindComposer"
 | 
				
			||||||
 | 
					viewModel="@id('vm') @init('info.bukova.isspst.ui.settings.NumberSeriesVM')" closable="true" width="400px"
 | 
				
			||||||
 | 
					binder="@init(queueName='numSeries')">
 | 
				
			||||||
 | 
						<caption zclass="form-caption" label="${labels.NumberSeriesFormTitle}" />
 | 
				
			||||||
 | 
						<!-- <combobox></combobox> -->
 | 
				
			||||||
 | 
						<grid model="@load(vm.numberSeriesList)">
 | 
				
			||||||
 | 
							<columns>
 | 
				
			||||||
 | 
								<column hflex="min"/>
 | 
				
			||||||
 | 
								<column/>
 | 
				
			||||||
 | 
								<column hflex="min"/>
 | 
				
			||||||
 | 
								<column hflex="min"/>
 | 
				
			||||||
 | 
							</columns>
 | 
				
			||||||
 | 
							<rows>
 | 
				
			||||||
 | 
								<template name="model">
 | 
				
			||||||
 | 
									<row>
 | 
				
			||||||
 | 
										<label value="@load(vm.moduleMap[each.module].name.concat(' - ').concat(labels.Prefix))"/>
 | 
				
			||||||
 | 
										<textbox value="@bind(each.prefix)"/>
 | 
				
			||||||
 | 
										<label value="${labels.Number}"/>
 | 
				
			||||||
 | 
										<label value="@load(each.number)"/>
 | 
				
			||||||
 | 
									</row>
 | 
				
			||||||
 | 
								</template>
 | 
				
			||||||
 | 
							</rows>
 | 
				
			||||||
 | 
						</grid>
 | 
				
			||||||
 | 
						<include src="/app/formButtons.zul"/>
 | 
				
			||||||
 | 
					</window>
 | 
				
			||||||
 | 
					</zk>
 | 
				
			||||||
@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					<?page title="Limit" contentType="text/html;charset=UTF-8"?>
 | 
				
			||||||
 | 
					<zk>
 | 
				
			||||||
 | 
					<window id="editWin" border="normal" apply="org.zkoss.bind.BindComposer"
 | 
				
			||||||
 | 
					viewModel="@id('vm') @init('info.bukova.isspst.ui.requirements.LimitVM')">
 | 
				
			||||||
 | 
						<caption zclass="form-caption" label="${labels.LimitFormTitle}" />
 | 
				
			||||||
 | 
						<vbox>
 | 
				
			||||||
 | 
							<hbox>
 | 
				
			||||||
 | 
								<label value="${labels.Limit}"/>
 | 
				
			||||||
 | 
								<textbox value="@bind(vm.workflow.limit)"/>
 | 
				
			||||||
 | 
							</hbox>
 | 
				
			||||||
 | 
							<include src="/app/formButtons.zul" />
 | 
				
			||||||
 | 
						</vbox>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</window>
 | 
				
			||||||
 | 
					</zk>
 | 
				
			||||||
					Loading…
					
					
				
		Reference in New Issue