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

Public Member Functions

void init (@ExecutionArgParam("dossier") Dossier dossier)
 
void validate (@BindingParam("request") RequestAdapter request)
 
void delete (@BindingParam("request") RequestAdapter request)
 
void save (@BindingParam("request") RequestAdapter request)
 
List< RequestAdaptergetModel ()
 

Detailed Description

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

Definition at line 39 of file RequestsVM.java.

Member Function Documentation

◆ delete()

void org.turro.alliance.client.model.RequestsVM.delete ( @BindingParam("request") RequestAdapter  request)

Definition at line 61 of file RequestsVM.java.

61  {
62  Servers.getData(request.getServer(), AxConstants.AXPENDING_DELETE,
63  Jsons.object().add("item", request.getAxPending().asJsonValue()));
64  model = null;
65  }

◆ getModel()

List<RequestAdapter> org.turro.alliance.client.model.RequestsVM.getModel ( )

Definition at line 79 of file RequestsVM.java.

79  {
80  if(model == null) {
81  model = new ArrayList<>();
82  Servers.getServers(AxServer.SERVER_SERVICE).forEach(server -> {
83  Jsons request = Jsons.object();
84  if(dossier != null) {
85  request.add("id", String.valueOf(dossier.getId()));
86  }
87  Jsons requests = Servers.getData(server, AxConstants.AXPENDING_REQUESTS, request);
88  if(!Jsons.isEmpty(requests)) requests.getStructure().asArray().forEach(axr -> {
89  model.add(new RequestAdapter(server, Jsons.read(axr.toString())));
90  });
91  });
92  }
93  return model;
94  }
Here is the call graph for this function:

◆ init()

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

Definition at line 44 of file RequestsVM.java.

44  {
45  if(dossier != null) this.dossier = dossier;
46  if(this.dossier == null) {
47  this.dossier = (Dossier) Executions.getCurrent().getAttribute("dossier");
48  }
49  }

◆ save()

void org.turro.alliance.client.model.RequestsVM.save ( @BindingParam("request") RequestAdapter  request)

Definition at line 69 of file RequestsVM.java.

69  {
70  Servers.getData(request.getServer(), AxConstants.AXPARTICIPATION_SAVE,
71  Jsons.object().add("item", request.getAxPending().asJsonValue()));
72  model = null;
73  }

◆ validate()

void org.turro.alliance.client.model.RequestsVM.validate ( @BindingParam("request") RequestAdapter  request)

Definition at line 53 of file RequestsVM.java.

53  {
54  Servers.getData(request.getServer(), AxConstants.AXPENDING_VALIDATE,
55  Jsons.object().add("item", request.getAxPending().asJsonValue()));
56  model = null;
57  }

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