19 package org.turro.contacts.profile;
21 import java.io.IOException;
22 import java.util.Collections;
23 import java.util.List;
24 import org.turro.auth.Authentication;
25 import org.turro.config.Configurator;
26 import org.turro.elephant.util.Messages;
27 import org.turro.entities.StandardFolder;
28 import org.turro.file.Document;
29 import org.turro.file.FileWrapper;
30 import org.turro.file.Folder;
31 import org.turro.log.WebLoggers;
32 import org.turro.upload.Medias;
33 import org.zkoss.bind.BindUtils;
34 import org.zkoss.bind.annotation.BindingParam;
35 import org.zkoss.bind.annotation.Command;
36 import org.zkoss.bind.annotation.Init;
37 import org.zkoss.bind.annotation.NotifyChange;
38 import org.zkoss.util.media.Media;
46 private Folder publicFolder;
47 private long maxDocuments;
56 maxDocuments = Configurator.instance().asLong(
"Profile.Documents.Maximum");
59 @NotifyChange(
"model")
61 public
void upload(@BindingParam("medias") Media medias[]) {
62 if(publicFolder !=
null) {
63 long count = publicFolder.count();
64 for(Media media : medias) {
65 if(count < maxDocuments) {
74 public
void download(@BindingParam("document") Document document) {
79 public
void deleteDoc(@BindingParam("document") Document document) {
92 if(publicFolder !=
null && publicFolder.exists())
return publicFolder.documents();
93 }
catch (IOException ex) {
96 return Collections.EMPTY_LIST;
static IContact getIContact()
static Messages confirmDeletion()
Messages add(String word)
static Folder publishable(String entityPath)
static WebLoggers severe(Object entity)
WebLoggers exception(Throwable throwable)