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

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 37 of file StudentsAssistants.java.

Member Function Documentation

◆ add()

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

Implements org.turro.assistant.IAssistant.

Definition at line 40 of file StudentsAssistants.java.

40  {
41  if(entity instanceof String) {
42  addFromEntityPath((String) entity, deep, assistants, data);
43  } else {
44  addFromEntity(entity, deep, assistants, data);
45  }
46  }
void addFromEntityPath(String entityPath, boolean deep, AssistantSet assistants, Object data)
void addFromEntity(Object entity, boolean deep, AssistantSet assistants, Object data)
Here is the call graph for this function:

◆ addFromEntity()

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

Implements org.turro.assistant.IAssistant.

Definition at line 55 of file StudentsAssistants.java.

55  {
56  if(entity instanceof Challenge) {
57  Challenge challenge = (Challenge) entity;
58  assistants.addSubject(challenge.getQuestion());
59  assistants.add(new Assistant(challenge.getContact(), challenge));
60  if(deep) {
61  for(Response response : challenge.getResponses()) {
62  for(IContact c : response.getStudentList()) {
63  if(c != null && c.isWebUser()) {
64  assistants.add(new Assistant(c, response));
65  }
66  }
67  }
68  }
69  } else if(entity instanceof Response) {
70  Response response = (Response) entity;
71  Challenge challenge = response.getChallenge();
72  assistants.addSubject(challenge.getQuestion());
73  assistants.add(new Assistant(challenge.getContact(), challenge));
74  for(IContact c : response.getStudentList()) {
75  if(c != null && c.isWebUser()) {
76  assistants.add(new Assistant(c, response));
77  }
78  }
79  if(deep) {
80  }
81  } else if(entity instanceof PracticalWork) {
82  PracticalWork practicalWork = (PracticalWork) entity;
83  assistants.addSubject(practicalWork.getTitle());
84  assistants.add(new Assistant(practicalWork.getIResponsible(), practicalWork));
85  if(deep) {
86  }
87  }
88  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityData()

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

Implements org.turro.assistant.IAssistant.

Definition at line 104 of file StudentsAssistants.java.

104  {
105  if((data instanceof String) && ((String) data).contains(AssistantConstants.FROM_STUDENTS)) {
106  String entityPath = Entities.getController(entity).getPath();
107  addFromEntityPathData(entityPath, assistants, data);
108  }
109  }
void addFromEntityPathData(String entityPath, AssistantSet assistants, Object data)
Here is the call graph for this function:

◆ addFromEntityPath()

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

Implements org.turro.assistant.IAssistant.

Definition at line 49 of file StudentsAssistants.java.

49  {
50  Object entity = Entities.getController(entityPath).getEntity();
51  addFromEntity(entity, deep, assistants, data);
52  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityPathData()

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

Implements org.turro.assistant.IAssistant.

Definition at line 91 of file StudentsAssistants.java.

91  {
92  if((data instanceof String) && ((String) data).contains(AssistantConstants.FROM_STUDENTS)) {
93  new ParticipationInfo(entityPath, ParticipationReason.REASON_FOLLOW).getParticipations()
94  .stream().forEach(p -> {
95  IContact c = Contacts.getContact(p.getParticipator().getEntity());
96  if(c != null && c.isWebUser() && c.isStudent()) {
97  assistants.add(new Assistant(c, p.getEntity().getEntity()));
98  }
99  });
100  }
101  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParticiped()

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

Implements org.turro.assistant.IAssistant.

Definition at line 112 of file StudentsAssistants.java.

112  {
113  return Collections.EMPTY_LIST;
114  }

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