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

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 ForumAssistants.java.

Member Function Documentation

◆ add()

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

Implements org.turro.assistant.IAssistant.

Definition at line 40 of file ForumAssistants.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.ForumAssistants.addFromEntity ( Object  entity,
boolean  deep,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 55 of file ForumAssistants.java.

55  {
56  if(entity instanceof Topic) {
57  Topic topic = (Topic) entity;
58  assistants.addSubject(topic.getText());
59  assistants.add(new Assistant(topic.getContact(), topic));
60  Assistants.addAssistants(topic.getEntityPath(), deep, assistants, data);
61  } else if(entity instanceof Post) {
62  Post post = (Post) entity;
63  Topic topic = post.getParentTopic();
64  assistants.addSubject(topic.getText());
65  assistants.add(new Assistant(post.getContact(), post));
66  IUniquePath parent = post.getCurrentParent();
67  while(parent != null) {
68  if(parent instanceof Post) {
69  assistants.add(new Assistant(((Post) parent).getContact(), topic));
70  parent = ((Post) parent).getCurrentParent();
71  } else if(parent instanceof Topic) {
72  assistants.add(new Assistant(((Topic) parent).getContact(), topic));
73  parent = null;
74  }
75  }
76  Assistants.addAssistants(topic.getEntityPath(), deep, assistants, data);
77  }
78  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityData()

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

Implements org.turro.assistant.IAssistant.

Definition at line 94 of file ForumAssistants.java.

94  {
95  if((data instanceof String) && ((String) data).contains(AssistantConstants.FROM_FORUM)) {
96  String entityPath = Entities.getController(entity).getPath();
97  addFromEntityPathData(entityPath, assistants, data);
98  }
99  }
void addFromEntityPathData(String entityPath, AssistantSet assistants, Object data)
Here is the call graph for this function:

◆ addFromEntityPath()

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

Implements org.turro.assistant.IAssistant.

Definition at line 49 of file ForumAssistants.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.ForumAssistants.addFromEntityPathData ( String  entityPath,
AssistantSet  assistants,
Object  data 
)

Implements org.turro.assistant.IAssistant.

Definition at line 81 of file ForumAssistants.java.

81  {
82  if((data instanceof String) && ((String) data).contains(AssistantConstants.FROM_FORUM)) {
83  Collection<Topic> topics = Forums.getTopics(entityPath);
84  for(Topic topic : topics) {
85  IContact c = topic.getContact();
86  if(c != null && c.isWebUser()) {
87  assistants.add(new Assistant(c, topic));
88  }
89  }
90  }
91  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParticiped()

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

Implements org.turro.assistant.IAssistant.

Definition at line 102 of file ForumAssistants.java.

102  {
103  return Collections.EMPTY_LIST;
104  }

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