BrightSide Workbench Full Report + Source Code
org.turro.elephant.documents.DocumentsBean Class Reference

Public Member Functions

 DocumentsBean ()
 
void setConstructor (IConstructor constructor)
 
IConstructor getConstructor ()
 
ProcessMessages getMessages ()
 
DocumentsRoot[] getRealRoots ()
 
DocumentsRoot[] getRealRootsWithUser ()
 
DocumentsRoot[] getDocumentRoots ()
 
void setSelectedId (String selectedId)
 
void setSelectedRoot (String selectedRoot)
 
DocumentsRoot getDocumentRootById ()
 
DocumentsRoot[] getRootsForInsertion ()
 
FileDocument[] getInsertionFolders ()
 
Collection getInsertionFoldersWrapped ()
 
FileDocument[] getFolders ()
 
FileDocument[] getNotValidated ()
 
String getDownloadURL ()
 
Localizer getLocalizer ()
 
Properties getPropertiesFile (String file)
 
void savePropertiesFile (Properties props, String file)
 
void setAttribute (String key, String value)
 
boolean getCanViewAs ()
 
boolean getCanNew ()
 
boolean getCanDelete ()
 
boolean getCanNewFolder ()
 
boolean getCanDelFolder ()
 
boolean getCanEditPermissions ()
 
boolean getCanNewInsertPoint ()
 
boolean getCanValidate ()
 
boolean getCanContact ()
 
Set getUsers ()
 
boolean isSelected (IUser user)
 
String getSelectedUser ()
 
Set< DocumentsRootgetInsertionPointsWrapped ()
 
boolean isInsertionSelected (FileDocument fd)
 
boolean isFolderSelected (FileDocument fd)
 
int getMode ()
 
String getShowingUsers ()
 
String getManagingFiles ()
 
String getManagingPermissions ()
 
String getAddingInsertionPoint ()
 
String getValidating ()
 

Static Public Attributes

static final String DOCS_CONFIGURATION = "/WEB-INF/elephant/conf/documents.xml"
 

Detailed Description

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

Definition at line 61 of file DocumentsBean.java.

Constructor & Destructor Documentation

◆ DocumentsBean()

org.turro.elephant.documents.DocumentsBean.DocumentsBean ( )

Creates a new instance of DocumentsBean

Definition at line 70 of file DocumentsBean.java.

70  {
71  }

Member Function Documentation

◆ getAddingInsertionPoint()

String org.turro.elephant.documents.DocumentsBean.getAddingInsertionPoint ( )

Definition at line 414 of file DocumentsBean.java.

414  {
415  return mode == 4 ? "checked" : "";
416  }

◆ getCanContact()

boolean org.turro.elephant.documents.DocumentsBean.getCanContact ( )

Definition at line 342 of file DocumentsBean.java.

342  {
343  return constructor.isInRole("contact:list");
344  }
Here is the call graph for this function:

◆ getCanDelete()

boolean org.turro.elephant.documents.DocumentsBean.getCanDelete ( )

Definition at line 318 of file DocumentsBean.java.

