BrightSide Workbench Full Report + Source Code
org.turro.file.zul.control.RepositoryControl Class Reference
Inheritance diagram for org.turro.file.zul.control.RepositoryControl:
Collaboration diagram for org.turro.file.zul.control.RepositoryControl:

Public Member Functions

void onChangeFolder ()
 
void onSelectFolder ()
 
void onSearchValue ()
 
void onRegexp ()
 
void onFullpath ()
 
void onPartial ()
 
void onSearch ()
 
void onLevelUp () throws Exception
 
void onNewFolder () throws Exception
 
void onUpload (UploadEvent event) throws Exception
 
void onSend () throws Exception
 
void onDownload () throws Exception
 
void onCopy () throws Exception
 
void onCut () throws Exception
 
void onPaste () throws Exception
 
void onDelete () throws Exception
 
void onEvent (UploadEvent event) throws Exception
 
 RepositoryControl ()
 
Boolean getPublicOnly ()
 
void setPublicOnly (Boolean publicOnly)
 
boolean isReadOnly ()
 
void setReadOnly (boolean readOnly)
 
boolean isTreeCollapsed ()
 
void setTreeCollapsed (boolean treeCollapsed)
 
String getLabel ()
 
void setLabel (String label)
 
String getPath ()
 
void setPath (String path)
 
RepositoryTree getTreeFolder ()
 
void afterCompose ()
 
void selectFirst ()
 

Detailed Description

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

Definition at line 55 of file RepositoryControl.java.

Constructor & Destructor Documentation

◆ RepositoryControl()

org.turro.file.zul.control.RepositoryControl.RepositoryControl ( )

Definition at line 258 of file RepositoryControl.java.

258  {
259  Executions.createComponents("/WEB-INF/_zul/bs/comps/attachment/repositoryControl.zul", this, null);
260  Selectors.wireComponents(this, this, false);
261  Selectors.wireEventListeners(this, this);
262  }

Member Function Documentation

◆ afterCompose()

void org.turro.file.zul.control.RepositoryControl.afterCompose ( )

Definition at line 311 of file RepositoryControl.java.

311  {
312  initResults();
313  initComponents();
314  panelFolder.setOpen(!treeCollapsed);
315  }

◆ getLabel()

String org.turro.file.zul.control.RepositoryControl.getLabel ( )

Definition at line 288 of file RepositoryControl.java.

288  {
289  return label;
290  }

◆ getPath()

String org.turro.file.zul.control.RepositoryControl.getPath ( )

Definition at line 296 of file RepositoryControl.java.

296  {
297  return path;
298  }

◆ getPublicOnly()

Boolean org.turro.file.zul.control.RepositoryControl.getPublicOnly ( )

Definition at line 264 of file RepositoryControl.java.

264  {
265  return publicOnly;
266  }

◆ getTreeFolder()

RepositoryTree org.turro.file.zul.control.RepositoryControl.getTreeFolder ( )

Definition at line 306 of file RepositoryControl.java.

306  {
307  return treeFolder;
308  }

◆ isReadOnly()

boolean org.turro.file.zul.control.RepositoryControl.isReadOnly ( )

Definition at line 272 of file RepositoryControl.java.

272  {
273  return readOnly;
274  }

◆ isTreeCollapsed()

boolean org.turro.file.zul.control.RepositoryControl.isTreeCollapsed ( )

Definition at line 280 of file RepositoryControl.java.

280  {
281  return treeCollapsed;
282  }

◆ onChangeFolder()

void org.turro.file.zul.control.RepositoryControl.onChangeFolder ( )

Definition at line 111 of file RepositoryControl.java.

111  {
112  currentFolder = (RepositoryItem) treeFolder.getSelectedFolder().getParentFolder();
113  if(currentFolder == null) {
114  treeFolder.reloadContents();
115  treeFolder.selectFirst();
116  currentFolder = treeFolder.getSelectedFolder();
117  } else {
118  currentFolder.reloadContents();
119  fileGrid.setCurrentFolder(currentFolder);
120  }
121  updateButtons();
122  }
void setCurrentFolder(RepositoryItem currentFolder)
Here is the call graph for this function:

