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

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 43 of file ContactsAssistant.java.

Member Function Documentation

◆ add()

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

Implements org.turro.assistant.IAssistant.

Definition at line 46 of file ContactsAssistant.java.

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

Implements org.turro.assistant.IAssistant.

Definition at line 61 of file ContactsAssistant.java.

61  {
62  if(entity instanceof Convocation) {
63  Convocation convocation = (Convocation) entity;
64  assistants.addSubject(convocation.getName());
65  for(Attendee attendee :convocation.getAttendees()) {
66  if(attendee != null && !attendee.isEmpty()) {
67  IContact contact = attendee.getIContact();
68  if(contact.isWebUser()) {
69  assistants.add(new Assistant(contact.getName(), contact.getConnector(IUser.CONNECTOR_EMAIL), contact, null));
70  }
71  }
72  }
73  } if(entity instanceof Contact) {
74  IContact contact = Contacts.getContact(entity);
75  if(contact != null && contact.isValid()) {
76  if(contact.isCompany() || contact.isCenter()) {
77  for(IContact c : contact.getCoworkers(contact)) {
78  if(c.isWebUser()) {
79  assistants.add(new Assistant(c.getName(), c.getConnector(IUser.CONNECTOR_EMAIL), c, null));
80  }
81  }
82  } else {
83  if(contact.isWebUser()) {
84  assistants.add(new Assistant(contact.getName(), contact.getConnector(IUser.CONNECTOR_EMAIL), contact, null));
85  }
86  }
87  }
88  }
89  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFromEntityData()

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

Implements org.turro.assistant.IAssistant.

Definition at line 116 of file ContactsAssistant.java.

116  {
117  if((data instanceof String) && (((String) data).contains(AssistantConstants.FROM_COMMENTS) ||
118  ((String) data).contains(AssistantConstants.FROM_VOTES))) {
119  String entityPath = Entities.getController(entity).getPath();
120  addFromEntityPathData(entityPath, assistants, data);
121  }
122  }
void addFromEntityPathData(String entityPath, AssistantSet assistants, Object data)
Here is the call graph for this function:

◆ addFromEntityPath()

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

Implements org.turro.assistant.IAssistant.

Definition at line 55 of file ContactsAssistant.java.

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

◆ addFromEntityPathData()

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

Implements org.turro.assistant.IAssistant.

Definition at line 92 of file ContactsAssistant.java.

92  {
93  if((data instanceof String) && ((String) data).contains(AssistantConstants.FROM_COMMENTS)) {
94  for(CommentIt ci : CommentItUtil.allComments(entityPath)) {
95  if(ci.getCreator() != null) {
96  String name = ci.getName(), mail = ci.getEmail();
97  if(!Strings.isBlank(name) && MailValidator.check(mail)) {
98  assistants.add(new Assistant(name, mail, Contacts.getContact(ci.getCreator()), ci));
99  }
100  }
101  }
102  }
103  if((data instanceof String) && ((String) data).contains(AssistantConstants.FROM_VOTES)) {
104  for(VoteIt vi : VoteItUtil.allVotes(entityPath)) {
105  if(vi.getCreator() != null) {
106  String name = vi.getName(), mail = vi.getEmail();
107  if(!Strings.isBlank(name) && MailValidator.check(mail)) {
108  assistants.add(new Assistant(name, mail, Contacts.getContact(vi.getCreator()), vi));
109  }
110  }
111  }
112  }
113  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParticiped()

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

Implements org.turro.assistant.IAssistant.

Definition at line 125 of file ContactsAssistant.java.

125  {
126  return Collections.EMPTY_LIST;
127  }

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