/** * Displays the throwable on the error page and logs the error.<p> * * @param wp the workplace class * @param t the throwable to be displayed on the error page * * @throws JspException if the include of the error page jsp fails */ public void includeErrorpage(CmsWorkplace wp, Throwable t) throws JspException { CmsLog.getLog(wp).error(Messages.get().getBundle().key(Messages.ERR_WORKPLACE_DIALOG_0), t); getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, wp); getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, t); getJsp().include(FILE_DIALOG_SCREEN_ERRORPAGE); }
/** * Displays the throwable on the error page and logs the error.<p> * * @param wp the workplace class * @param t the throwable to be displayed on the error page * * @throws JspException if the include of the error page jsp fails */ public void includeErrorpage(CmsWorkplace wp, Throwable t) throws JspException { CmsLog.getLog(wp).error(Messages.get().getBundle().key(Messages.ERR_WORKPLACE_DIALOG_0), t); getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, wp); getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, t); getJsp().include(FILE_DIALOG_SCREEN_ERRORPAGE); }
/** * Returns the link URL to get back one folder in the administration view.<p> * * @return the link URL to get back one folder in the administration view */ protected String getAdministrationBackLink() { return CmsWorkplace.VFS_PATH_WORKPLACE + "action/administration_content_top.html" + "?sender=" + CmsResource.getParentFolder(getJsp().getRequestContext().getFolderUri()); }
/** * Returns the link URL to get back one folder in the administration view.<p> * * @return the link URL to get back one folder in the administration view */ protected String getAdministrationBackLink() { return CmsWorkplace.VFS_PATH_WORKPLACE + "action/administration_content_top.html" + "?sender=" + CmsResource.getParentFolder(getJsp().getRequestContext().getFolderUri()); }
/** * Returns the html code to build the header box.<p> * * @return html code * * @throws CmsException if something goes wrong */ public String buildLockHeaderBox() throws CmsException { StringBuffer html = new StringBuffer(512); // include resource info html.append(dialogBlockStart(null)); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_TITLE_0)); html.append(": "); html.append(getJsp().property("Title", getParamResource(), "")); html.append("<br>\n"); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_STATE_0)); html.append(": "); html.append(getState()); html.append("<br>\n"); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_PERMALINK_0)); html.append(": "); html.append(OpenCms.getLinkManager().getPermalink(getCms(), getParamResource())); html.append(dialogBlockEnd()); return html.toString(); }
/** * Returns the html code to build the header box.<p> * * @return html code * * @throws CmsException if something goes wrong */ public String buildLockHeaderBox() throws CmsException { StringBuffer html = new StringBuffer(512); // include resource info html.append(dialogBlockStart(null)); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_TITLE_0)); html.append(": "); html.append(getJsp().property("Title", getParamResource(), "")); html.append("<br>\n"); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_STATE_0)); html.append(": "); html.append(getState()); html.append("<br>\n"); html.append(key(org.opencms.workplace.commons.Messages.GUI_LABEL_PERMALINK_0)); html.append(": "); html.append(OpenCms.getLinkManager().getPermalink(getCms(), getParamResource())); html.append(dialogBlockEnd()); return html.toString(); }
/** * Builds the outer dialog window border.<p> * * @param segment the HTML segment (START / END) * @param attributes optional additional attributes for the opening dialog table * * @return a dialog window start / end segment */ public String dialog(int segment, String attributes) { if (segment == HTML_START) { StringBuffer html = new StringBuffer(512); if (useNewStyle()) { html.append(dialogTitle()); } html.append("<table class=\"dialog\" cellpadding=\"0\" cellspacing=\"0\""); if (attributes != null) { html.append(" "); html.append(attributes); } html.append("><tr><td>\n<table class=\"dialogbox\" cellpadding=\"0\" cellspacing=\"0\">\n"); html.append("<tr><td>\n"); if (useNewStyle() && getToolManager().hasToolPathForUrl(getJsp().getRequestContext().getUri())) { html.append(getAdminTool().groupHtml(this)); } return html.toString(); } else { return "</td></tr></table>\n</td></tr></table>\n<p> </p>\n"; } }
/** * Builds the outer dialog window border.<p> * * @param segment the HTML segment (START / END) * @param attributes optional additional attributes for the opening dialog table * * @return a dialog window start / end segment */ public String dialog(int segment, String attributes) { if (segment == HTML_START) { StringBuffer html = new StringBuffer(512); if (useNewStyle()) { html.append(dialogTitle()); } html.append("<table class=\"dialog\" cellpadding=\"0\" cellspacing=\"0\""); if (attributes != null) { html.append(" "); html.append(attributes); } html.append("><tr><td>\n<table class=\"dialogbox\" cellpadding=\"0\" cellspacing=\"0\">\n"); html.append("<tr><td>\n"); if (useNewStyle() && getToolManager().hasToolPathForUrl(getJsp().getRequestContext().getUri())) { html.append(getAdminTool().groupHtml(this)); } return html.toString(); } else { return "</td></tr></table>\n</td></tr></table>\n<p> </p>\n"; } }
/** * Returns the http URI of the current dialog, to be used * as value for the "action" attribute of a html form.<p> * * This URI could not be really the real one... <p> * * @return the http URI of the current dialog */ public String getDialogUri() { if (!useNewStyle()) { return getDialogRealUri(); } else { return CmsToolManager.linkForToolPath(getJsp(), getCurrentToolPath()); } }
/** * Returns the http URI of the current dialog, to be used * as value for the "action" attribute of a html form.<p> * * This URI could not be really the real one... <p> * * @return the http URI of the current dialog */ public String getDialogUri() { if (!useNewStyle()) { return getDialogRealUri(); } else { return CmsToolManager.linkForToolPath(getJsp(), getCurrentToolPath()); } }
public boolean doPreAction(CmsResource resource, CmsDialog dialog, String originalParams) throws Exception { String newlink = dialog.getJsp().getRequest().getParameter(CmsXmlContentEditor.PARAM_NEWLINK); if (CmsStringUtil.isNotEmpty(newlink)) { String folderPath = dialog.getSettings().getExplorerResource(); String resName = dialog.getJsp().getRequest().getParameter(CmsDialog.PARAM_RESOURCE); if (CmsStringUtil.isNotEmpty(resName)) { new String[] {dialog.getJsp().getRequest().getParameter("editortitle")}); String paramBackLink = dialog.getJsp().getRequest().getParameter(CmsEditor.PARAM_BACKLINK); if (CmsStringUtil.isNotEmpty(paramBackLink)) { params.put(CmsEditor.PARAM_BACKLINK, new String[] {paramBackLink});
CmsLock lockwp = new CmsLock(dialog.getJsp()); lockwp.setBlockingFilter(blockingFilter); lockwp.setNonBlockingFilter(nonBlockingFilter);
public boolean doPreAction(CmsResource resource, CmsDialog dialog, String originalParams) throws Exception { String newlink = dialog.getJsp().getRequest().getParameter(CmsXmlContentEditor.PARAM_NEWLINK); if (CmsStringUtil.isNotEmpty(newlink)) { String folderPath = dialog.getSettings().getExplorerResource(); String resName = dialog.getJsp().getRequest().getParameter(CmsDialog.PARAM_RESOURCE); if (CmsStringUtil.isNotEmpty(resName)) { params.put(CmsDialog.PARAM_TITLE, dialog.getJsp().getRequest().getParameter("editortitle")); String paramBackLink = dialog.getJsp().getRequest().getParameter(CmsEditor.PARAM_BACKLINK); if (CmsStringUtil.isNotEmpty(paramBackLink)) { params.put(CmsEditor.PARAM_BACKLINK, paramBackLink);
CmsLock lockwp = new CmsLock(getJsp()); lockwp.setBlockingFilter(blockingFilter); lockwp.setNonBlockingFilter(nonBlockingFilter);
try { JspWriter out = getJsp().getJspContext().getOut(); out.write("<html><head></head>\n"); out.write("<body onload=\"top.close();\">\n"); } catch (IOException e) { getJsp().include(FILE_EXPLORER_FILELIST, null, params); if (Boolean.valueOf(getParamRedirect()).booleanValue()) { getJsp().getResponse().sendRedirect(getParamCloseLink()); } else { CmsRequestUtil.forwardRequest( getParamCloseLink(), getJsp().getRequest(), getJsp().getResponse()); getJsp().include(frameUri, null, params); } else { getJsp().include(FILE_EXPLORER_FILELIST, null, params); getJsp().include(FILE_EXPLORER_FILELIST, null, params);
try { JspWriter out = getJsp().getJspContext().getOut(); out.write("<html><head></head>\n"); out.write("<body onload=\"top.close();\">\n"); } catch (IOException e) { getJsp().include(FILE_EXPLORER_FILELIST, null, params); JspWriter out = getJsp().getJspContext().getOut(); out.write( "<html><head><script type=\"text/javascript\">top.location.href=\"" getJsp().getResponse().sendRedirect(getParamCloseLink()); } else { CmsRequestUtil.forwardRequest( getParamCloseLink(), getJsp().getRequest(), getJsp().getResponse()); getJsp().include(frameUri, null, params); } else { getJsp().include(FILE_EXPLORER_FILELIST, null, params); getJsp().include(FILE_EXPLORER_FILELIST, null, params);
/** * Initializes the gallery dialog before redirecting.<p> * * @param wp the workplace object */ public static void initGallery(CmsDialog wp) { // 1. get "gallerytypename" by reading the folderpath String galleryTypeName = null; if (wp.useNewStyle()) { galleryTypeName = CmsResource.getName(CmsResource.getFolderPath(wp.getAdminTool().getHandler().getLink())); } else { galleryTypeName = CmsResource.getName(CmsResource.getFolderPath(wp.getJsp().getRequestContext().getUri())); } if (galleryTypeName.endsWith("/")) { galleryTypeName = galleryTypeName.substring(0, galleryTypeName.length() - 1); } if (!galleryTypeName.equals("commons")) { // 2. set in user settings wp.getSettings().setGalleryType(galleryTypeName); } }
/** * Initializes the gallery dialog before redirecting.<p> * * @param wp the workplace object */ public static void initGallery(CmsDialog wp) { // 1. get "gallerytypename" by reading the folderpath String galleryTypeName = null; if (wp.useNewStyle()) { galleryTypeName = CmsResource.getName(CmsResource.getFolderPath(wp.getAdminTool().getHandler().getLink())); } else { galleryTypeName = CmsResource.getName(CmsResource.getFolderPath(wp.getJsp().getRequestContext().getUri())); } if (galleryTypeName.endsWith("/")) { galleryTypeName = galleryTypeName.substring(0, galleryTypeName.length() - 1); } if (!galleryTypeName.equals("commons")) { // 2. set in user settings wp.getSettings().setGalleryType(galleryTypeName); } }