BrightSide Workbench Full Report + Source Code
org.turro.dossier.model.CategoryRequestsVM Class Reference

Public Member Functions

void init (@ExecutionArgParam("contact") IContact contact, @ExecutionArgParam("idCats") String idCats)
 
void add ()
 
void remove (@BindingParam("entity") Object entity)
 
void createContact (@BindingParam("entity") Object entity)
 
List< CategoryRequestgetModel ()
 
List< CategoryRequestgetFullModel ()
 
List< CategorySelectionWrappergetCategoryModel ()
 
String getLabel (String label)
 
String getContactName ()
 
void setContactName (String contactName)
 
String getContactMail ()
 
void setContactMail (String contactMail)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 48 of file CategoryRequestsVM.java.

Member Function Documentation

◆ add()

void org.turro.dossier.model.CategoryRequestsVM.add ( )

Definition at line 62 of file CategoryRequestsVM.java.

62  {
63  if(!Strings.isBlank(contactName) && !Strings.isBlank(contactMail)) {
64  Date now = new Date();
65  for(CategorySelectionWrapper cw : getCategoryModel()) {
66  if(cw.isSelected()) {
67  CategoryRequest cr = new CategoryRequest();
68  cr.setIContact(contact);
69  cr.setCreation(now);
70  cr.setContactName(contactName);
71  cr.setContactEmail(contactMail);
72  cr.setCategory(cw.getCategory());
73  getDao().saveObject(cr);
74  }
75  }
76  setContactName("");
77  setContactMail("");
78  }
79  }
List< CategorySelectionWrapper > getCategoryModel()
Here is the call graph for this function:

◆ createContact()

void org.turro.dossier.model.CategoryRequestsVM.createContact ( @BindingParam("entity") Object  entity)

Definition at line 91 of file CategoryRequestsVM.java.

91  {
92  if(entity instanceof CategoryRequest) {
93  try {
94  KeyValueMap kvm = new KeyValueMap("");
95  kvm.put("name", ((CategoryRequest) entity).getContactName());
96  kvm.put("email", ((CategoryRequest) entity).getContactEmail());
97  Contacts.startContactFromValues(kvm);
98  } catch (ParserException ex) {
99  Logger.getLogger(CategoryRequestsVM.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
100  }
101  }
102  }
Here is the call graph for this function:

◆ getCategoryModel()

List<CategorySelectionWrapper> org.turro.dossier.model.CategoryRequestsVM.getCategoryModel ( )

Definition at line 118 of file CategoryRequestsVM.java.

118  {
119  if(catModel == null) {
120  WhereClause wc = new WhereClause();
121  wc.addClause("select c from Category as c");
122  wc.addClause("where c.parent in (" + ProjectContext.getProjectContextAttribute("catsRequest", "0") + ")");
123  catModel = new CategoryModel(getDao().getResultList(wc));
124  }
125  return catModel;
126  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContactMail()

String org.turro.dossier.model.CategoryRequestsVM.getContactMail ( )

Definition at line 140 of file CategoryRequestsVM.java.

140  {
141  return contactMail;
142  }

◆ getContactName()

String org.turro.dossier.model.CategoryRequestsVM.getContactName ( )

Definition at line 132 of file CategoryRequestsVM.java.

132  {
133  return contactName;
134  }
Here is the caller graph for this function:

◆ getFullModel()

List<CategoryRequest> org.turro.dossier.model.CategoryRequestsVM.getFullModel ( )

Definition at line 112 of file CategoryRequestsVM.java.

112  {
113  WhereClause wc = new WhereClause();
114  wc.addClause("select cr from CategoryRequest as cr");
115  return getDao().getResultList(wc);
116  }
Here is the call graph for this function:

◆ getLabel()

String org.turro.dossier.model.CategoryRequestsVM.getLabel ( String  label)

Definition at line 128 of file CategoryRequestsVM.java.

128  {
129  return I_.get(label);
130  }
Here is the call graph for this function:

◆ getModel()

List<CategoryRequest> org.turro.dossier.model.CategoryRequestsVM.getModel ( )

Definition at line 104 of file CategoryRequestsVM.java.

104  {
105  WhereClause wc = new WhereClause();
106  wc.addClause("select cr from CategoryRequest as cr");
107  wc.addClause("where cr.idContact = :contact");
108  wc.addNamedValue("contact", contact.getId());
109  return getDao().getResultList(wc);
110  }
Here is the call graph for this function:

◆ init()

void org.turro.dossier.model.CategoryRequestsVM.init ( @ExecutionArgParam("contact") IContact  contact,
@ExecutionArgParam("idCats") String  idCats 
)

Definition at line 55 of file CategoryRequestsVM.java.

56  {
57  if(contact != null) this.contact = contact;
58  }

◆ remove()

void org.turro.dossier.model.CategoryRequestsVM.remove ( @BindingParam("entity") Object  entity)

Definition at line 83 of file CategoryRequestsVM.java.

83  {
84  if(entity instanceof CategoryRequest) {
85  getDao().deleteObject(entity);
86  }
87  }
void deleteObject(Object obj)
Definition: Dao.java:162
Here is the call graph for this function:

◆ setContactMail()

void org.turro.dossier.model.CategoryRequestsVM.setContactMail ( String  contactMail)

Definition at line 144 of file CategoryRequestsVM.java.

144  {
145  this.contactMail = contactMail;
146  }
Here is the caller graph for this function:

◆ setContactName()

void org.turro.dossier.model.CategoryRequestsVM.setContactName ( String  contactName)

Definition at line 136 of file CategoryRequestsVM.java.

136  {
137  this.contactName = contactName;
138  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: