BrightSide Workbench Full Report + Source Code
org.turro.contacts.relation.RelationsVM Class Reference

Public Member Functions

 RelationsVM ()
 
void validate (@BindingParam("relation") BusinessRelation relation)
 
void delete (@BindingParam("relation") BusinessRelation relation)
 
void update ()
 
List< BusinessRelationgetModel ()
 
String getSearchValue ()
 
void setSearchValue (String searchValue)
 

Detailed Description

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

Definition at line 41 of file RelationsVM.java.

Constructor & Destructor Documentation

◆ RelationsVM()

org.turro.contacts.relation.RelationsVM.RelationsVM ( )

Definition at line 45 of file RelationsVM.java.

45  {
46  }

Member Function Documentation

◆ delete()

void org.turro.contacts.relation.RelationsVM.delete ( @BindingParam("relation") BusinessRelation  relation)

Definition at line 61 of file RelationsVM.java.

61  {
62  if(relation != null) {
63  Messages.confirmDeletion().show(() -> {
64  getDao().deleteObject(relation);
65  BindUtils.postNotifyChange(null, null, RelationsVM.this, "model");
66  });
67  }
68  }
void deleteObject(Object obj)
Definition: Dao.java:162
Here is the call graph for this function:

◆ getModel()

List<BusinessRelation> org.turro.contacts.relation.RelationsVM.getModel ( )

Definition at line 74 of file RelationsVM.java.

74  {
75  WhereClause wc = new WhereClause();
76  wc.addClause("select r from BusinessRelation r");
77  wc.addClause("where r.validated = FALSE");
78  if(!Strings.isBlank(searchValue)) {
79  wc.addClause("and (r.contact.name like :searchValue");
80  wc.addClause("or r.business.name like :searchValue)");
81  wc.addNamedValue("searchValue", SQLHelper.convertToPartialLike(searchValue));
82  }
83  return getDao().getResultList(wc);
84  }
Here is the call graph for this function:

◆ getSearchValue()

String org.turro.contacts.relation.RelationsVM.getSearchValue ( )

Definition at line 86 of file RelationsVM.java.

86  {
87  return searchValue;
88  }

◆ setSearchValue()

void org.turro.contacts.relation.RelationsVM.setSearchValue ( String  searchValue)

Definition at line 90 of file RelationsVM.java.

90  {
91  this.searchValue = searchValue;
92  }

◆ update()

void org.turro.contacts.relation.RelationsVM.update ( )

Definition at line 72 of file RelationsVM.java.

72 {}

◆ validate()

void org.turro.contacts.relation.RelationsVM.validate ( @BindingParam("relation") BusinessRelation  relation)

Definition at line 50 of file RelationsVM.java.

50  {
51  if(relation != null) {
52  relation.setValidated(true);
53  getDao().saveObject(relation);
54  SocialGroups.checkInheritance(List.of(relation.getContact()), getDao());
55  new QueueManager().subscribeDefaults(ConstraintKeys.from(relation.getContact().getIContact()));
56  new RelationAcceptedNotification(relation).send();
57  }
58  }
Here is the call graph for this function:

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