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

Public Member Functions

String getDescription ()
 
Dao createDao ()
 
WhereClause getQuery (Path entityPath)
 
boolean getCanDelete (Participant v)
 
String getDescription (Participant v)
 
void doDelete (Participant v)
 
void doShow (Participant v)
 
void onChange (Object entity)
 
void onDelete (Object entity)
 
boolean getCanChangeFor (Participant v)
 
void doChangeFor (Participant v, Path toPath)
 
Object getReferringEntity (Participant v)
 
- Public Member Functions inherited from org.turro.activity.JpaParticipationCatcher< Participant >
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 37 of file DossierParticipationCatcher.java.

Member Function Documentation

◆ createDao()

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

Definition at line 45 of file DossierParticipationCatcher.java.

45  {
46  return new DossierPU();
47  }

◆ doChangeFor()

void org.turro.activity.DossierParticipationCatcher.doChangeFor ( Participant  v,
Path  toPath 
)

Definition at line 105 of file DossierParticipationCatcher.java.

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

◆ doDelete()

void org.turro.activity.DossierParticipationCatcher.doDelete ( Participant  v)

Definition at line 72 of file DossierParticipationCatcher.java.

72  {
73  Dossier d = v.getDossier();
74  d.getParticipants().remove(v);
75  getDao().saveObject(d);
76  }
Here is the call graph for this function:

◆ doShow()

void org.turro.activity.DossierParticipationCatcher.doShow ( Participant  v)

Definition at line 79 of file DossierParticipationCatcher.java.

79  {
80  DossierMenu.showDossier(v.getDossier().getId());
81  }
Here is the call graph for this function:

◆ getCanChangeFor()

boolean org.turro.activity.DossierParticipationCatcher.getCanChangeFor ( Participant  v)

Definition at line 100 of file DossierParticipationCatcher.java.

100  {
101  return true;
102  }

◆ getCanDelete()

boolean org.turro.activity.DossierParticipationCatcher.getCanDelete ( Participant  v)

Definition at line 62 of file DossierParticipationCatcher.java.

62  {
63  return !ParticipantRole.PARTICIPANT_SUBJECT.equals(v.getRole());
64  }
Here is the call graph for this function:

◆ getDescription() [1/2]

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

Definition at line 40 of file DossierParticipationCatcher.java.

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

◆ getDescription() [2/2]

String org.turro.activity.DossierParticipationCatcher.getDescription ( Participant  v)

Definition at line 67 of file DossierParticipationCatcher.java.

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

◆ getQuery()

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

Definition at line 50 of file DossierParticipationCatcher.java.

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

◆ getReferringEntity()

Object org.turro.activity.DossierParticipationCatcher.getReferringEntity ( Participant  v)

Definition at line 118 of file DossierParticipationCatcher.java.

118  {
119  return v.getDossier();
120  }
Here is the call graph for this function:

◆ onChange()

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

Definition at line 84 of file DossierParticipationCatcher.java.

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

◆ onDelete()

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

Definition at line 95 of file DossierParticipationCatcher.java.

95  {
96  // do nothing
97  }

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