318  {
319  return constructor.isInRole("documents:delete");
320  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCanDelFolder()

boolean org.turro.elephant.documents.DocumentsBean.getCanDelFolder ( )

Definition at line 326 of file DocumentsBean.java.

326  {
327  return constructor.isInRole("documents:del-folder");
328  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCanEditPermissions()

boolean org.turro.elephant.documents.DocumentsBean.getCanEditPermissions ( )

Definition at line 330 of file DocumentsBean.java.

330  {
331  return constructor.isInRole("documents:edit-allowed");
332  }
Here is the call graph for this function:

◆ getCanNew()

boolean org.turro.elephant.documents.DocumentsBean.getCanNew ( )

Definition at line 314 of file DocumentsBean.java.

314  {
315  return constructor.isInRole("documents:new");
316  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCanNewFolder()

boolean org.turro.elephant.documents.DocumentsBean.getCanNewFolder ( )

Definition at line 322 of file DocumentsBean.java.

322  {
323  return constructor.isInRole("documents:new-folder");
324  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCanNewInsertPoint()

boolean org.turro.elephant.documents.DocumentsBean.getCanNewInsertPoint ( )

Definition at line 334 of file DocumentsBean.java.

334  {
335  return constructor.isInRole("documents:new-insertpoint");
336  }
Here is the call graph for this function:

◆ getCanValidate()

boolean org.turro.elephant.documents.DocumentsBean.getCanValidate ( )

Definition at line 338 of file DocumentsBean.java.

338  {
339  return constructor.isInRole("documents:validate");
340  }
Here is the call graph for this function:

◆ getCanViewAs()

boolean org.turro.elephant.documents.DocumentsBean.getCanViewAs ( )

Definition at line 310 of file DocumentsBean.java.

310  {
311  return constructor.isInRole("documents:view-as");
312  }
Here is the call graph for this function:

◆ getConstructor()

IConstructor org.turro.elephant.documents.DocumentsBean.getConstructor ( )

Definition at line 80 of file DocumentsBean.java.

80  {
81  return constructor;
82  }
Here is the caller graph for this function:

◆ getDocumentRootById()

DocumentsRoot org.turro.elephant.documents.DocumentsBean.getDocumentRootById ( )

Definition at line 184 of file DocumentsBean.java.

184  {
185  for(DocumentsRoot dr : getDocumentRoots()) {
186  if(selectedId.equals(dr.getAttribute("id"))) {
187  dr.setFileDocumentSelected(selectedRoot);
188  return dr;
189  }
190  }
191  return null;
192  }
Here is the call graph for this function:

◆ getDocumentRoots()

DocumentsRoot [] org.turro.elephant.documents.DocumentsBean.getDocumentRoots ( )

Definition at line 134 of file DocumentsBean.java.

134  {
135  if (selectedUser == null && constructor.getUser() != null) {
136  selectedUser = constructor.getUser().getId();
137  }
138  ArrayList v = new ArrayList();
139  Element config = getConfiguration();
140 
141  if (config != null) {
142  DocumentsRoot userRoot;
143  Iterator it = config.getChildren("root").iterator();
144  Element el;
145  while (it.hasNext()) {
146  userRoot = null;
147  el = (Element) it.next();
148  if (el.getAttribute("role") == null || constructor.isInRole(el.getAttributeValue("role"))) {
149  docsRoot = el.getTextTrim();
150  if ("true".equals(el.getAttributeValue("appendUser"))) {
151  if (selectedUser != null) {
152  userRoot = new DocumentsRoot(this, docsRoot, "/" + selectedUser, el);
153  v.add(userRoot);
154  }
155  } else {
156  userRoot = new DocumentsRoot(this, docsRoot, "", el);
157  v.add(userRoot);
158  }
159 
160  if (userRoot != null) {
161  String id;
162  for (int i = 0; i < 30; i++) {
163  id = userRoot.readConfig("allowed." + i);
164  if (id != null) {
165  v.add(new DocumentsRoot(this, docsRoot, "/" + id, el));
166  }
167  }
168  }
169  }
170  }
171  }
172 
173  return (DocumentsRoot[]) v.toArray(new DocumentsRoot[0]);
174  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDownloadURL()

String org.turro.elephant.documents.DocumentsBean.getDownloadURL ( )

Definition at line 272 of file DocumentsBean.java.

272  {
273  return ElephantContext.getRootWebPath() + "/Download";
274  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFolders()

FileDocument [] org.turro.elephant.documents.DocumentsBean.getFolders ( )

Definition at line 243 of file DocumentsBean.java.

243  {
244  ArrayList v = new ArrayList();
245  for (DocumentsRoot dr : getRootsForInsertion()) {
246  fillFolders(v, dr.getFileDocumentRoot(), false);
247  }
248  return (FileDocument[]) v.toArray(new FileDocument[0]);
249  }
Here is the call graph for this function:

◆ getInsertionFolders()

FileDocument [] org.turro.elephant.documents.DocumentsBean.getInsertionFolders ( )

Definition at line 224 of file DocumentsBean.java.

224  {
225  ArrayList v = new ArrayList();
226  for (DocumentsRoot dr : getRootsForInsertion()) {
227  fillFolders(v, dr.getFileDocumentRoot(), "true".equals(dr.getAttribute("onlyLeafInsertion")));
228  }
229  FileDocument fds[] = (FileDocument[]) v.toArray(new FileDocument[0]);
230  Arrays.sort(fds);
231  return fds;
232  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInsertionFoldersWrapped()

Collection org.turro.elephant.documents.DocumentsBean.getInsertionFoldersWrapped ( )

Definition at line 234 of file DocumentsBean.java.

234  {
235  ArrayList v = new ArrayList();
236  for(FileDocument fd : getInsertionFolders()) {
237  v.add(new FileDocumentWrapper(fd, false));
238  }
239  return v;
240  }
Here is the call graph for this function:

◆ getInsertionPointsWrapped()

Set<DocumentsRoot> org.turro.elephant.documents.DocumentsBean.getInsertionPointsWrapped ( )

Definition at line 368 of file DocumentsBean.java.

368  {
369  Set tmp = new TreeSet();
370  Element config = getConfiguration();
371 
372  if (config != null) {
373  DocumentsRoot userRoot;
374  Iterator it = config.getChildren("root").iterator();
375  Element el;
376  while (it.hasNext()) {
377  userRoot = null;
378  el = (Element) it.next();
379  if (el.getAttribute("role") == null || constructor.isInRole(el.getAttributeValue("role"))) {
380  docsRoot = el.getTextTrim();
381  userRoot = new DocumentsRoot(this, docsRoot, "", el);
382  tmp.addAll(userRoot.getInsertionPointsWrapped());
383  }
384  }
385  }
386 
387  return tmp;
388  }
Here is the call graph for this function:

◆ getLocalizer()

Localizer org.turro.elephant.documents.DocumentsBean.getLocalizer ( )

Definition at line 276 of file DocumentsBean.java.

276  {
277  return constructor.getLocalizer();
278  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getManagingFiles()

String org.turro.elephant.documents.DocumentsBean.getManagingFiles ( )

Definition at line 406 of file DocumentsBean.java.

406  {
407  return mode == 2 ? "checked" : "";
408  }

◆ getManagingPermissions()

String org.turro.elephant.documents.DocumentsBean.getManagingPermissions ( )

Definition at line 410 of file DocumentsBean.java.

410  {
411  return mode == 3 ? "checked" : "";
412  }

◆ getMessages()

ProcessMessages org.turro.elephant.documents.DocumentsBean.getMessages ( )

Definition at line 84 of file DocumentsBean.java.

84  {
85  return ProcessMessages.getInstance();
86  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMode()

int org.turro.elephant.documents.DocumentsBean.getMode ( )

Definition at line 398 of file DocumentsBean.java.

398  {
399  return mode;
400  }

◆ getNotValidated()

FileDocument [] org.turro.elephant.documents.DocumentsBean.getNotValidated ( )

Definition at line 264 of file DocumentsBean.java.

264  {
265  ArrayList v = new ArrayList();
266  for(DocumentsRoot dr : getRealRoots()) {
267  v.addAll(dr.getNotValidated());
268  }
269  return (FileDocument[]) v.toArray(new FileDocument[0]);
270  }
Here is the call graph for this function:

◆ getPropertiesFile()

Properties org.turro.elephant.documents.DocumentsBean.getPropertiesFile ( String  file)

Definition at line 280 of file DocumentsBean.java.

280  {
281  Properties tmp = new Properties();
282  if (new File(file).exists()) {
283  FileInputStream fis;
284  try {
285  fis = new FileInputStream(file);
286  tmp.load(fis);
287  fis.close();
288  } catch (Exception ex) {
289  Logger.getLogger(DocumentsBean.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
290  }
291  }
292  return tmp;
293  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRealRoots()

DocumentsRoot [] org.turro.elephant.documents.DocumentsBean.getRealRoots ( )

Definition at line 88 of file DocumentsBean.java.

88  {
89  ArrayList v = new ArrayList();
90  Element config = getConfiguration();
91 
92  if (config != null) {
93  DocumentsRoot userRoot;
94  Iterator it = config.getChildren("root").iterator();
95  Element el;
96  while (it.hasNext()) {
97  userRoot = null;
98  el = (Element) it.next();
99  if (el.getAttribute("role") == null || constructor.isInRole(el.getAttributeValue("role"))) {
100  docsRoot = el.getTextTrim();
101  userRoot = new DocumentsRoot(this, docsRoot, "", el);
102  v.add(userRoot);
103  }
104  }
105  }
106 
107  return (DocumentsRoot[]) v.toArray(new DocumentsRoot[0]);
108  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRealRootsWithUser()

DocumentsRoot [] org.turro.elephant.documents.DocumentsBean.getRealRootsWithUser ( )

Definition at line 110 of file DocumentsBean.java.

110  {
111  ArrayList v = new ArrayList();
112  Element config = getConfiguration();
113 
114  if (config != null) {
115  DocumentsRoot userRoot;
116  Iterator it = config.getChildren("root").iterator();
117  Element el;
118  while (it.hasNext()) {
119  userRoot = null;
120  el = (Element) it.next();
121  if (el.getAttribute("role") == null || constructor.isInRole(el.getAttributeValue("role"))) {
122  if ("true".equals(el.getAttributeValue("appendUser"))) {
123  docsRoot = el.getTextTrim();
124  userRoot = new DocumentsRoot(this, docsRoot, "", el);
125  v.add(userRoot);
126  }
127  }
128  }
129  }
130 
131  return (DocumentsRoot[]) v.toArray(new DocumentsRoot[0]);
132  }
Here is the call graph for this function:

◆ getRootsForInsertion()

DocumentsRoot [] org.turro.elephant.documents.DocumentsBean.getRootsForInsertion ( )

Definition at line 194 of file DocumentsBean.java.

194  {
195  if (selectedInsertion == null) {
196  return new DocumentsRoot[0];
197  }
198  ArrayList v = new ArrayList();
199  Element config = getConfiguration();
200 
201  if (config != null) {
202  DocumentsRoot userRoot;
203  Iterator it = config.getChildren("root").iterator();
204  Element el;
205  while (it.hasNext()) {
206  userRoot = null;
207  el = (Element) it.next();
208  if (el.getAttribute("role") == null || constructor.isInRole(el.getAttributeValue("role"))) {
209  docsRoot = el.getTextTrim();
210  if ("true".equals(el.getAttributeValue("appendUser"))) {
211  userRoot = new DocumentsRoot(this, docsRoot, "/" + selectedInsertion, el);
212  v.add(userRoot);
213  } else {
214  userRoot = new DocumentsRoot(this, docsRoot, "", el);
215  v.add(userRoot);
216  }
217  }
218  }
219  }
220 
221  return (DocumentsRoot[]) v.toArray(new DocumentsRoot[0]);
222  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSelectedUser()

String org.turro.elephant.documents.DocumentsBean.getSelectedUser ( )

Definition at line 364 of file DocumentsBean.java.

364  {
365  return selectedUser;
366  }
Here is the caller graph for this function:

◆ getShowingUsers()

String org.turro.elephant.documents.DocumentsBean.getShowingUsers ( )

Definition at line 402 of file DocumentsBean.java.

402  {
403  return mode == 1 ? "checked" : "";
404  }

◆ getUsers()

Set org.turro.elephant.documents.DocumentsBean.getUsers ( )

Definition at line 346 of file DocumentsBean.java.

346  {
347  Set tmp = new TreeSet();
348  for (IUser usr : (List<IUser>) constructor.getUser().getUsers()) {
349  if (usr.isInRole("documents:list")) {
350  tmp.add(new UserWrapper(this, usr));
351  }
352  }
353  return tmp;
354  }
Here is the call graph for this function:

◆ getValidating()

String org.turro.elephant.documents.DocumentsBean.getValidating ( )

Definition at line 418 of file DocumentsBean.java.

418  {
419  return mode == 5 ? "checked" : "";
420  }

◆ isFolderSelected()

boolean org.turro.elephant.documents.DocumentsBean.isFolderSelected ( FileDocument  fd)

Definition at line 394 of file DocumentsBean.java.

394  {
395  return selectedFolder != null && selectedFolder.equals(fd.getAbsolutePath());
396  }
Here is the caller graph for this function:

◆ isInsertionSelected()

boolean org.turro.elephant.documents.DocumentsBean.isInsertionSelected ( FileDocument  fd)

Definition at line 390 of file DocumentsBean.java.

390  {
391  return selectedInsertion != null && selectedInsertion.equals(fd.getName());
392  }
Here is the caller graph for this function:

◆ isSelected()

boolean org.turro.elephant.documents.DocumentsBean.isSelected ( IUser  user)

Definition at line 356 of file DocumentsBean.java.

356  {
357  if (selectedUser == null && constructor.getUser() != null) {
358  selectedUser = constructor.getUser().getId();
359  }
360 
361  return selectedUser != null && selectedUser.equals(user.getId());
362  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ savePropertiesFile()

void org.turro.elephant.documents.DocumentsBean.savePropertiesFile ( Properties  props,
String  file 
)

Definition at line 295 of file DocumentsBean.java.

295  {
296  FileOutputStream fos;
297  try {
298  fos = new FileOutputStream(file);
299  props.store(fos, null);
300  fos.close();
301  } catch (Exception ex) {
302  Logger.getLogger(DocumentsBean.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
303  }
304  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAttribute()

void org.turro.elephant.documents.DocumentsBean.setAttribute ( String  key,
String  value 
)

Definition at line 306 of file DocumentsBean.java.

306  {
307  constructor.setSessionAttribute(key, value);
308  }
void setSessionAttribute(String key, Object value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConstructor()

void org.turro.elephant.documents.DocumentsBean.setConstructor ( IConstructor  constructor)

Definition at line 73 of file DocumentsBean.java.

73  {
74  this.constructor = constructor;
75  constructor.setSessionAttribute("xp_down_mime", ElephantContext.getRootWebPath() + "/_internal/system/mime");
76  getMessages().clear();
77  processParameters();
78  }
Here is the call graph for this function:

◆ setSelectedId()

void org.turro.elephant.documents.DocumentsBean.setSelectedId ( String  selectedId)

Definition at line 176 of file DocumentsBean.java.

176  {
177  this.selectedId = selectedId;
178  }

◆ setSelectedRoot()

void org.turro.elephant.documents.DocumentsBean.setSelectedRoot ( String  selectedRoot)

Definition at line 180 of file DocumentsBean.java.

180  {
181  this.selectedRoot = selectedRoot;
182  }

Member Data Documentation

◆ DOCS_CONFIGURATION

final String org.turro.elephant.documents.DocumentsBean.DOCS_CONFIGURATION = "/WEB-INF/elephant/conf/documents.xml"
static

Definition at line 63 of file DocumentsBean.java.


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