1 10 package org.mmbase.bridge.jsp.taglib.edit; 11 12 import javax.servlet.jsp.JspTagException ; 13 14 import org.mmbase.bridge.*; 15 import org.mmbase.bridge.jsp.taglib.NodeTag; 16 import org.mmbase.bridge.jsp.taglib.util.Attribute; 17 import org.mmbase.util.logging.*; 18 19 26 27 public class CreateNodeTag extends NodeTag { 28 29 private static final Logger log = Logging.getLoggerInstance(CreateNodeTag.class); 30 31 private Attribute nodeManager = Attribute.NULL; 32 33 public void setType(String t) throws JspTagException { 34 nodeManager = getAttribute(t); 35 } 36 37 public int doStartTag() throws JspTagException { 38 Cloud cloud = getCloudVar(); 39 NodeManager nm = cloud.getNodeManager(nodeManager.getString(this)); 40 if (nm == null) { 41 throw new JspTagException ("Could not find nodemanager " + nodeManager.getString(this)); 42 } 43 Node node = nm.createNode(); 44 if (node == null) { 45 throw new JspTagException ("Could not create node of type " + nm.getName()); 46 } 47 48 setNodeVar(node); 49 fillVars(); 50 return EVAL_BODY_BUFFERED; 51 } 52 53 54 } 55 | Popular Tags |