BrightSide Workbench Full Report + Source Code
org.turro.attach.entity.EntityDocumentation Class Reference
Inheritance diagram for org.turro.attach.entity.EntityDocumentation:
Collaboration diagram for org.turro.attach.entity.EntityDocumentation:

Public Member Functions

String getEntityPath ()
 
void setEntityPath (String entityPath)
 
String getContactId ()
 
void setContactId (String contactId)
 
String getDocumentation ()
 
void setDocumentation (String documentation)
 
String getRequesterId ()
 
void setRequesterId (String requesterId)
 
EntityDocumentationStatus getStatus ()
 
void setStatus (EntityDocumentationStatus status)
 
String getComment ()
 
void setComment (String comment)
 
Date getDeadline ()
 
void setDeadline (Date deadline)
 
Set< String > getAssistantIds ()
 
void setAssistantIds (Set< String > assistantIds)
 
boolean isValid (List< EntityDocumentation > invalids)
 
void reviewStatus ()
 
boolean allowsUpload () throws IOException
 
boolean allowsValidation ()
 
boolean allowsDeny ()
 
boolean allowsDelete () throws IOException
 
boolean allowsDeleteDef () throws IOException
 
List< Document > getDocuments ()
 
Folder getFolder ()
 
String getFolderString ()
 
DocumentDefinition getDefinition ()
 
IElephantEntity getEntity ()
 
IContact getContact ()
 
IContact getRequester ()
 
List< IContactgetAssistants ()
 

Detailed Description

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

Definition at line 54 of file EntityDocumentation.java.

Member Function Documentation

◆ allowsDelete()

boolean org.turro.attach.entity.EntityDocumentation.allowsDelete ( ) throws IOException

Definition at line 167 of file EntityDocumentation.java.

167  {
168  return !(getDefinition().isUploadControl() || EntityDocumentationStatus.VALIDATED.equals(status)) ||
169  Authentication.isAdministrator();
170  }
Here is the call graph for this function:

◆ allowsDeleteDef()

boolean org.turro.attach.entity.EntityDocumentation.allowsDeleteDef ( ) throws IOException

Definition at line 172 of file EntityDocumentation.java.

172  {
173  return getFolder().isEmpty() || Authentication.isAdministrator();
174  }
Here is the call graph for this function:

◆ allowsDeny()

boolean org.turro.attach.entity.EntityDocumentation.allowsDeny ( )

Definition at line 162 of file EntityDocumentation.java.

162  {
163  return allowsValidation() || (Authentication.isAdministrator() &&
164  EntityDocumentationStatus.VALIDATED.equals(status));
165  }
Here is the call graph for this function:

◆ allowsUpload()

boolean org.turro.attach.entity.EntityDocumentation.allowsUpload ( ) throws IOException

Definition at line 152 of file EntityDocumentation.java.

152  {
153  return (!EntityDocumentationStatus.VALIDATED.equals(status) &&
154  (getDefinition().isUploadControl() || getFolder().count() < getDefinition().getMax())) ||
155  Authentication.isAdministrator();
156  }
Here is the call graph for this function:

◆ allowsValidation()

boolean org.turro.attach.entity.EntityDocumentation.allowsValidation ( )

Definition at line 158 of file EntityDocumentation.java.

158  {
159  return EntityDocumentationStatus.PENDING_VALIDATION.equals(status);
160  }

◆ getAssistantIds()

Set<String> org.turro.attach.entity.EntityDocumentation.getAssistantIds ( )

Definition at line 126 of file EntityDocumentation.java.

126  {
127  return assistantIds;
128  }

◆ getAssistants()

List<IContact> org.turro.attach.entity.EntityDocumentation.getAssistants ( )

Definition at line 212 of file EntityDocumentation.java.

212  {
213  return assistantIds.stream().map(id -> Contacts.getContactById(id)).toList();
214  }
Here is the call graph for this function:

◆ getComment()

String org.turro.attach.entity.EntityDocumentation.getComment ( )

Definition at line 110 of file EntityDocumentation.java.

110  {
111  return comment;
112  }
Here is the caller graph for this function:

◆ getContact()

IContact org.turro.attach.entity.EntityDocumentation.getContact ( )

Definition at line 204 of file EntityDocumentation.java.

204  {
205  return Contacts.getContactById(contactId);
206  }
Here is the call graph for this function:

◆ getContactId()

String org.turro.attach.entity.EntityDocumentation.getContactId ( )

Definition at line 78 of file EntityDocumentation.java.

78  {
79  return contactId;
80  }

◆ getDeadline()

Date org.turro.attach.entity.EntityDocumentation.getDeadline ( )

Definition at line 118 of file EntityDocumentation.java.

118  {
119  return deadline;
120  }

◆ getDefinition()

DocumentDefinition org.turro.attach.entity.EntityDocumentation.getDefinition ( )

Definition at line 196 of file EntityDocumentation.java.

196  {
197  return DocumentDefinitions.instance().get(documentation);
198  }
Here is the call graph for this function:

◆ getDocumentation()

String org.turro.attach.entity.EntityDocumentation.getDocumentation ( )

Definition at line 86 of file EntityDocumentation.java.

