BrightSide Workbench Full Report + Source Code
org.turro.attach.zul.tree.AttachFile Class Reference
Inheritance diagram for org.turro.attach.zul.tree.AttachFile:
Collaboration diagram for org.turro.attach.zul.tree.AttachFile:

Public Member Functions

 AttachFile (Attachment attachment, Set< AttachColumn > columns)
 
void afterCompose ()
 
 AttachFile (String label, Object value)
 
 AttachFile (String label)
 
 AttachFile ()
 
AttachTree getTree ()
 
void doDownload ()
 
void doEdit ()
 
void doDelete () throws InterruptedException
 
Attachment getAttachment ()
 

Detailed Description

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

Definition at line 54 of file AttachFile.java.

Constructor & Destructor Documentation

◆ AttachFile() [1/4]

org.turro.attach.zul.tree.AttachFile.AttachFile ( Attachment  attachment,
Set< AttachColumn columns 
)

Definition at line 60 of file AttachFile.java.

60  {
61  super();
62  this.attachment = attachment;
63  this.columns = columns;
64  }

◆ AttachFile() [2/4]

org.turro.attach.zul.tree.AttachFile.AttachFile ( String  label,
Object  value 
)

Definition at line 72 of file AttachFile.java.

72  {
73  throw new UnsupportedOperationException("Do not use");
74  }

◆ AttachFile() [3/4]

org.turro.attach.zul.tree.AttachFile.AttachFile ( String  label)

Definition at line 76 of file AttachFile.java.

76  {
77  throw new UnsupportedOperationException("Do not use");
78  }

◆ AttachFile() [4/4]

org.turro.attach.zul.tree.AttachFile.AttachFile ( )

Definition at line 80 of file AttachFile.java.

80  {
81  throw new UnsupportedOperationException("Do not use");
82  }

Member Function Documentation

◆ afterCompose()

void org.turro.attach.zul.tree.AttachFile.afterCompose ( )

Definition at line 67 of file AttachFile.java.

67  {
68  addCells(columns);
69  setImage(getMimeImage());
70  }
Here is the caller graph for this function:

◆ doDelete()

void org.turro.attach.zul.tree.AttachFile.doDelete ( ) throws InterruptedException

Definition at line 134 of file AttachFile.java.

134  {
135  ZkossUtils.confirmDeletion(null, new Command() {
136  @Override
137  public Object execute(Context context) {
138  new AttachPU().deleteObject(attachment);
139  if(getTree().getAttachListener() != null) {
141  }
142  TagItCtrl tagIt = Plugins.loadImplementation(TagItCtrl.class, "button");//(TagItCtrl) PluginChecker.get("tagitctrl");
143  tagIt.setEntity(attachment);
144  tagIt.deleteEntity();
145  detach();
146  return true;
147  }
148  });
149  }
Here is the call graph for this function:

◆ doDownload()

void org.turro.attach.zul.tree.AttachFile.doDownload ( )

Definition at line 89 of file AttachFile.java.

89  {
90  try(DaoTransaction transaction = new DaoTransaction(new AttachPU())) {
91  attachment = transaction.saveObject(attachment);
92  Filedownload.save(attachment.getAttachContent().getFileContent(), attachment.getFileContentType(), attachment.getFileName());
93  if(getTree().getAttachListener() != null) {
95  }
96  SystemLogger.getInstance().doLog(SystemLogType.LOG_INFO, attachment, "downloaded", null);
97  }
98  }
Here is the call graph for this function:

◆ doEdit()

void org.turro.attach.zul.tree.AttachFile.doEdit ( )

Definition at line 100 of file AttachFile.java.

100  {
101  InputDialog.getInput(
102  getPage(),
103  I_.get("Attachment") + " " + attachment.getId(),
104  new InputField[] {
105  new InputField("Name", attachment.getFileName(), null, 0),
106  new InputField("Comment", attachment.getComment(), null, 3),
107  new InputField("Show key", attachment.getShowKey(), null, 0),
108  new InputField("Validated", attachment.isValidated(), null, 0)
109  }, new Command() {
110  @Override
111  public Object execute(Context context) {
112  InputField[] fields = (InputField[]) context.get("fields");
113  if(fields.length > 0) {
114  for(InputField f : fields) {
115  if("Name".equals(f.getLabel())) {
116  attachment.setFileName((String) f.getValue());
117  } else if("Comment".equals(f.getLabel())) {
118  attachment.setComment((String) f.getValue());
119  } else if("Show key".equals(f.getLabel())) {
120  attachment.setShowKey((String) f.getValue());
121  } else if("Validated".equals(f.getLabel())) {
122  attachment.setValidated((Boolean) f.getValue());
123  }
124  }
125  attachment = new AttachPU().saveObject(attachment);
126  addCells(getTree().getColumns());
127  setImage(getMimeImage());
128  }
129  return null;
130  }
131  });
132  }
void setShowKey(String showKey)
void setValidated(boolean validated)
void setComment(String comment)
void setFileName(String fileName)
Here is the call graph for this function:

◆ getAttachment()

Attachment org.turro.attach.zul.tree.AttachFile.getAttachment ( )

Definition at line 151 of file AttachFile.java.

151  {
152  return attachment;
153  }

◆ getTree()

AttachTree org.turro.attach.zul.tree.AttachFile.getTree ( )

Definition at line 85 of file AttachFile.java.

85  {
86  return (AttachTree) super.getTree();
87  }
Here is the caller graph for this function:

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