/** * Returns if the dialog is called in direct edit mode before the editor is opened.<p> * * @return true if the dialog is called in direct edit mode before the editor is opened */ public boolean isPreEditor() { return CmsPreEditorAction.isPreEditorMode(this); }
/** * Forwards to the editor and opens it after the action was performed.<p> * * @param dialog the dialog instance forwarding to the editor */ public static void sendForwardToEditor(CmsDialog dialog) { sendForwardToEditor(dialog, null); }
/** * Returns if an action has to be performed before opening the editor depending on the resource to edit * and request parameter values.<p> * * @return true if an action has to be performed, then the editor frameset is not generated */ public boolean doPreAction() { String resourceName = getParamResource(); try { boolean preActionDone = Boolean.valueOf(getParamPreActionDone()).booleanValue(); if (!preActionDone) { // pre editor action not executed yet now check if a pre action class is given for the resource type CmsResource resource = getCms().readResource(resourceName, CmsResourceFilter.ALL); I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource.getTypeId()); I_CmsPreEditorActionDefinition preAction = OpenCms.getWorkplaceManager().getPreEditorConditionDefinition( type); if (preAction != null) { return preAction.doPreAction(resource, this, getOriginalParams()); } } } catch (Exception e) { // log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } // nothing to be done as pre action, open the editor return false; }
if (CmsPreEditorAction.isPreEditorMode(this)) { CmsPreEditorAction.sendForwardToEditor(this, params); } else {
/** * Returns the original request parameters for the editor to pass to the pre editor action dialog.<p> * * @return the original request parameters for the editor */ public String getOriginalParams() { if (m_originalParams == null) { m_originalParams = CmsEncoder.decode(CmsRequestUtil.encodeParams(getJsp().getRequest())); } return m_originalParams; }
/** * Checks that the current user is a workplace user.<p> * * @throws CmsRoleViolationException if the user does not have the required role */ @Override protected void checkRole() throws CmsRoleViolationException { OpenCms.getRoleManager().checkRole(getCms(), CmsRole.EDITOR); }
/** * Returns if an action has to be performed before opening the editor depending on the resource to edit * and request parameter values.<p> * * @return true if an action has to be performed, then the editor frameset is not generated */ public boolean doPreAction() { String resourceName = getParamResource(); try { boolean preActionDone = Boolean.valueOf(getParamPreActionDone()).booleanValue(); if (!preActionDone) { // pre editor action not executed yet now check if a pre action class is given for the resource type CmsResource resource = getCms().readResource(resourceName, CmsResourceFilter.ALL); I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource.getTypeId()); I_CmsPreEditorActionDefinition preAction = OpenCms.getWorkplaceManager().getPreEditorConditionDefinition(type); if (preAction != null) { return preAction.doPreAction(resource, this, getOriginalParams()); } } } catch (Exception e) { // log error if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } // nothing to be done as pre action, open the editor return false; }
if (CmsPreEditorAction.isPreEditorMode(this)) { CmsPreEditorAction.sendForwardToEditor(this, params); } else {
/** * Returns the original request parameters for the editor to pass to the pre editor action dialog.<p> * * @return the original request parameters for the editor */ public String getOriginalParams() { if (m_originalParams == null) { m_originalParams = CmsEncoder.decode(CmsRequestUtil.encodeParams(getJsp().getRequest())); } return m_originalParams; }
/** * Returns if the dialog is called in direct edit mode before the editor is opened.<p> * * @return true if the dialog is called in direct edit mode before the editor is opened */ public boolean isPreEditor() { return CmsPreEditorAction.isPreEditorMode(this); }
/** * Forwards to the editor and opens it after the action was performed.<p> * * @param dialog the dialog instance forwarding to the editor */ public static void sendForwardToEditor(CmsDialog dialog) { sendForwardToEditor(dialog, null); }
/** * The buttons in the new resource dialog depend on various preconditions.<p> * * Variations: * <ul> * <li>dialog is opened in direct edit mode</li> * <li>"edit properties" has been selected or not</li> * </ul> * * @see org.opencms.workplace.list.A_CmsSelectResourceList#dialogButtons() */ @Override public String dialogButtons() { if (Boolean.valueOf(getParamNewResourceEditProps()).booleanValue() || CmsPreEditorAction.isPreEditorMode(this)) { // show next button, after that the properties are edited return dialogButtons(new int[] {BUTTON_NEXT, BUTTON_CANCEL}, new String[] {"", ""}); } return dialogButtons(new int[] {BUTTON_FINISH, BUTTON_CANCEL}, new String[] {"", ""}); }
/** * The buttons in the new resource dialog depend on various preconditions.<p> * * Variations: * <ul> * <li>dialog is opened in direct edit mode</li> * <li>"edit properties" has been selected or not</li> * </ul> * * @see org.opencms.workplace.list.A_CmsSelectResourceList#dialogButtons() */ @Override public String dialogButtons() { if (Boolean.valueOf(getParamNewResourceEditProps()).booleanValue() || CmsPreEditorAction.isPreEditorMode(this)) { // show next button, after that the properties are edited return dialogButtons(new int[] {BUTTON_NEXT, BUTTON_CANCEL}, new String[] {"", ""}); } return dialogButtons(new int[] {BUTTON_FINISH, BUTTON_CANCEL}, new String[] {"", ""}); }