public int doStartTag() throws JspException { if (isEditableRequest(pageContext.getRequest())) { I_CmsDirectEditProvider eb = getDirectEditProvider(pageContext); editableTagAction(pageContext, m_provider, m_mode, m_file); insertEditEmpty(); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e);
/** * Inserts the closing direct edit tag.<p> * * @param pageContext the page context */ public static void insertDirectEditEnd(PageContext pageContext) { try { CmsJspTagEditable.endDirectEdit(pageContext); } catch (JspException e) { LOG.error("Could not print closing direct edit tag.", e); } }
/** * Close the direct edit tag, also prints the direct edit HTML to the current page.<p> * * @return {@link #EVAL_PAGE} * * @throws JspException in case something goes wrong */ @Override public int doEndTag() throws JspException { if (m_firstOnPage || m_manualPlacement) { // only execute action for the first "editable" tag on the page (include file), or in manual mode editableTagAction(pageContext, m_provider, m_mode, m_file); } if (OpenCms.getSystemInfo().getServletContainerSettings().isReleaseTagsAfterEnd()) { // need to release manually, JSP container may not call release as required (happens with Tomcat) release(); } return EVAL_PAGE; }
/** * Inserts direct edit for empty collector lists.<p> * * @throws CmsException in case of invalid collector settings * @throws JspException in case writing to page context fails */ private void insertEditEmpty() throws CmsException, JspException { Tag ancestor = findAncestorWithClass(this, I_CmsXmlContentContainer.class); I_CmsXmlContentContainer container = null; if (ancestor != null) { // parent content container available, use preloaded values from this container container = (I_CmsXmlContentContainer)ancestor; insertEditEmpty(pageContext, container, m_mode == null ? CmsDirectEditMode.AUTO : m_mode, null); } } }
/** * Includes the "direct edit" start element that adds HTML for the editable area to * the output page.<p> * * @param context the current JSP page context * @param params the direct edit parameters * * @return <code>true</code> in case a direct edit element has been opened * * @throws JspException in case something goes wrong */ public static boolean startDirectEdit(PageContext context, CmsDirectEditParams params) throws JspException { // get the direct edit bean from the context I_CmsDirectEditProvider eb = getDirectEditProvider(context); boolean result = false; if (eb != null) { // the direct edit bean must be available if (eb.isManual(params.getMode())) { // store the given parameters for the next manual call setDirectEditProviderParams(context, params); } else { // automatic mode, insert direct edit HTML result = eb.insertDirectEditStart(context, params); } } return result; }
if ((mode == CmsDirectEditMode.FALSE) || !isEditableRequest(req)) { I_CmsDirectEditProvider eb = getDirectEditProvider(context); if (eb == null) { if (CmsStringUtil.isNotEmpty(fileName) && CmsStringUtil.isEmpty(provider)) { setDirectEditProvider(context, eb); CmsDirectEditParams params = getDirectEditProviderParams(context); if (params != null) {
info.setCollectorParams(m_collectorParam); info.setId(m_contentInfoBean.getId()); if (CmsJspTagEditable.getDirectEditProvider(pageContext) != null) { CmsJspTagEditable.getDirectEditProvider(pageContext).insertDirectEditListMetadata( pageContext, info); if (!hasMoreContent && m_editEmpty && (m_directEditLinkForNew != null)) { try { CmsJspTagEditable.insertEditEmpty(pageContext, this, m_directEditMode, m_contentInfoBean.getId()); } catch (CmsException e) { throw new JspException(e); if (m_directEditOpen) { CmsJspTagEditable.endDirectEdit(pageContext); m_directEditOpen = false; params.setCollectorName(m_collectorName); params.setCollectorParams(m_param); m_directEditOpen = CmsJspTagEditable.startDirectEdit(pageContext, params);
/** * Insert the start HTML for the direct edit buttons in manual mode.<p> * * Same as opening the <code><cms:editable mode="manual"></code> tag.<p> * * @return <code>true</code> if HTML was inserted that needs to be closed * * @throws JspException if something goes wrong */ public boolean editableManualOpen() throws JspException { boolean result = false; if (!CmsFlexController.isCmsOnlineRequest(getJspContext().getRequest())) { // all this does NOT apply to the "online" project I_CmsDirectEditProvider eb = CmsJspTagEditable.getDirectEditProvider(getJspContext()); if ((eb != null)) { // check if the provider support manual placement of buttons if (eb.isManual(CmsDirectEditMode.MANUAL)) { // the provider supports manual placement of buttons result = true; CmsJspTagEditable.editableTagAction(getJspContext(), null, CmsDirectEditMode.MANUAL, null); } } } return result; }
if (m_directEditOpen) { CmsJspTagEditable.endDirectEdit(pageContext); m_directEditOpen = false; m_directEditOpen = CmsJspTagEditable.startDirectEdit(pageContext, new CmsDirectEditParams( m_resourceName, directEditButtons,
I_CmsDirectEditProvider eb = getDirectEditProvider(context); if (eb == null) { if (CmsStringUtil.isNotEmpty(fileName) && CmsStringUtil.isEmpty(provider)) { setDirectEditProvider(context, eb); CmsDirectEditParams params = getDirectEditProviderParams(context); if (params != null) {
/** * Insert the end HTML for the direct edit buttons in manual mode (if required).<p> * * Same as closing the <code></cms:editable</code> tag after opening one in manual mode.<p> * * @param needsClose result of {@link #editableManualOpen()} should be the value for this parameter * * @throws JspException if something goes wrong */ public void editableManualClose(boolean needsClose) throws JspException { if (needsClose) { CmsJspTagEditable.editableTagAction(getJspContext(), null, CmsDirectEditMode.MANUAL, null); } }
/** * Closes the current direct edit element.<p> * * @param context the current JSP page context * * @throws JspException in case something goes wrong */ public static void endDirectEdit(PageContext context) throws JspException { // get the direct edit bean from the context I_CmsDirectEditProvider eb = getDirectEditProvider(context); if (eb != null) { // the direct edit bean must be available eb.insertDirectEditEnd(context); } }
if (isEditableRequest(req) && (container.getCollectorResult() != null) && (container.getCollectorResult().size() == 0)) { params.setCollectorName(container.getCollectorName()); params.setCollectorParams(container.getCollectorParam()); getDirectEditProvider(context).insertDirectEditEmptyList(context, params);
CmsJspTagEditable.setDirectEditProvider(context, eb);
editParams.setPostCreateHandler(postCreateHandler); try { CmsJspTagEditable.startDirectEdit(pageContext, editParams); result = true; } catch (JspException e) {
/** * Insert the start HTML for the direct edit buttons in manual mode.<p> * * Same as opening the <code><cms:editable mode="manual"></code> tag.<p> * * @return <code>true</code> if HTML was inserted that needs to be closed * * @throws JspException if something goes wrong */ public boolean editableManualOpen() throws JspException { boolean result = false; if (!CmsFlexController.isCmsOnlineRequest(getJspContext().getRequest())) { // all this does NOT apply to the "online" project I_CmsDirectEditProvider eb = CmsJspTagEditable.getDirectEditProvider(getJspContext()); if ((eb != null)) { // check if the provider support manual placement of buttons if (eb.isManual(CmsDirectEditMode.MANUAL)) { // the provider supports manual placement of buttons result = true; CmsJspTagEditable.editableTagAction(getJspContext(), null, CmsDirectEditMode.MANUAL, null); } } } return result; }
&& CmsJspTagEditable.startDirectEdit(context, new CmsDirectEditParams(target, element)); CmsJspTagEditable.endDirectEdit(context);
/** * Insert the end HTML for the direct edit buttons in manual mode (if required).<p> * * Same as closing the <code></cms:editable</code> tag after opening one in manual mode.<p> * * @param needsClose result of {@link #editableManualOpen()} should be the value for this parameter * * @throws JspException if something goes wrong */ public void editableManualClose(boolean needsClose) throws JspException { if (needsClose) { CmsJspTagEditable.editableTagAction(getJspContext(), null, CmsDirectEditMode.MANUAL, null); } }
/** * Includes the "direct edit" start element that adds HTML for the editable area to * the output page.<p> * * @param context the current JSP page context * @param params the direct edit parameters * * @return <code>true</code> in case a direct edit element has been opened * * @throws JspException in case something goes wrong */ public static boolean startDirectEdit(PageContext context, CmsDirectEditParams params) throws JspException { // get the direct edit bean from the context I_CmsDirectEditProvider eb = getDirectEditProvider(context); boolean result = false; if (eb != null) { // the direct edit bean must be available if (eb.isManual(params.getMode())) { // store the given parameters for the next manual call setDirectEditProviderParams(context, params); } else { // automatic mode, insert direct edit HTML result = eb.insertDirectEditStart(context, params); } } return result; }
/** * Closes the current direct edit element.<p> * * @param context the current JSP page context * * @throws JspException in case something goes wrong */ public static void endDirectEdit(PageContext context) throws JspException { // get the direct edit bean from the context I_CmsDirectEditProvider eb = getDirectEditProvider(context); if (eb != null) { // the direct edit bean must be available eb.insertDirectEditEnd(context); } }