BrightSide Workbench Full Report + Source Code
org.turro.contacts.name.NamesVM Class Reference

Public Member Functions

Set< NameEntrygetSelected ()
 
void setSelected (Set< NameEntry > selected)
 
void processSelected ()
 
List< NameEntrygetModel ()
 

Detailed Description

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

Definition at line 37 of file NamesVM.java.

Member Function Documentation

◆ getModel()

List<NameEntry> org.turro.contacts.name.NamesVM.getModel ( )

Definition at line 66 of file NamesVM.java.

66  {
67  return SqlClause.select("c").from("Contact c")
68  .where().group().isNull("complexName.formal").or().isNull("complexName.informal").endGroup()
69  .and().in("type", List.of(ContactType.CONTACT_USER, ContactType.CONTACT_INTERNAL))
70  .orderBy("complexName.full")
71  .dao(dao.get()).resultList(Contact.class).stream()
72  .map(c -> NameEntry.from(c.getId(), c.getComplexName().getFull(), false))
73  .filter(e -> !e.isEmpty())
74  .toList();
75  }
Here is the call graph for this function:

◆ getSelected()

Set<NameEntry> org.turro.contacts.name.NamesVM.getSelected ( )

Definition at line 41 of file NamesVM.java.

41  {
42  return selected;
43  }

◆ processSelected()

void org.turro.contacts.name.NamesVM.processSelected ( )

Definition at line 50 of file NamesVM.java.

50  {
51  if(selected != null && !selected.isEmpty()) {
52  Messages.confirmProcess().add(selected.size() + " items").show(() -> {
53  selected.forEach(item -> {
54  SqlClause.update("Contact")
55  .set("complexName.full", item.getFull())
56  .andSet("complexName.informal", item.getInformal())
57  .andSet("complexName.formal", item.getFormal())
58  .where().equal("id", item.getContactId())
59  .dao(dao.get()).execute();
60  });
61  BindUtils.postNotifyChange(null, null, NamesVM.this, "model");
62  });
63  }
64  }
Here is the call graph for this function:

◆ setSelected()

void org.turro.contacts.name.NamesVM.setSelected ( Set< NameEntry selected)

Definition at line 45 of file NamesVM.java.

45  {
46  this.selected = selected;
47  }

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