BrightSide Workbench Full Report + Source Code
org.turro.elephant.entities.db.Sendable Class Reference
Inheritance diagram for org.turro.elephant.entities.db.Sendable:
Collaboration diagram for org.turro.elephant.entities.db.Sendable:

Public Member Functions

String getEntityPath ()
 
void setEntityPath (String entityPath)
 
Date getSchedule ()
 
void setSchedule (Date schedule)
 
boolean isSent ()
 
void setSent (boolean sent)
 
boolean isEmpty ()
 
Object getEntity ()
 
void addAssistantsByEntity (String entityPath, boolean deep)
 
void addContact (IContact contact)
 
Collection< SendableAssistantgetAssistants (boolean all)
 
void removeAssistants ()
 

Detailed Description

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

Definition at line 42 of file Sendable.java.

Member Function Documentation

◆ addAssistantsByEntity()

void org.turro.elephant.entities.db.Sendable.addAssistantsByEntity ( String  entityPath,
boolean  deep 
)

Definition at line 88 of file Sendable.java.

88  {
89  AssistantSet as = new AssistantSet();
90  Assistants.addAssistants(entityPath, deep, as, deep ? AssistantConstants.all() : null);
91  for(Assistant a : as) {
92  addContact((IContact) a.contact);
93  }
94  }
void addContact(IContact contact)
Definition: Sendable.java:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addContact()

void org.turro.elephant.entities.db.Sendable.addContact ( IContact  contact)

Definition at line 96 of file Sendable.java.

96  {
97  if(contact != null && contact.isWebUser()) {
98  SendableAssistant sa = new SendableAssistant();
99  sa.setContactId(contact.getId());
100  sa.setEntityPath(entityPath);
101  sa.setDelivered(false);
102  new ElephantPU().saveObject(sa);
103  }
104  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAssistants()

Collection<SendableAssistant> org.turro.elephant.entities.db.Sendable.getAssistants ( boolean  all)

Definition at line 106 of file Sendable.java.

106  {
107  Dao dao = new ElephantPU();
108  WhereClause wc = new WhereClause();
109  wc.addClause("select sa from SendableAssistant sa");
110  wc.addClause("where sa.entityPath = :path");
111  wc.addNamedValue("path", entityPath);
112  if(!all) {
113  wc.addClause("and sa.delivered = FALSE");
114  }
115  return dao.getResultList(wc);
116  }
Here is the call graph for this function:

◆ getEntity()

Object org.turro.elephant.entities.db.Sendable.getEntity ( )

Definition at line 82 of file Sendable.java.

82  {
83  return Entities.getController(entityPath).getEntity();
84  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEntityPath()

String org.turro.elephant.entities.db.Sendable.getEntityPath ( )

Definition at line 52 of file Sendable.java.

52  {
53  return entityPath;
54  }
Here is the caller graph for this function:

◆ getSchedule()

Date org.turro.elephant.entities.db.Sendable.getSchedule ( )

Definition at line 60 of file Sendable.java.

60  {
61  return schedule;
62  }
Here is the caller graph for this function:

◆ isEmpty()

boolean org.turro.elephant.entities.db.Sendable.isEmpty ( )

Definition at line 78 of file Sendable.java.

78  {
79  return Strings.isBlank(entityPath) || schedule == null;
80  }
Here is the caller graph for this function:

◆ isSent()

boolean org.turro.elephant.entities.db.Sendable.isSent ( )

Definition at line 68 of file Sendable.java.

68  {
69  return sent;
70  }

◆ removeAssistants()

void org.turro.elephant.entities.db.Sendable.removeAssistants ( )

Definition at line 118 of file Sendable.java.

118  {
119  Dao dao = new ElephantPU();
120  WhereClause wc = new WhereClause();
121  wc.addClause("delete from SendableAssistant sa");
122  wc.addClause("where sa.entityPath = :path");
123  wc.addNamedValue("path", entityPath);
124  dao.executeUpdate(wc);
125  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEntityPath()

void org.turro.elephant.entities.db.Sendable.setEntityPath ( String  entityPath)

Definition at line 56 of file Sendable.java.

56  {
57  this.entityPath = entityPath;
58  }

◆ setSchedule()

void org.turro.elephant.entities.db.Sendable.setSchedule ( Date  schedule)

Definition at line 64 of file Sendable.java.

64  {
65  this.schedule = schedule;
66  }
Here is the caller graph for this function:

◆ setSent()

void org.turro.elephant.entities.db.Sendable.setSent ( boolean  sent)

Definition at line 72 of file Sendable.java.

72  {
73  this.sent = sent;
74  }
Here is the caller graph for this function:

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