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

Public Member Functions

String getDescription ()
 
Dao createDao ()
 
WhereClause getQuery (Path entityPath)
 
boolean getCanDelete (CategoryParticipant v)
 
String getDescription (CategoryParticipant v)
 
void doDelete (CategoryParticipant v)
 
void doShow (CategoryParticipant v)
 
void onChange (Object entity)
 
void onDelete (Object entity)
 
boolean getCanChangeFor (CategoryParticipant v)
 
void doChangeFor (CategoryParticipant v, Path toPath)
 
Object getReferringEntity (CategoryParticipant v)
 
- Public Member Functions inherited from org.turro.activity.JpaParticipationCatcher< CategoryParticipant >
List< IParticipationgetParticipations (Path entityPath)
 
Dao getDao ()
 
abstract Dao createDao ()
 
abstract WhereClause getQuery (Path entityPath)
 
abstract boolean getCanDelete (V v)
 
abstract boolean getCanChangeFor (V v)
 
abstract String getDescription (V v)
 
abstract void doDelete (V v)
 
abstract void doShow (V v)
 
abstract void doChangeFor (V v, Path toPath)
 
abstract Object getReferringEntity (V v)
 

Detailed Description

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

Definition at line 35 of file CategoryParticipationCatcher.java.

Member Function Documentation

◆ createDao()

Dao org.turro.activity.CategoryParticipationCatcher.createDao ( )

Definition at line 43 of file CategoryParticipationCatcher.java.

43  {
44  return new DossierPU();
45  }

◆ doChangeFor()

void org.turro.activity.CategoryParticipationCatcher.doChangeFor ( CategoryParticipant  v,
Path  toPath 
)

Definition at line 103 of file CategoryParticipationCatcher.java.

103  {
104  if(v != null && !toPath.isRoot() && "contact".equals(toPath.getRoot())) {
105  WhereClause wc = new WhereClause();
106  wc.addClause("update CategoryParticipant");
107  wc.addClause("set idContact = :to");
108  wc.addClause("where idContact = :from");
109  wc.addNamedValue("to", toPath.getLastNode());
110  wc.addNamedValue("from", v.getIdContact());
111  getDao().executeUpdate(wc);
112  }
113  }
int executeUpdate(String query)
Definition: Dao.java:463
Here is the call graph for this function:

◆ doDelete()

void org.turro.activity.CategoryParticipationCatcher.doDelete ( CategoryParticipant  v)

Definition at line 70 of file CategoryParticipationCatcher.java.

70  {
71  Category c = v.getCategory();
72  c.getParticipants().remove(v);
73  getDao().saveObject(c);
74  }
Here is the call graph for this function:

◆ doShow()

void org.turro.activity.CategoryParticipationCatcher.doShow ( CategoryParticipant  v)

Definition at line 77 of file CategoryParticipationCatcher.java.

77  {
78  throw new UnsupportedOperationException("Not supported yet.");
79  }

◆ getCanChangeFor()

boolean org.turro.activity.CategoryParticipationCatcher.getCanChangeFor ( CategoryParticipant  v)

Definition at line 98 of file CategoryParticipationCatcher.java.

98  {
99  return true;
100  }

◆ getCanDelete()

boolean org.turro.activity.CategoryParticipationCatcher.getCanDelete ( CategoryParticipant  v)

Definition at line 60 of file CategoryParticipationCatcher.java.

60  {
61  return true;
62  }

◆ getDescription() [1/2]

String org.turro.activity.CategoryParticipationCatcher.getDescription ( )

Definition at line 38 of file CategoryParticipationCatcher.java.

38  {
39  return "BrightSide Dossiers - " + I_.get("Category");
40  }
Here is the call graph for this function:

◆ getDescription() [2/2]

String org.turro.activity.CategoryParticipationCatcher.getDescription ( CategoryParticipant  v)

Definition at line 65 of file CategoryParticipationCatcher.java.

65  {
66  return v.getCategory().getFullDescription() + Chars.forward().spaced() + I_.byKey(v.getRole().toString());
67  }
Here is the call graph for this function:

◆ getQuery()

WhereClause org.turro.activity.CategoryParticipationCatcher.getQuery ( Path  entityPath)

Definition at line 48 of file CategoryParticipationCatcher.java.

48  {
49  if(!entityPath.isRoot() && "contact".equals(entityPath.getRoot())) {
50  WhereClause wc = new WhereClause();
51  wc.addClause("select distinct cparticipant from CategoryParticipant as cparticipant");
52  wc.addClause("where cparticipant.idContact = :id");
53  wc.addNamedValue("id", entityPath.getLastNode());
54  return wc;
55  }
56  return null;
57  }
Here is the call graph for this function:

◆ getReferringEntity()

Object org.turro.activity.CategoryParticipationCatcher.getReferringEntity ( CategoryParticipant  v)

Definition at line 116 of file CategoryParticipationCatcher.java.

116  {
117  return v.getCategory();
118  }
Here is the call graph for this function:

◆ onChange()

void org.turro.activity.CategoryParticipationCatcher.onChange ( Object  entity)

Definition at line 82 of file CategoryParticipationCatcher.java.

82  {
83  if(entity instanceof IContact) {
84  IContact contact = (IContact) entity;
86  "update CategoryParticipant set name = ? " +
87  "where idContact = ?",
88  new Object[] { contact.getName(), contact.getId() });
89  }
90  }
Here is the call graph for this function:

◆ onDelete()

void org.turro.activity.CategoryParticipationCatcher.onDelete ( Object  entity)

Definition at line 93 of file CategoryParticipationCatcher.java.

93  {
94  // do nothing
95  }

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