/** * Returns an initialized CmsDialog instance that is read from the request attributes.<p> * * This method is used by dialog elements. * The dialog elements do not initialize their own workplace class, * but use the initialized instance of the "master" class. * This is required to ensure that parameters of the "master" class * can properly be kept on the dialog elements.<p> * * To prevent null pointer exceptions, an empty dialog is returned if * nothing is found in the request attributes.<p> * * @param context the JSP page context * @param req the JSP request * @param res the JSP response * * @return an initialized CmsDialog instance that is read from the request attributes */ public static CmsDialog initCmsDialog(PageContext context, HttpServletRequest req, HttpServletResponse res) { CmsDialog wp = (CmsDialog)req.getAttribute(CmsWorkplace.SESSION_WORKPLACE_CLASS); if (wp == null) { // ensure that we don't get null pointers if the page is directly called wp = new CmsDialog(new CmsJspActionElement(context, req, res)); wp.fillParamValues(req); } return wp; }
/** * Returns an initialized CmsDialog instance that is read from the request attributes.<p> * * This method is used by dialog elements. * The dialog elements do not initialize their own workplace class, * but use the initialized instance of the "master" class. * This is required to ensure that parameters of the "master" class * can properly be kept on the dialog elements.<p> * * To prevent null pointer exceptions, an empty dialog is returned if * nothing is found in the request attributes.<p> * * @param context the JSP page context * @param req the JSP request * @param res the JSP response * * @return an initialized CmsDialog instance that is read from the request attributes */ public static CmsDialog initCmsDialog(PageContext context, HttpServletRequest req, HttpServletResponse res) { CmsDialog wp = (CmsDialog)req.getAttribute(CmsWorkplace.SESSION_WORKPLACE_CLASS); if (wp == null) { // ensure that we don't get null pointers if the page is directly called wp = new CmsDialog(new CmsJspActionElement(context, req, res)); wp.fillParamValues(req); } return wp; }
CmsDialog wp = new CmsDialog(null); return wp.buildSelect(attributes, options, values, selectedIndex);
/** * Shows the error dialog when no valid editor is found and returns null for the editor URI.<p> * * @param jsp the instantiated CmsJspActionElement * @param t a throwable object, can be null */ private static void showErrorDialog(CmsJspActionElement jsp, Throwable t) { CmsDialog wp = new CmsDialog(jsp); wp.setParamMessage(Messages.get().getBundle(wp.getLocale()).key(Messages.ERR_NO_EDITOR_FOUND_0)); wp.fillParamValues(jsp.getRequest()); try { wp.includeErrorpage(wp, t); } catch (JspException e) { LOG.debug( org.opencms.workplace.commons.Messages.get().getBundle().key( org.opencms.workplace.commons.Messages.LOG_ERROR_INCLUDE_FAILED_1, CmsWorkplace.FILE_DIALOG_SCREEN_ERRORPAGE), e); } }
/** * Shows the error dialog when no valid editor is found and returns null for the editor URI.<p> * * @param jsp the instantiated CmsJspActionElement * @param t a throwable object, can be null */ private static void showErrorDialog(CmsJspActionElement jsp, Throwable t) { CmsDialog wp = new CmsDialog(jsp); wp.setParamMessage(Messages.get().getBundle(wp.getLocale()).key(Messages.ERR_NO_EDITOR_FOUND_0)); wp.fillParamValues(jsp.getRequest()); try { wp.includeErrorpage(wp, t); } catch (JspException e) { LOG.debug(org.opencms.workplace.commons.Messages.get().getBundle().key( org.opencms.workplace.commons.Messages.LOG_ERROR_INCLUDE_FAILED_1, CmsWorkplace.FILE_DIALOG_SCREEN_ERRORPAGE), e); } }