/** * Constructor used when using <code>contentloop</code> from scriptlet code.<p> * * @param container the parent content container that provides the content element to loop * @param element the element to loop in the content */ public CmsJspTagContentLoop(I_CmsXmlContentContainer container, String element) { m_element = element; init(container); }
/** * Constructor used when using <code>contentloop</code> from scriptlet code.<p> * * @param container the parent content container that provides the content element to loop * @param element the element to loop in the content */ public CmsJspTagContentLoop(I_CmsXmlContentContainer container, String element) { m_element = element; init(container); }
/** * @see javax.servlet.jsp.tagext.Tag#doStartTag() */ @Override public int doStartTag() throws JspException { // get a reference to the parent "content container" class Tag ancestor = findAncestorWithClass(this, I_CmsXmlContentContainer.class); if (ancestor == null) { CmsMessageContainer errMsgContainer = Messages.get().container(Messages.ERR_PARENTLESS_TAG_1, "contentloop"); String msg = Messages.getLocalizedMessage(errMsgContainer, pageContext); throw new JspTagException(msg); } I_CmsXmlContentContainer container = (I_CmsXmlContentContainer)ancestor; // initialize the content init(container); if (hasMoreContent()) { // selected element is available at last once in content return EVAL_BODY_INCLUDE; } else { // no value available for the selected element name, so we skip the whole body return SKIP_BODY; } }
/** * @see javax.servlet.jsp.tagext.Tag#doStartTag() */ @Override public int doStartTag() throws JspException { // get a reference to the parent "content container" class Tag ancestor = findAncestorWithClass(this, I_CmsXmlContentContainer.class); if (ancestor == null) { CmsMessageContainer errMsgContainer = Messages.get().container( Messages.ERR_PARENTLESS_TAG_1, "contentloop"); String msg = Messages.getLocalizedMessage(errMsgContainer, pageContext); throw new JspTagException(msg); } I_CmsXmlContentContainer container = (I_CmsXmlContentContainer)ancestor; // initialize the content init(container); if (hasMoreResources()) { // selected element is available at last once in content return EVAL_BODY_INCLUDE; } else { // no value available for the selected element name, so we skip the whole body return SKIP_BODY; } }