1 10 package org.mmbase.bridge.jsp.taglib.pageflow; 11 12 import org.mmbase.bridge.jsp.taglib.util.Attribute; 13 import javax.servlet.jsp.JspTagException ; 14 15 import org.mmbase.util.logging.Logger; 16 import org.mmbase.util.logging.Logging; 17 18 29 30 public class TreeIncludeTag extends IncludeTag { 31 32 private static final Logger log = Logging.getLoggerInstance(TreeIncludeTag.class.getName()); 33 protected Attribute objectList = Attribute.NULL; 34 private TreeHelper th = new TreeHelper(); 35 36 public int doStartTag() throws JspTagException { 37 if (objectList == Attribute.NULL) { 38 throw new JspTagException ("Attribute 'objectlist' was not specified"); 39 } 40 return super.doStartTag(); 41 } 42 43 protected String getPage() throws JspTagException { 44 String orgPage = super.getPage(); 45 String treePage = th.findTreeFile(orgPage, objectList.getString(this), pageContext.getSession()); 46 if (log.isDebugEnabled()) { 47 log.debug("Retrieving page '" + treePage + "'"); 48 } 49 50 if (treePage == null || "".equals(treePage)) { 51 throw new JspTagException ("Could not find page " + orgPage); 52 } 53 54 return treePage; 55 } 56 57 public void doAfterBodySetValue() throws JspTagException { 58 th.setCloud(getCloudVar()); 60 61 includePage(); 63 } 64 65 public void doFinally() { 66 th.doFinally(); 67 super.doFinally(); 68 } 69 70 public void setObjectlist(String p) throws JspTagException { 71 objectList = getAttribute(p); 72 } 73 74 protected String getUrl(boolean writeamp, boolean encode) throws JspTagException { 75 String url = ""; 76 try { 77 url = super.getUrl(writeamp, encode); 78 } catch (JspTagException e) { 79 if (!notFound.getString(this).equals("skip")) { 80 throw(e); 81 } 82 } 83 return url; 84 } 85 86 protected boolean doMakeRelative() { 88 log.debug("doMakeRelative() overridden!"); 89 return false; 90 } 91 } 92 | Popular Tags |