BrightSide Workbench Full Report + Source Code
org.turro.dossier.dossier.CategoryWrapper Class Reference

Public Member Functions

 CategoryWrapper (Category category)
 
boolean isChildrenParticipant ()
 
boolean isParticipant ()
 
boolean isOwner ()
 
boolean isSubject ()
 
boolean isAssistant ()
 
boolean canDelete ()
 
void delete ()
 
boolean getCanShowAllAttachments ()
 

Detailed Description

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

Definition at line 35 of file CategoryWrapper.java.

Constructor & Destructor Documentation

◆ CategoryWrapper()

org.turro.dossier.dossier.CategoryWrapper.CategoryWrapper ( Category  category)

Definition at line 42 of file CategoryWrapper.java.

42  {
43  this.category = category;
44  contact = Authentication.getIContact();
45  }
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ canDelete()

boolean org.turro.dossier.dossier.CategoryWrapper.canDelete ( )

Definition at line 79 of file CategoryWrapper.java.

79  {
80  Dao dao = new DossierPU();
81  List l = dao.getResultList(
82  "select d from Dossier d where d.category = ?",
83  new Object[] { category });
84  if(!l.isEmpty()) {
85  return false;
86  }
87  l = dao.getResultList(
88  "select c from Category c where c.parent = ?",
89  new Object[] { category });
90  if(!l.isEmpty()) {
91  return false;
92  }
93  return true;
94  }

◆ delete()

void org.turro.dossier.dossier.CategoryWrapper.delete ( )

Definition at line 96 of file CategoryWrapper.java.

96  {
97  Dao dao = new DossierPU();
98  EntityCollections.entities(category.getParticipants()).removeNews();
99  dao.deleteObject(category);
100  }
Set< CategoryParticipant > getParticipants()
Definition: Category.java:116
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCanShowAllAttachments()

boolean org.turro.dossier.dossier.CategoryWrapper.getCanShowAllAttachments ( )

Definition at line 102 of file CategoryWrapper.java.

102  {
103  if(isOwner()) {
104  return true;
105  } else if(isParticipant()) {
106  for(IDossierParticipant p : category.getFullParticipants()) {
107  if(p.getIdContact().equals(contact.getId()) && p.isShowAllAttachments()) {
108  return true;
109  }
110  }
111  }
112  return false;
113  }
ParticipantSet< IDossierParticipant > getFullParticipants()
Definition: Category.java:270
Here is the call graph for this function:

◆ isAssistant()

boolean org.turro.dossier.dossier.CategoryWrapper.isAssistant ( )

Definition at line 74 of file CategoryWrapper.java.

74  {
75  if(category == null) return false;
76  return getRole().contains(ParticipantRole.PARTICIPANT_ASSISTANT);
77  }

◆ isChildrenParticipant()

boolean org.turro.dossier.dossier.CategoryWrapper.isChildrenParticipant ( )

Definition at line 47 of file CategoryWrapper.java.

47  {
48  boolean result = isParticipant();
49  if(!result) {
50  for(Category c : category.getChildren()) {
52  return true;
53  }
54  }
55  }
56  return result;
57  }
Set< Category > getChildren()
Definition: Category.java:84
Here is the call graph for this function:

◆ isOwner()

boolean org.turro.dossier.dossier.CategoryWrapper.isOwner ( )

Definition at line 64 of file CategoryWrapper.java.

64  {
65  if(category == null) return false;
66  return getRole().contains(ParticipantRole.PARTICIPANT_OWNER);
67  }
Here is the caller graph for this function:

◆ isParticipant()

boolean org.turro.dossier.dossier.CategoryWrapper.isParticipant ( )

Definition at line 59 of file CategoryWrapper.java.

59  {
60  if(category == null) return false;
61  return getRole() != null && !getRole().isEmpty();
62  }
Here is the caller graph for this function:

◆ isSubject()

boolean org.turro.dossier.dossier.CategoryWrapper.isSubject ( )

Definition at line 69 of file CategoryWrapper.java.

69  {
70  if(category == null) return false;
71  return getRole().contains(ParticipantRole.PARTICIPANT_SUBJECT);
72  }

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