BrightSide Workbench Full Report + Source Code
org.turro.dossier.zul.viewer.DossierViewpoint Class Reference

Public Member Functions

 DossierViewpoint ()
 
Category getCategory ()
 
void setCategory (Category category)
 
IContact getContact ()
 
void setContact (IContact contact)
 
ParticipantRole getViewpoint ()
 
void setViewpoint (ParticipantRole viewpoint)
 
List< CategorygetPossibleCategories ()
 
Map< IContact, List< Dossier > > getDossiersMap (String searchValue, boolean onlyActive)
 
List< DossiergetDossiers (String searchValue, boolean onlyActive)
 

Detailed Description

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

Definition at line 42 of file DossierViewpoint.java.

Constructor & Destructor Documentation

◆ DossierViewpoint()

org.turro.dossier.zul.viewer.DossierViewpoint.DossierViewpoint ( )

Definition at line 48 of file DossierViewpoint.java.

48  {
49  }

Member Function Documentation

◆ getCategory()

Category org.turro.dossier.zul.viewer.DossierViewpoint.getCategory ( )

Definition at line 51 of file DossierViewpoint.java.

51  {
52  return category;
53  }

◆ getContact()

IContact org.turro.dossier.zul.viewer.DossierViewpoint.getContact ( )

Definition at line 59 of file DossierViewpoint.java.

59  {
60  return contact;
61  }

◆ getDossiers()

List<Dossier> org.turro.dossier.zul.viewer.DossierViewpoint.getDossiers ( String  searchValue,
boolean  onlyActive 
)

Definition at line 140 of file DossierViewpoint.java.

140  {
141  return getDossiers(contact, searchValue, onlyActive);
142  }
List< Dossier > getDossiers(String searchValue, boolean onlyActive)
Here is the caller graph for this function:

◆ getDossiersMap()

Map<IContact, List<Dossier> > org.turro.dossier.zul.viewer.DossierViewpoint.getDossiersMap ( String  searchValue,
boolean  onlyActive 
)

Definition at line 103 of file DossierViewpoint.java.

103  {
104  IContactTreeMap<IContact, List<Dossier>> dossiers = new IContactTreeMap<IContact, List<Dossier>>(
105  new IContactNameComparator());
106  if(contact != null) {
107  List<Dossier> ld = getDossiers(searchValue, onlyActive);
108  if(viewpoint.equals(ParticipantRole.PARTICIPANT_SUBJECT)) {
109  if(!ld.isEmpty()) {
110  dossiers.put(contact, ld);
111  }
112  for(IContact r : contact.getRelations("Dossiers")) {
113  ld = getDossiers(r, searchValue, onlyActive);
114  if(!ld.isEmpty()) {
115  dossiers.put(r, ld);
116  }
117  }
118  } else {
119  for(Dossier d : ld) {
120  String cId;
121  if(d.getSubject() == null) {
122  cId = Authentication.getIContact().getId();
123  } else {
124  cId = d.getSubject().getIdContact();
125  }
126  List<Dossier> tld = dossiers.getById(cId);
127  if(tld == null) {
128  tld = new ArrayList<Dossier>();
129  tld.add(d);
130  dossiers.putById(cId, tld);
131  } else {
132  tld.add(d);
133  }
134  }
135  }
136  }
137  return dossiers;
138  }
List< IContact > getRelations(String id)
Here is the call graph for this function:

◆ getPossibleCategories()

List<Category> org.turro.dossier.zul.viewer.DossierViewpoint.getPossibleCategories ( )

Definition at line 75 of file DossierViewpoint.java.

75  {
76  WhereClause wc = new WhereClause();
77  wc.addClause("select distinct dossier.category from Dossier as dossier");
78  wc.addClause("left join dossier.participants participant");
79  wc.addClause(DossierResults.getCategoryJoins());
80  wc.addClause("where (");
81  wc.addClause("(");
82  wc.addClause("participant.idContact = :idContact");
83  wc.addNamedValue("idContact", contact.getId());
84  if(viewpoint.equals(ParticipantRole.PARTICIPANT_OWNER)) {
85  wc.addClause("and participant.role <> :roleContact");
86  wc.addNamedValue("roleContact", ParticipantRole.PARTICIPANT_SUBJECT);
87  } else {
88  wc.addClause("and participant.role = :roleContact");
89  wc.addNamedValue("roleContact", viewpoint);
90  }
91  wc.addClause(")");
92  if(viewpoint.equals(ParticipantRole.PARTICIPANT_OWNER)) {
93  DossierResults.addCategoryConditionals(wc, "or", contact.getId(),
94  ParticipantRole.PARTICIPANT_SUBJECT, "<>");
95  } else {
96  DossierResults.addCategoryConditionals(wc, "or", contact.getId(),
97  viewpoint, "=");
98  }
99  wc.addClause(")");
100  return new DossierPU().getResultList(wc);
101  }
Here is the call graph for this function:

◆ getViewpoint()

ParticipantRole org.turro.dossier.zul.viewer.DossierViewpoint.getViewpoint ( )

Definition at line 67 of file DossierViewpoint.java.

67  {
68  return viewpoint;
69  }

◆ setCategory()

void org.turro.dossier.zul.viewer.DossierViewpoint.setCategory ( Category  category)

Definition at line 55 of file DossierViewpoint.java.

55  {
56  this.category = category;
57  }
Here is the caller graph for this function:

◆ setContact()

void org.turro.dossier.zul.viewer.DossierViewpoint.setContact ( IContact  contact)

Definition at line 63 of file DossierViewpoint.java.

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

◆ setViewpoint()

void org.turro.dossier.zul.viewer.DossierViewpoint.setViewpoint ( ParticipantRole  viewpoint)

Definition at line 71 of file DossierViewpoint.java.

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

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