KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > deprecated > taglibs > field > file > FileDescriptionTag


1 package org.jahia.deprecated.taglibs.field.file;
2
3 import javax.servlet.ServletRequest JavaDoc;
4 import javax.servlet.jsp.JspException JavaDoc;
5
6 import org.jahia.data.JahiaData;
7 import org.jahia.gui.GuiBean;
8
9
10 /**
11  * Class FileDescriptionTag : displays the description of the current file field;
12  * This tag must be enclosed in the FileFieldTag.
13  *
14  * @author Jerome Tamiotti
15  */

16 public class FileDescriptionTag extends FileFieldAbstract {
17
18     private int maxchar = 0;
19
20     public void setMaxchar(int maxchar) {
21         this.maxchar = maxchar;
22     }
23
24     public String JavaDoc getField() {
25
26         ServletRequest JavaDoc request = pageContext.getRequest();
27         JahiaData jData = (JahiaData) request.getAttribute("org.jahia.data.JahiaData");
28         if (this.maxchar == 0) {
29             this.maxchar = theFile.getDescr().length();
30         }
31         return GuiBean.glueTitle(theFile.getDescr(), this.maxchar);
32     }
33
34     public int doEndTag() throws JspException JavaDoc {
35         // let's reinitialize the tag variables to allow tag object reuse in
36
// pooling.
37
super.doEndTag();
38         maxchar = 0;
39         return EVAL_PAGE;
40     }
41
42
43 }
44
45
Popular Tags