86  {
87  return documentation;
88  }

◆ getDocuments()

List<Document> org.turro.attach.entity.EntityDocumentation.getDocuments ( )

Definition at line 176 of file EntityDocumentation.java.

176  {
177  Folder folder = getFolder();
178  if(folder.exists()) try {
179  return folder.documents();
180  } catch (IOException ex) {
181  Logger.getLogger(EntityDocumentation.class.getName()).log(Level.SEVERE, null, ex);
182  }
183  return Collections.EMPTY_LIST;
184  }

◆ getEntity()

IElephantEntity org.turro.attach.entity.EntityDocumentation.getEntity ( )

Definition at line 200 of file EntityDocumentation.java.

200  {
201  return Entities.getController(entityPath);
202  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEntityPath()

String org.turro.attach.entity.EntityDocumentation.getEntityPath ( )

Definition at line 70 of file EntityDocumentation.java.

70  {
71  return entityPath;
72  }

◆ getFolder()

Folder org.turro.attach.entity.EntityDocumentation.getFolder ( )

Definition at line 186 of file EntityDocumentation.java.

186  {
187  return Folder.from(ElephantContext.getRealPath(getFolderString()));
188  }
Here is the call graph for this function:

◆ getFolderString()

String org.turro.attach.entity.EntityDocumentation.getFolderString ( )

Definition at line 190 of file EntityDocumentation.java.

190  {
191  DocumentDefinition dd = getDefinition();
192  return "/WEB-INF/files/" + entityPath + "/documentation/" +
193  dd.getFolderName() + "/" + contactId;
194  }
Here is the call graph for this function:

◆ getRequester()

IContact org.turro.attach.entity.EntityDocumentation.getRequester ( )

Definition at line 208 of file EntityDocumentation.java.

208  {
209  return Contacts.getContactById(requesterId);
210  }
Here is the call graph for this function:

◆ getRequesterId()

String org.turro.attach.entity.EntityDocumentation.getRequesterId ( )

Definition at line 94 of file EntityDocumentation.java.

94  {
95  return requesterId;
96  }

◆ getStatus()

EntityDocumentationStatus org.turro.attach.entity.EntityDocumentation.getStatus ( )

Definition at line 102 of file EntityDocumentation.java.

102  {
103  return status;
104  }
Here is the caller graph for this function:

◆ isValid()

boolean org.turro.attach.entity.EntityDocumentation.isValid ( List< EntityDocumentation invalids)

Definition at line 136 of file EntityDocumentation.java.

136  {
137  if(getDefinition() == null) {
138  invalids.add(this);
139  return false;
140  }
141  return true;
142  }

◆ reviewStatus()

void org.turro.attach.entity.EntityDocumentation.reviewStatus ( )

Definition at line 144 of file EntityDocumentation.java.

144  {
145  if(getFolder().count() < getDefinition().getMin()) {
146  status = EntityDocumentationStatus.PENDING_UPLOAD;
147  } else if(!EntityDocumentationStatus.validationStatus().contains(status)) {
148  status = EntityDocumentationStatus.PENDING_VALIDATION;
149  }
150  }
Here is the call graph for this function:

◆ setAssistantIds()

void org.turro.attach.entity.EntityDocumentation.setAssistantIds ( Set< String >  assistantIds)

Definition at line 130 of file EntityDocumentation.java.

130  {
131  this.assistantIds = assistantIds;
132  }

◆ setComment()

void org.turro.attach.entity.EntityDocumentation.setComment ( String  comment)

Definition at line 114 of file EntityDocumentation.java.

114  {
115  this.comment = comment;
116  }

◆ setContactId()

void org.turro.attach.entity.EntityDocumentation.setContactId ( String  contactId)

Definition at line 82 of file EntityDocumentation.java.

82  {
83  this.contactId = contactId;
84  }
Here is the caller graph for this function:

◆ setDeadline()

void org.turro.attach.entity.EntityDocumentation.setDeadline ( Date  deadline)

Definition at line 122 of file EntityDocumentation.java.

122  {
123  this.deadline = deadline;
124  }
Here is the caller graph for this function:

◆ setDocumentation()

void org.turro.attach.entity.EntityDocumentation.setDocumentation ( String  documentation)

Definition at line 90 of file EntityDocumentation.java.

90  {
91  this.documentation = documentation;
92  }
Here is the caller graph for this function:

◆ setEntityPath()

void org.turro.attach.entity.EntityDocumentation.setEntityPath ( String  entityPath)

Definition at line 74 of file EntityDocumentation.java.

74  {
75  this.entityPath = entityPath;
76  }
Here is the caller graph for this function:

◆ setRequesterId()

void org.turro.attach.entity.EntityDocumentation.setRequesterId ( String  requesterId)

Definition at line 98 of file EntityDocumentation.java.

98  {
99  this.requesterId = requesterId;
100  }
Here is the caller graph for this function:

◆ setStatus()

void org.turro.attach.entity.EntityDocumentation.setStatus ( EntityDocumentationStatus  status)

Definition at line 106 of file EntityDocumentation.java.

106  {
107  this.status = status;
108  }
Here is the caller graph for this function:

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