1 package com.dotmarketing.taglibs; 2 3 import javax.servlet.jsp.JspException ; 4 import javax.servlet.jsp.tagext.BodyTagSupport ; 5 import com.dotmarketing.util.Logger; 6 import com.dotmarketing.util.UtilMethods; 7 8 public class HTMLBoxTag extends BodyTagSupport { 9 10 private static final long serialVersionUID = 1L; 11 private String _bodyContent; 12 private String tableId; 13 private String tableCaption; 14 15 16 public int doStartTag() throws JspException { 17 return EVAL_BODY_BUFFERED; 18 } 19 20 public int doAfterBody() { 21 _bodyContent = getBodyContent().getString(); 22 23 return SKIP_BODY; 24 } 25 26 public int doEndTag() throws JspException { 27 28 java.io.Writer out = pageContext.getOut(); 29 30 try { 31 32 if (UtilMethods.isSet(tableId)) { 33 out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\" id=\"" + tableId + "\">\n"); 34 } 35 else { 36 out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\">\n"); 37 } 38 if (UtilMethods.isSet(tableCaption)) { 39 out.write ("<caption><font class=\"bg\" size=\"2\"><B>" + tableCaption + "</b></font></caption>"); 40 } 41 out.write("<tr><td valign=\"top\"><img SRC=\"/portal/images/top_corner.gif\"></td>\n"); 42 out.write("<td background=\"/portal/images/line_top.gif\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"8\"></td>\n"); 43 out.write("<td bgcolor=\"#9D9DA1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td></tr>\n"); 44 out.write("<tr><td background=\"/portal/images/side_bg.gif\"></td><td width=\"100%\">\n"); 45 46 out.write(_bodyContent); 47 48 out.write("</td><td bgcolor=\"#9D9DA1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td></tr>\n"); 49 out.write("<tr><td bgcolor=\"#9D9DA1\" height=\"1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td>\n"); 50 out.write("<td bgcolor=\"#9D9DA1\" height=\"1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td>\n"); 51 out.write("<td bgcolor=\"#9D9DA1\" height=\"1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td>\n"); 52 out.write("</tr></table>\n"); 53 54 } 55 catch (Exception e) { 56 Logger.warn(this, e.toString(), e); 57 } 58 59 return EVAL_PAGE; 60 } 61 62 63 64 68 public String getTableId() { 69 return tableId; 70 } 71 72 76 public void setTableId(String tableId) { 77 this.tableId = tableId; 78 } 79 80 public String getTableCaption() { 81 return tableCaption; 82 } 83 public void setTableCaption(String tableCaption) { 84 this.tableCaption = tableCaption; 85 } 86 } 87 | Popular Tags |