19 package org.turro.alliance.client.model;
21 import java.util.Date;
22 import java.util.Objects;
23 import org.turro.alliance.client.Projects;
24 import org.turro.dossier.db.DossierPU;
25 import org.turro.dossier.entity.Dossier;
26 import org.turro.json.JsonSearch;
27 import org.turro.json.Jsons;
28 import org.turro.ws.WsServer;
29 import org.turro.ws.service.WsConstants;
30 import org.turro.ws.service.member.Servers;
39 private final Long callingMember;
40 private final Jsons axParticipation;
44 this.callingMember = callingMember;
45 this.axParticipation = axParticipation;
53 return axParticipation;
57 return axParticipation.getBoolean(
"beneficiary");
61 return axParticipation.getBoolean(
"offerer");
65 return axParticipation.getBoolean(
"consortium");
69 return axParticipation.getDate(
"creation");
73 return axParticipation.getString(
"memberName");
77 return Servers.getElephantString(server.
getServerDomain(), WsConstants.MEMBER_TRADENAME,
78 Jsons.object().add(
"memberId", JsonSearch.of(axParticipation).read(
"$.relation.mainMemberId", Long.class)));
82 JsonSearch axp = JsonSearch.of(axParticipation);
83 if(Objects.equals(callingMember, axp.read(
"$.relation.mainMemberId", Long.class))) {
84 return new DossierPU().find(
Dossier.class, axp.read(
"$.relation.mainEntityId", Long.class)).getDescription();
90 public <T> T getRequest() {
91 return JsonSearch.of(axParticipation).silent().root();
94 private String projectId(JsonSearch axp) {
95 return axp.read(
"$.relation.mainEntityId") +
97 axp.read(
"$.relation.mainMemberId", Integer.class);
static Projects from(WsServer server)
Jsons project(String axId)
ParticipationAdapter(WsServer server, Long callingMember, Jsons axParticipation)
String getProjectDescription()
Jsons getAxParticipation()
String getRequesterName()