19 package org.turro.dossier.model;
21 import java.util.Date;
22 import java.util.List;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
25 import org.turro.collections.parser.ParserException;
26 import org.turro.action.Contacts;
27 import org.turro.auth.Authentication;
28 import org.turro.collections.KeyValueMap;
29 import org.turro.dossier.db.DossierPU;
30 import org.turro.dossier.dossier.ProjectContext;
31 import org.turro.dossier.entity.CategoryRequest;
32 import org.turro.elephant.context.ElephantContext;
33 import org.turro.elephant.db.WhereClause;
34 import org.turro.i18n.I_;
35 import org.turro.jpa.Dao;
36 import org.turro.plugin.contacts.IContact;
37 import org.zkoss.bind.annotation.BindingParam;
38 import org.zkoss.bind.annotation.Command;
39 import org.zkoss.bind.annotation.ExecutionArgParam;
40 import org.zkoss.bind.annotation.Init;
41 import org.zkoss.bind.annotation.NotifyChange;
42 import org.zkoss.lang.Strings;
51 private String contactName, contactMail;
56 @ExecutionArgParam(
"idCats") String idCats) {
57 if(contact !=
null) this.contact = contact;
63 if(!Strings.isBlank(contactName) && !Strings.isBlank(contactMail)) {
64 Date now =
new Date();
73 getDao().saveObject(cr);
83 public
void remove(@BindingParam("entity") Object entity) {
94 KeyValueMap kvm =
new KeyValueMap(
"");
98 }
catch (ParserException ex) {
106 wc.
addClause(
"select cr from CategoryRequest as cr");
107 wc.
addClause(
"where cr.idContact = :contact");
109 return getDao().getResultList(wc);
114 wc.
addClause(
"select cr from CategoryRequest as cr");
115 return getDao().getResultList(wc);
119 if(catModel ==
null) {
121 wc.
addClause(
"select c from Category as c");
129 return I_.
get(label);
137 this.contactName = contactName;
145 this.contactMail = contactMail;
152 private Dao getDao() {
static IContact getIContact()
static String getProjectContextAttribute(String attribute, String defaultValue)
void setContactEmail(String contactEmail)
void setContactName(String contactName)
void setIContact(IContact contact)
void setCategory(Category category)
void setCreation(Date creation)
List< CategorySelectionWrapper > getCategoryModel()
void init(@ExecutionArgParam("contact") IContact contact, @ExecutionArgParam("idCats") String idCats)
List< CategoryRequest > getModel()
String getLabel(String label)
void createContact(@BindingParam("entity") Object entity)
void remove(@BindingParam("entity") Object entity)
void setContactMail(String contactMail)
List< CategoryRequest > getFullModel()
void setContactName(String contactName)
static String logMsg(String msg)
void addClause(String clause)
void addNamedValue(String name, Object value)
static String get(String msg)
void deleteObject(Object obj)