- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 61 of file AttachFolder.java.
◆ AttachFolder() [1/4]
org.turro.attach.zul.navigator.AttachFolder.AttachFolder |
( |
String |
label, |
|
|
String |
path, |
|
|
boolean |
loadOnDemand |
|
) |
| |
Definition at line 70 of file AttachFolder.java.
73 this.realLabel = label;
75 this.loadOnDemand = loadOnDemand;
76 this.setTooltiptext(label);
◆ AttachFolder() [2/4]
org.turro.attach.zul.navigator.AttachFolder.AttachFolder |
( |
String |
label, |
|
|
Object |
value |
|
) |
| |
Definition at line 79 of file AttachFolder.java.
80 throw new UnsupportedOperationException(
"Do not use");
◆ AttachFolder() [3/4]
org.turro.attach.zul.navigator.AttachFolder.AttachFolder |
( |
String |
label | ) |
|
Definition at line 83 of file AttachFolder.java.
84 throw new UnsupportedOperationException(
"Do not use");
◆ AttachFolder() [4/4]
org.turro.attach.zul.navigator.AttachFolder.AttachFolder |
( |
| ) |
|
Definition at line 87 of file AttachFolder.java.
88 throw new UnsupportedOperationException(
"Do not use");
◆ addFolder()
AttachFolder org.turro.attach.zul.navigator.AttachFolder.addFolder |
( |
String |
label, |
|
|
String |
path |
|
) |
| |
Definition at line 175 of file AttachFolder.java.
177 if(children ==
null) {
178 children =
new Treechildren();
179 appendChild(children);
181 children.appendChild(af);
◆ addMedias()
void org.turro.attach.zul.navigator.AttachFolder.addMedias |
( |
Media[] |
medias | ) |
throws InterruptedException, IOException |
Definition at line 100 of file AttachFolder.java.
101 if(medias ==
null || medias.length == 0)
return;
104 for(Media media : medias) {
105 Attachment attachment =
new Attachment();
106 attachment.setModification(
new Date());
107 attachment.setPath(path);
109 attachment.setOnlyOwner(
false);
110 attachment.setComment(
"");
111 attachment.setShowKey(
null);
112 attachment.setPublishable(
true);
113 AttachContent ac =
new AttachContent();
114 if(media.inMemory()) {
115 ac.setFileContent(media.isBinary() ? media.getByteData() : media.getStringData().getBytes());
117 byte[] buffer =
new byte[102400];
118 InputStream is = media.isBinary() ? media.getStreamData() :
new ReaderInputStream(media.getReaderData(), Charset.defaultCharset());
119 ByteArrayOutputStream baos =
new ByteArrayOutputStream();
121 while((r = is.read(buffer)) != -1) {
122 baos.write(buffer, 0, r);
125 ac.setFileContent(baos.toByteArray());
127 attachment.setAttachContent(ac);
128 attachment.setFileName(media.getName());
129 attachment.setFileContentType(media.getContentType());
130 attachment.setFileSize(ac.getFileContent().length);
131 attachment.setValidated(app.
isInRole(
"attach:self-validate"));
132 attachment =
new AttachPU().saveObject(attachment);
133 SystemLogger.getInstance().doLog(SystemLogType.LOG_INFO, attachment,
"uploaded",
null);
134 if(
getTree().getAttachListener() !=
null) {
AttachNavigatorListener getAttachListener()
IConstructor getConstructor()
boolean isInRole(String role)
void uploadDone(Attachment file)
◆ afterCompose()
void org.turro.attach.zul.navigator.AttachFolder.afterCompose |
( |
| ) |
|
◆ doAddFolder()
void org.turro.attach.zul.navigator.AttachFolder.doAddFolder |
( |
| ) |
throws InterruptedException |
Definition at line 141 of file AttachFolder.java.
142 InputDialog.getInput(
146 new InputField(
"Name",
"", null, 0) {
148 protected HtmlBasedComponent createEditor() {
149 return new FolderNameCombobox(AttachFolder.this);
154 public Object execute(Context context) {
155 InputField[] fields = (InputField[]) context.get(
"fields");
156 if(fields.length > 0) {
157 for(InputField f : fields) {
158 if(
"Name".equals(f.getLabel())) {
161 for(String s : ((String) f.getValue()).split(
"\\/")) {
162 if(!Strings.isBlank(s)) {
164 af = af.addFolder(s, af.getPath() +
"/" + s);
◆ doProcessors()
void org.turro.attach.zul.navigator.AttachFolder.doProcessors |
( |
| ) |
|
Definition at line 296 of file AttachFolder.java.
297 String str = Entities.getController(
getPath()).getTreeLabel();
void setFolderLabel(String label)
◆ doUpload()
void org.turro.attach.zul.navigator.AttachFolder.doUpload |
( |
| ) |
throws InterruptedException, IOException |
◆ getAllAttachments()
Collection<Attachment> org.turro.attach.zul.navigator.AttachFolder.getAllAttachments |
( |
| ) |
|
Definition at line 335 of file AttachFolder.java.
337 results.
setAttachPath(Strings.isEmpty(path) ?
"/" : path +
"/%");
338 results.setCkExactPath(
false);
339 return results.getAttachmentList();
void setAttachPath(String attachPath)
AttachResults getResults()
◆ getAttachFolders()
Collection<AttachFolder> org.turro.attach.zul.navigator.AttachFolder.getAttachFolders |
( |
| ) |
|
Definition at line 315 of file AttachFolder.java.
317 return children !=
null ? CollectionUtil.from(children.getChildren()).<Collection<AttachFolder>>cast() : new ArrayList<>();
◆ getAttachments()
Collection<Attachment> org.turro.attach.zul.navigator.AttachFolder.getAttachments |
( |
| ) |
|
Definition at line 320 of file AttachFolder.java.
323 results.setCkExactPath(
true);
324 return results.getAttachmentList();
◆ getFolderLabel()
String org.turro.attach.zul.navigator.AttachFolder.getFolderLabel |
( |
| ) |
|
◆ getFolderPath()
String org.turro.attach.zul.navigator.AttachFolder.getFolderPath |
( |
| ) |
|
◆ getFolders()
Collection<String> org.turro.attach.zul.navigator.AttachFolder.getFolders |
( |
| ) |
|
Definition at line 308 of file AttachFolder.java.
311 results.setCkExactPath(
false);
312 return results.getPathList(path);
◆ getParentFolder()
IAttachFolder org.turro.attach.zul.navigator.AttachFolder.getParentFolder |
( |
| ) |
|
◆ getPath()
String org.turro.attach.zul.navigator.AttachFolder.getPath |
( |
| ) |
|
◆ getTree()
AttachTree org.turro.attach.zul.navigator.AttachFolder.getTree |
( |
| ) |
|
◆ getVersionMap()
Definition at line 327 of file AttachFolder.java.
328 AttachVersionMap avm =
new AttachVersionMap();
330 avm.addAttachment(a);
Collection< Attachment > getAttachments()
◆ isLeaf()
boolean org.turro.attach.zul.navigator.AttachFolder.isLeaf |
( |
| ) |
|
◆ isLoadOnDemand()
boolean org.turro.attach.zul.navigator.AttachFolder.isLoadOnDemand |
( |
| ) |
|
◆ reloadContents()
void org.turro.attach.zul.navigator.AttachFolder.reloadContents |
( |
| ) |
|
Definition at line 192 of file AttachFolder.java.
193 if(children !=
null) {
194 children.getChildren().clear();
◆ setFolderLabel()
void org.turro.attach.zul.navigator.AttachFolder.setFolderLabel |
( |
String |
label | ) |
|
◆ setLoadOnDemand()
void org.turro.attach.zul.navigator.AttachFolder.setLoadOnDemand |
( |
boolean |
loadOnDemand | ) |
|
◆ setPath()
void org.turro.attach.zul.navigator.AttachFolder.setPath |
( |
String |
path | ) |
|
◆ showContents()
void org.turro.attach.zul.navigator.AttachFolder.showContents |
( |
| ) |
|
The documentation for this class was generated from the following file: