/** * Public constructor with JSP action element.<p> * * @param jsp an initialized JSP action element */ public CmsEditorSelector(CmsJspActionElement jsp) { setJsp(jsp); setParamResource(jsp.getRequest().getParameter(CmsDialog.PARAM_RESOURCE)); }
/** * Returns the uri of the dialog which will be displayed.<p> * * @return the uri of the property dialog */ public String getSelectedEditorUri() { // get the handler class from the OpenCms runtime property I_CmsEditorHandler editorClass = OpenCms.getWorkplaceManager().getEditorHandler(); // the resourcenameparameter could be encoded, so decode it String resource = getParamResource(); resource = CmsEncoder.unescape(resource, CmsEncoder.ENCODING_UTF_8); if (editorClass == null) { // error getting the dialog class, return to file list return CmsWorkplace.FILE_EXPLORER_FILELIST; } // get the dialog URI from the class defined in the configuration String editorUri = null; try { editorUri = editorClass.getEditorUri(resource, getJsp()); if (editorUri == null) { // no valid editor was found, show the error dialog throw new CmsWorkplaceException(Messages.get().container(Messages.ERR_NO_EDITOR_FOUND_0)); } } catch (CmsException e) { showErrorDialog(getJsp(), e); } return editorUri; }
/** * Returns the uri of the dialog which will be displayed.<p> * * @return the uri of the property dialog */ public String getSelectedEditorUri() { // get the handler class from the OpenCms runtime property I_CmsEditorHandler editorClass = OpenCms.getWorkplaceManager().getEditorHandler(); // the resourcenameparameter could be encoded, so decode it String resource = getParamResource(); resource = CmsEncoder.unescape(resource, CmsEncoder.ENCODING_UTF_8); if (editorClass == null) { // error getting the dialog class, return to file list return CmsWorkplace.FILE_EXPLORER_FILELIST; } // get the dialog URI from the class defined in the configuration String editorUri = null; try { editorUri = editorClass.getEditorUri(resource, getJsp()); if (editorUri == null) { // no valid editor was found, show the error dialog throw new CmsWorkplaceException(Messages.get().container(Messages.ERR_NO_EDITOR_FOUND_0)); } } catch (CmsException e) { showErrorDialog(getJsp(), e); } return editorUri; }
/** * Public constructor with JSP action element.<p> * * @param jsp an initialized JSP action element */ public CmsEditorSelector(CmsJspActionElement jsp) { setJsp(jsp); setParamResource(jsp.getRequest().getParameter(CmsDialog.PARAM_RESOURCE)); }