BrightSide Workbench Full Report + Source Code
org.turro.alliance.client.model.PublishGrantVM Class Reference

Public Member Functions

void init (@ExecutionArgParam("projectGrant") ProjectGrant projectGrant)
 
boolean isNeedsSave ()
 
void setNeedsSave (boolean needsSave)
 
void add ()
 
void save ()
 
void delete (@BindingParam("pgpublic") AxProjectGrantPublic pgpublic)
 
List< AxProjectGrantPublicgetModel ()
 
WsServer getServer ()
 
void setServer (WsServer server)
 

Detailed Description

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

Definition at line 42 of file PublishGrantVM.java.

Member Function Documentation

◆ add()

void org.turro.alliance.client.model.PublishGrantVM.add ( )

Definition at line 64 of file PublishGrantVM.java.

64  {
65  if(server != null && !inModel(server)) {
66  AxProjectGrantPublic pc = new AxProjectGrantPublic();
67  pc.setServerDomain(server.getServerDomain());
68  pc.setProjectGrant(projectGrant);
69  model.add(pc);
70  needsSave = true;
71  } else {
72  Toasts.message(I_.get("Already in model"));
73  }
74  }
String getServerDomain()
Definition: WsServer.java:52
Here is the call graph for this function:

◆ delete()

void org.turro.alliance.client.model.PublishGrantVM.delete ( @BindingParam("pgpublic") AxProjectGrantPublic  pgpublic)

Definition at line 91 of file PublishGrantVM.java.

91  {
92  deletions.add(pgpublic);
93  model.removeIf(pc -> pc.getServerDomain().equals(pgpublic.getServerDomain()));
94  needsSave = true;
95  }

◆ getModel()

List<AxProjectGrantPublic> org.turro.alliance.client.model.PublishGrantVM.getModel ( )

Definition at line 104 of file PublishGrantVM.java.

104  {
105  if(model == null) {
106  model = SqlClause.select("pc").from("AxProjectGrantPublic pc")
107  .where().equal("pc.projectGrantId", String.valueOf(projectGrant.getId()))
108  .dao(new AlliancePU())
109  .resultList(AxProjectGrantPublic.class);
110  }
111  return model;
112  }
Here is the call graph for this function:

◆ getServer()

WsServer org.turro.alliance.client.model.PublishGrantVM.getServer ( )

Definition at line 122 of file PublishGrantVM.java.

122  {
123  return server;
124  }

◆ init()

void org.turro.alliance.client.model.PublishGrantVM.init ( @ExecutionArgParam("projectGrant") ProjectGrant  projectGrant)

Definition at line 47 of file PublishGrantVM.java.

47  {
48  if(projectGrant != null) this.projectGrant = projectGrant;
49  if(this.projectGrant == null) {
50  this.projectGrant = (ProjectGrant) Executions.getCurrent().getAttribute("projectGrant");
51  }
52  }

◆ isNeedsSave()

boolean org.turro.alliance.client.model.PublishGrantVM.isNeedsSave ( )

Definition at line 54 of file PublishGrantVM.java.

54  {
55  return needsSave;
56  }

◆ save()

void org.turro.alliance.client.model.PublishGrantVM.save ( )

Definition at line 78 of file PublishGrantVM.java.

78  {
79  Dao dao = new AlliancePU();
80  model.stream().filter(pc -> pc.isEmpty())
81  .forEach(pc -> dao.deleteEntity(pc));
82  model.removeIf(pc -> pc.isEmpty());
83  dao.saveEntities(model);
84  dao.deleteCollection(deletions);
85  deletions.clear();
86  needsSave = false;
87  }
Here is the call graph for this function:

◆ setNeedsSave()

void org.turro.alliance.client.model.PublishGrantVM.setNeedsSave ( boolean  needsSave)

Definition at line 58 of file PublishGrantVM.java.

58  {
59  this.needsSave = needsSave;
60  }

◆ setServer()

void org.turro.alliance.client.model.PublishGrantVM.setServer ( WsServer  server)

Definition at line 126 of file PublishGrantVM.java.

126  {
127  this.server = server;
128  }

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