/** * 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; }
/** * 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; }