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

Public Member Functions

boolean isNeedsSave ()
 
void setNeedsSave (boolean needsSave)
 
void add ()
 
void save ()
 
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 38 of file ProjectsVM.java.

Member Function Documentation

◆ add()

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

Definition at line 50 of file ProjectsVM.java.

50  {
51  if(server != null) {
52  AxProjectCategory pc = new AxProjectCategory();
53  pc.setServerDomain(server.getServerDomain());
54  model.add(pc);
55  needsSave = true;
56  }
57  }
String getServerDomain()
Definition: WsServer.java:52
Here is the call graph for this function:

◆ getCategories()

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

Definition at line 97 of file ProjectsVM.java.

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

◆ getModel()

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

Definition at line 76 of file ProjectsVM.java.

76  {
77  if(model == null) {
78  model = SqlClause.select("pc").from("AxProjectCategory pc")
79  .dao(new AlliancePU())
80  .resultList(AxProjectCategory.class);
81  }
82  return model;
83  }

◆ getServer()

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

Definition at line 89 of file ProjectsVM.java.

89  {
90  return server;
91  }

◆ isNeedsSave()

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

Definition at line 40 of file ProjectsVM.java.

40  {
41  return needsSave;
42  }

◆ save()

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

Definition at line 61 of file ProjectsVM.java.

61  {
62  Dao dao = new AlliancePU();
63  model.stream().filter(pc -> pc.isEmpty())
64  .forEach(pc -> dao.deleteEntity(pc));
65  model.removeIf(pc -> pc.isEmpty());
66  dao.saveEntities(model);
67  needsSave = false;
68  }
Here is the call graph for this function:

◆ setNeedsSave()

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

Definition at line 44 of file ProjectsVM.java.

44  {
45  this.needsSave = needsSave;
46  }

◆ setServer()

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

Definition at line 93 of file ProjectsVM.java.

93  {
94  this.server = server;
95  }

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