BrightSide Workbench Full Report + Source Code
org.turro.contacts.profile.PublicDocumentsVM Class Reference

Public Member Functions

void init ()
 
void upload (@BindingParam("medias") Media medias[])
 
void download (@BindingParam("document") Document document)
 
void deleteDoc (@BindingParam("document") Document document)
 
long getMaxDocuments ()
 
List< Document > getModel ()
 

Detailed Description

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

Definition at line 44 of file PublicDocumentsVM.java.

Member Function Documentation

◆ deleteDoc()

void org.turro.contacts.profile.PublicDocumentsVM.deleteDoc ( @BindingParam("document") Document  document)

Definition at line 79 of file PublicDocumentsVM.java.

79  {
80  Messages.confirmDeletion().add(document.name()).show(() -> {
81  document.delete();
82  BindUtils.postNotifyChange(null, null, PublicDocumentsVM.this, "model");
83  });
84  }
Here is the call graph for this function:

◆ download()

void org.turro.contacts.profile.PublicDocumentsVM.download ( @BindingParam("document") Document  document)

Definition at line 74 of file PublicDocumentsVM.java.

74  {
75  new FileWrapper(document.document()).download();
76  }
Here is the call graph for this function:

◆ getMaxDocuments()

long org.turro.contacts.profile.PublicDocumentsVM.getMaxDocuments ( )

Definition at line 86 of file PublicDocumentsVM.java.

86  {
87  return maxDocuments;
88  }

◆ getModel()

List<Document> org.turro.contacts.profile.PublicDocumentsVM.getModel ( )

Definition at line 90 of file PublicDocumentsVM.java.

90  {
91  try {
92  if(publicFolder != null && publicFolder.exists()) return publicFolder.documents();
93  } catch (IOException ex) {
94  WebLoggers.severe(this).exception(ex).log();
95  }
96  return Collections.EMPTY_LIST;
97  }
Here is the call graph for this function:

◆ init()

void org.turro.contacts.profile.PublicDocumentsVM.init ( )

Definition at line 50 of file PublicDocumentsVM.java.

50  {
51  publicFolder = StandardFolder.publishable()
52  .real()
53  .entity(Authentication.getIContact())
54  .folder("public")
55  .asFolder();
56  maxDocuments = Configurator.instance().asLong("Profile.Documents.Maximum");
57  }
Here is the call graph for this function:

◆ upload()

void org.turro.contacts.profile.PublicDocumentsVM.upload ( @BindingParam("medias") Media  medias[])

Definition at line 61 of file PublicDocumentsVM.java.

61  {
62  if(publicFolder != null) {
63  long count = publicFolder.count();
64  for(Media media : medias) {
65  if(count < maxDocuments) {
66  Medias.toFolder(media, publicFolder);
67  count++;
68  }
69  }
70  }
71  }
Here is the call graph for this function:

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