◆ onCopy()

void org.turro.file.zul.control.RepositoryControl.onCopy ( ) throws Exception

Definition at line 216 of file RepositoryControl.java.

Here is the call graph for this function:

◆ onCut()

void org.turro.file.zul.control.RepositoryControl.onCut ( ) throws Exception

Definition at line 221 of file RepositoryControl.java.

221  {
222  FileClipboard.cutFolder(currentFolder.getLabel(), currentFolder.getRealFolder());
223  }
Here is the call graph for this function:

◆ onDelete()

void org.turro.file.zul.control.RepositoryControl.onDelete ( ) throws Exception

Definition at line 235 of file RepositoryControl.java.

235  {
236  if(Application.getApplication().isInRole("file-attach:delete")) {
237  Messages.confirmDeletion().show(() -> {
238  for(File f : currentFolder.getFiles()) {
239  f.delete();
240  if(treeFolder.getFileListener() != null) {
241  treeFolder.getFileListener().deleteDone(f);
242  }
243  }
244  treeFolder.setSelectedItem(currentFolder);
245  fileGrid.setCurrentFolder(currentFolder);
246  });
247  }
248  }
Here is the call graph for this function:

◆ onDownload()

void org.turro.file.zul.control.RepositoryControl.onDownload ( ) throws Exception

Definition at line 206 of file RepositoryControl.java.

206  {
207  RepositoryItem af = fileGrid.getCurrentFolder();
208  if(af != null) {
209  File targetZip = File.createTempFile("attach_", "_folder.zip");
210  Compress.zip(af.getRealFolder().toPath(), targetZip.toPath());
211  Filedownload.save(targetZip, "application/zip");
212  }
213  }
Here is the call graph for this function:

◆ onEvent()

void org.turro.file.zul.control.RepositoryControl.onEvent ( UploadEvent  event) throws Exception

Definition at line 251 of file RepositoryControl.java.

251  {
252  if(currentFolder != null) {
253  currentFolder.addMedias(event.getMedias());
254  fileGrid.setCurrentFolder(currentFolder);
255  }
256  }

◆ onFullpath()

void org.turro.file.zul.control.RepositoryControl.onFullpath ( )

Definition at line 142 of file RepositoryControl.java.

142  {
143  results.setPath(fullpath.isChecked());
144  }
Here is the call graph for this function:

◆ onLevelUp()

void org.turro.file.zul.control.RepositoryControl.onLevelUp ( ) throws Exception

Definition at line 158 of file RepositoryControl.java.

158  {
159  if(currentFolder != null && currentFolder.getParentItem() != null) {
160  currentFolder = (RepositoryItem) currentFolder.getParentItem();
161  treeFolder.setSelectedItem(currentFolder);
162  fileGrid.setCurrentFolder(currentFolder);
163  updateButtons();
164  }
165  }
Here is the call graph for this function:

◆ onNewFolder()

void org.turro.file.zul.control.RepositoryControl.onNewFolder ( ) throws Exception

Definition at line 168 of file RepositoryControl.java.

168  {
169  if(currentFolder != null) {
170  currentFolder.doAddFolder();
171  currentFolder.reloadContents();
172  fileGrid.setCurrentFolder(currentFolder);
173  }
174  }
Here is the call graph for this function:

◆ onPartial()

void org.turro.file.zul.control.RepositoryControl.onPartial ( )

Definition at line 147 of file RepositoryControl.java.

147  {
148  results.setPartial(partial.isChecked());
149  }
Here is the call graph for this function:

◆ onPaste()

void org.turro.file.zul.control.RepositoryControl.onPaste ( ) throws Exception

Definition at line 226 of file RepositoryControl.java.

226  {
227  FileClipboard.paste(currentFolder.getRealFolder());
228  treeFolder.setSelectedItem(currentFolder);
229  currentFolder.reloadContents();
230  fileGrid.setCurrentFolder(currentFolder);
231  paste.setDisabled(true);
232  }
Here is the call graph for this function:

◆ onRegexp()

void org.turro.file.zul.control.RepositoryControl.onRegexp ( )

Definition at line 137 of file RepositoryControl.java.

137  {
138  results.setRegexp(regexp.isChecked());
139  }
Here is the call graph for this function:

◆ onSearch()

void org.turro.file.zul.control.RepositoryControl.onSearch ( )

Definition at line 152 of file RepositoryControl.java.

152  {
153  treeFolder.reloadContents();
154  selectFirst();
155  }
Here is the call graph for this function:

◆ onSearchValue()

void org.turro.file.zul.control.RepositoryControl.onSearchValue ( )

Definition at line 132 of file RepositoryControl.java.

132  {
133  results.setSearchValue(searchValue.getValue());
134  }
void setSearchValue(String searchValue)
Here is the call graph for this function:

◆ onSelectFolder()

void org.turro.file.zul.control.RepositoryControl.onSelectFolder ( )

Definition at line 125 of file RepositoryControl.java.

125  {
126  currentFolder = treeFolder.getSelectedFolder();
127  updateButtons();
128  fileGrid.setCurrentFolder(currentFolder);
129  }
Here is the call graph for this function:

◆ onSend()

void org.turro.file.zul.control.RepositoryControl.onSend ( ) throws Exception

Definition at line 185 of file RepositoryControl.java.

185  {
186  SendAttachments sa = new SendAttachments(I_.get("Attachment")) {
187  @Override
188  protected void fillAttachment(File attachment, Object entity) {
189  try {
190  FileUtils.copyFile((File) entity, attachment);
191  } catch (IOException ex) {
192  Logger.getLogger(FileControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
193  }
194  }
195  };
196  RepositoryItem af = fileGrid.getCurrentFolder();
197  if(af != null) {
198  for(File file : af.getFiles()) {
199  sa.addAttachment(file, file.getName(), file.getName());
200  }
201  }
202  sa.sendAttachments(null);
203  }
Here is the call graph for this function:

◆ onUpload()

void org.turro.file.zul.control.RepositoryControl.onUpload ( UploadEvent  event) throws Exception

Definition at line 177 of file RepositoryControl.java.

177  {
178  if(currentFolder != null) {
179  currentFolder.addMedias(event.getMedias());
180  fileGrid.setCurrentFolder(currentFolder);
181  }
182  }
Here is the call graph for this function:

◆ selectFirst()

void org.turro.file.zul.control.RepositoryControl.selectFirst ( )

Definition at line 331 of file RepositoryControl.java.

331  {
332  currentFolder = treeFolder.selectFirst();
333  updateButtons();
334  fileGrid.setCurrentFolder(currentFolder);
335  }
Here is the caller graph for this function:

◆ setLabel()

void org.turro.file.zul.control.RepositoryControl.setLabel ( String  label)

Definition at line 292 of file RepositoryControl.java.

292  {
293  this.label = label;
294  }

◆ setPath()

void org.turro.file.zul.control.RepositoryControl.setPath ( String  path)

Definition at line 300 of file RepositoryControl.java.

300  {
301  this.path = path;
302  treeFolder.resetTree();
303  treeFolder.setPath(Strings.isBlank(path, "/"));
304  }

◆ setPublicOnly()

void org.turro.file.zul.control.RepositoryControl.setPublicOnly ( Boolean  publicOnly)

Definition at line 268 of file RepositoryControl.java.

268  {
269  this.publicOnly = publicOnly;
270  }

◆ setReadOnly()

void org.turro.file.zul.control.RepositoryControl.setReadOnly ( boolean  readOnly)

Definition at line 276 of file RepositoryControl.java.

276  {
277  this.readOnly = readOnly;
278  }

◆ setTreeCollapsed()

void org.turro.file.zul.control.RepositoryControl.setTreeCollapsed ( boolean  treeCollapsed)

Definition at line 284 of file RepositoryControl.java.

284  {
285  this.treeCollapsed = treeCollapsed;
286  }

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