BrightSide Workbench Full Report + Source Code
org.turro.assistant.DossierAssistants Class Reference
Inheritance diagram for org.turro.assistant.DossierAssistants:
Collaboration diagram for org.turro.assistant.DossierAssistants:

Public Member Functions

void add (Object entity, boolean deep, AssistantSet assistants, Object data)
 
void addFromEntityPath (String entityPath, boolean deep, AssistantSet assistants, Object data)
 
void addFromEntity (Object entity, boolean deep, AssistantSet assistants, Object data)
 
void addFromEntityPathData (String entityPath, AssistantSet assistants, Object data)
 
void addFromEntityData (Object entity, AssistantSet assistants, Object data)
 
List< String > getParticiped (IContact contact)
 

Detailed Description

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

Definition at line 42 of file DossierAssistants.java.

Member Function Documentation

◆ add()

void org.turro.assistant.DossierAssistants.add ( Object  entity,
boolean  deep,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 45 of file DossierAssistants.java.

45  {
46  if(entity instanceof String) {
47  addFromEntityPath((String) entity, deep, assistants, data);
48  } else {
49  addFromEntity(entity, deep, assistants, data);
50  }
51  }
void addFromEntity(Object entity, boolean deep, AssistantSet assistants, Object data)
void addFromEntityPath(String entityPath, boolean deep, AssistantSet assistants, Object data)
Here is the call graph for this function:

◆ addFromEntity()

void org.turro.assistant.DossierAssistants.addFromEntity ( Object  entity,
boolean  deep,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 60 of file DossierAssistants.java.

60  {
61  if(entity instanceof Category) {
62  Category category = (Category) entity;
63  assistants.addSubject(category.getFullDescription());
64  Set ps = deep ? category.getFullParticipants() : category.getParticipants();
65  for(Object p : ps) {
66  if(p instanceof IDossierParticipant) {
67  IDossierParticipant dp = (IDossierParticipant) p;
68  if(!dp.isSubject()) {
69  IContact c = dp.getIContact();
70  if(c != null && c.isWebUser()) {
71  assistants.add(new Assistant(c, dp));
72  }
73  }
74  }
75  }
76  } else if(entity instanceof Dossier) {
77  Dossier dossier = (Dossier) entity;
78  assistants.addSubject(dossier.getFullDescription());
79  Set ps = deep ? dossier.getFullParticipants() : dossier.getParticipants();
80  for(Object p : ps) {
81  if(p instanceof IDossierParticipant) {
82  IDossierParticipant dp = (IDossierParticipant) p;
83  if(!dp.isSubject()) {
84  IContact c = dp.getIContact();
85  if(c != null && c.isWebUser()) {
86  assistants.add(new Assistant(c, dp));
87  }
88  }
89  }
90  }
91  } else if(entity instanceof Issue) {
92  Issue issue = (Issue) entity;
93  assistants.addSubject(issue.getFullDescription());
94  Set ps = deep ? issue.getFullParticipants() : issue.getParticipants();
95  for(Object p : ps) {
96  if(p instanceof IDossierParticipant) {
97  IDossierParticipant dp = (IDossierParticipant) p;
98  if(!dp.isSubject() && dp.isShowAllIssues()) {
99  IContact c = dp.getIContact();
100  if(c != null && c.isWebUser()) {
101  assistants.add(new Assistant(c, dp));
102  }
103  }
104  } else if(p instanceof IssueParticipant) {
105  IssueParticipant ip = (IssueParticipant) p;
106  IContact c = ip.getIContact();
107  if(c != null && c.isWebUser()) {
108  assistants.add(new Assistant(c, ip));
109  }
110  }
111  }
112  }
113  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityData()

void org.turro.assistant.DossierAssistants.addFromEntityData ( Object  entity,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 122 of file DossierAssistants.java.

122  {
123  //TODO: contracts->dossier
124  }
Here is the caller graph for this function:

◆ addFromEntityPath()

void org.turro.assistant.DossierAssistants.addFromEntityPath ( String  entityPath,
boolean  deep,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 54 of file DossierAssistants.java.

54  {
55  Object entity = Entities.getController(entityPath).getEntity();
56  addFromEntity(entity, deep, assistants, data);
57  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityPathData()

void org.turro.assistant.DossierAssistants.addFromEntityPathData ( String  entityPath,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 116 of file DossierAssistants.java.

116  {
117  Object entity = Entities.getController(entityPath).getEntity();
118  addFromEntityData(entity, assistants, data);
119  }
void addFromEntityData(Object entity, AssistantSet assistants, Object data)
Here is the call graph for this function:

◆ getParticiped()

List<String> org.turro.assistant.DossierAssistants.getParticiped ( IContact  contact)

Implements org.turro.assistant.IAssistant.

Definition at line 127 of file DossierAssistants.java.

127  {
128  Dao dao = new DossierPU();
129  List<String> participed = new ArrayList<>();
130 // participed.addAll(SqlClause.select("distinct p.issue.id").from("IssueParticipant p")
131 // .where().equal("p.idContact", contact.getId())
132 // .dao(dao)
133 // .resultList(Long.class)
134 // .stream()
135 // .map(p -> "/issue/" + p)
136 // .toList());
137  participed.addAll(SqlClause.select("distinct p.dossier.id").from("Participant p")
138  .where().equal("p.idContact", contact.getId())
139  .dao(dao)
140  .resultList(Long.class)
141  .stream()
142  .map(p -> "/dossier/" + p)
143  .toList());
144  participed.addAll(SqlClause.select("distinct p.category.id").from("CategoryParticipant p")
145  .where().equal("p.idContact", contact.getId())
146  .dao(dao)
147  .resultList(Long.class)
148  .stream()
149  .map(p -> "/dossier-category/" + p)
150  .toList());
151  return participed;
152  }
Here is the call graph for this function:

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