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

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 41 of file GenericEntityAssistant.java.

Member Function Documentation

◆ add()

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

Implements org.turro.assistant.IAssistant.

Definition at line 44 of file GenericEntityAssistant.java.

44  {
45  if(entity instanceof String) {
46  addFromEntityPath((String) entity, deep, assistants, data);
47  } else {
48  addFromEntity(entity, deep, assistants, data);
49  }
50  }
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.GenericEntityAssistant.addFromEntity ( Object  entity,
boolean  deep,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 73 of file GenericEntityAssistant.java.

73  {
74  String entityPath = Entities.getController(entity).getPath();
75  addFromEntityPath(entityPath, deep, assistants, data);
76  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityData()

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

Implements org.turro.assistant.IAssistant.

Definition at line 83 of file GenericEntityAssistant.java.

83  {
84  }

◆ addFromEntityPath()

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

Implements org.turro.assistant.IAssistant.

Definition at line 53 of file GenericEntityAssistant.java.

53  {
54  Dao dao = new ElephantPU();
55  WhereClause wc = new WhereClause();
56  wc.addClause("select ep from EntityParticipation ep");
57  wc.addClause("where ep.entityPath = :entityPath");
58  wc.addNamedValue("entityPath", entityPath);
59  wc.addClause("and ep.reason in (:reasons)");
60  wc.addNamedValue("reasons", EnumSet.of(ParticipationReason.REASON_FOLLOW, ParticipationReason.REASON_PARTICIPATE));
61  dao.getResultList(EntityParticipation.class, wc).stream().forEach((ea) -> {
62  Path path = new Path(ea.getParticipatorPath());
63  if("contact".equals(path.getRoot())) {
64  IContact contact = Contacts.getContactById(path.getNode(1));
65  if(contact != null && contact.isWebUser()) {
66  assistants.add(new Assistant(contact.getName(), contact.getConnector(IUser.CONNECTOR_EMAIL), contact, null));
67  }
68  }
69  });
70  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityPathData()

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

Implements org.turro.assistant.IAssistant.

Definition at line 79 of file GenericEntityAssistant.java.

79  {
80  }

◆ getParticiped()

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

Implements org.turro.assistant.IAssistant.

Definition at line 87 of file GenericEntityAssistant.java.

87  {
88  return Collections.EMPTY_LIST;
89  }

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