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

Public Member Functions

void init (@ExecutionArgParam("dossier") Dossier dossier)
 
boolean isNeedsSave ()
 
void setNeedsSave (boolean needsSave)
 
void add ()
 
void save ()
 
void delete (@BindingParam("category") AxProjectCategory category)
 
List< AxProjectCategorygetModel ()
 
WsServer getServer ()
 
void setServer (WsServer server)
 
Jsons getCategories (AxProjectCategory pc)
 

Detailed Description

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

Definition at line 46 of file PublishVM.java.

Member Function Documentation

◆ add()

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

Definition at line 68 of file PublishVM.java.

68  {
69  if(server != null && !inModel(server)) {
70  AxProjectCategory pc = new AxProjectCategory();
71  pc.setServerDomain(server.getServerDomain());
72  pc.setDossier(dossier);
73  model.add(pc);
74  needsSave = true;
75  } else {
76  Toasts.message(I_.get("Already in model"));
77  }
78  }
String getServerDomain()
Definition: WsServer.java:52
Here is the call graph for this function:

◆ delete()

void org.turro.alliance.client.model.PublishVM.delete ( @BindingParam("category") AxProjectCategory  category)

Definition at line 95 of file PublishVM.java.

95  {
96  deletions.add(category);
97  model.removeIf(pc -> pc.getServerDomain().equals(category.getServerDomain()));
98  needsSave = true;
99  }

◆ getCategories()

Jsons org.turro.alliance.client.model.PublishVM.getCategories ( AxProjectCategory  pc)

Definition at line 134 of file PublishVM.java.

134  {
135  return Servers.getData(WsServer.from(pc.getServerDomain(), AxServer.SERVER_SERVICE), AxConstants.CATEGORIES);
136  }
Here is the call graph for this function:

◆ getModel()

List<AxProjectCategory> org.turro.alliance.client.model.PublishVM.getModel ( )

Definition at line 108 of file PublishVM.java.

108  {
109  if(model == null) {
110  model = SqlClause.select("pc").from("AxProjectCategory pc")
111  .where().equal("pc.projectId", String.valueOf(dossier.getId()))
112  .dao(new AlliancePU())
113  .resultList(AxProjectCategory.class);
114  }
115  return model;
116  }
Here is the call graph for this function:

◆ getServer()

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

Definition at line 126 of file PublishVM.java.

126  {
127  return server;
128  }

◆ init()

void org.turro.alliance.client.model.PublishVM.init ( @ExecutionArgParam("dossier") Dossier  dossier)

Definition at line 51 of file PublishVM.java.

51  {
52  if(dossier != null) this.dossier = dossier;
53  if(this.dossier == null) {
54  this.dossier = (Dossier) Executions.getCurrent().getAttribute("dossier");
55  }
56  }

◆ isNeedsSave()

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

Definition at line 58 of file PublishVM.java.

58  {
59  return needsSave;
60  }

◆ save()

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

Definition at line 82 of file PublishVM.java.

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

◆ setNeedsSave()

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

Definition at line 62 of file PublishVM.java.

62  {
63  this.needsSave = needsSave;
64  }

◆ setServer()

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

Definition at line 130 of file PublishVM.java.

130  {
131  this.server = server;
132  }

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