19 package org.turro.attach.www;
21 import java.util.HashSet;
22 import org.turro.string.Strings;
23 import org.turro.annotation.ElephantControl;
24 import org.turro.elephant.context.IConstructor;
25 import org.turro.entities.Controls;
26 import org.turro.http.HttpUtil;
32 @ElephantControl(name=Controls.CTRL_ATTACHMENT)
35 private final HashSet<String> restrictedFolders =
new HashSet<>();
37 private String entityPath, entityRoot, treeTemplate;
39 private boolean publicOnly =
false, lastOnly =
false, readOnly =
false;
42 this.constructor = constructor;
46 this.entityPath = entityPath;
51 this.entityRoot = entityRoot;
56 this.treeTemplate = treeTemplate;
60 return restrictedFolders;
64 if(!Strings.isBlank(restrictedFolder)) restrictedFolders.add(restrictedFolder);
68 if(restrictedFolders !=
null) {
69 this.restrictedFolders.addAll(restrictedFolders);
78 this.publicOnly = publicOnly;
87 this.lastOnly = lastOnly;
96 this.readOnly = readOnly;
100 getAttachTree().render();
104 return getAttachTree().parse();
112 return getAttachTree().isEmpty();
116 if(attachTree ==
null) {
122 attachTree.
fillTree(entityPath + (!Strings.isBlank(entityRoot) ? entityRoot :
""));
static String newAttachment(String entityPath, String link, String template)
void setLastOnly(boolean lastOnly)
void setEntityRoot(String entityRoot)
HashSet< String > getRestrictedFolders()
void addRestrictedFolder(String restrictedFolder)
void addRestrictedFolders(HashSet< String > restrictedFolders)
AttachTree getAttachTree()
String parseAttachments()
void setPublicOnly(boolean publicOnly)
AttachCtrl(IConstructor constructor)
void setEntityPath(String entityPath)
String getNewAttachment()
void setReadOnly(boolean readOnly)
void setTreeTemplate(String treeTemplate)
void setLastOnly(boolean lastOnly)
void setPublicOnly(boolean publicOnly)
void addRestrictedFolders(HashSet< String > restrictedFolders)
void setTreeTemplate(String treeTemplate)
void fillTree(String path)
HttpServletRequest getRequest()