params.append(editor.getParamResource()); params.append("&action="); params.append(CmsDialog.DIALOG_CONFIRMED); params.append(CmsEncoder.escapeWBlanks(editor.key(Messages.GUI_MESSAGEBOX_TITLE_PUBLISHRESOURCE_0) + ": " + editor.getParamResource(), CmsEncoder.ENCODING_UTF_8)); params.append("&").append(CmsDialog.PARAM_REDIRECT).append("=").append(CmsStringUtil.TRUE); params.append("&closelink="); linkTarget = jsp.link(editor.getParamBacklink()); } else { linkTarget = jsp.link(editor.getParamResource());
if (actionClass != null) { url = actionClass.getButtonUrl(getJsp(), getParamResource()); name = actionClass.getButtonName(); active = actionClass.isButtonActive(getJsp(), getParamResource()); } else {
if (actionClass != null) { url = actionClass.getButtonUrl(getJsp(), getParamResource()); name = actionClass.getButtonName(); active = actionClass.isButtonActive(getJsp(), getParamResource()); } else {
params.append("?").append(CmsDialog.PARAM_RESOURCE).append("=").append(editor.getParamResource()); params.append("&").append(CmsDialog.PARAM_ACTION).append("=").append(CmsDialog.DIALOG_CONFIRMED); params.append("&").append(CmsWorkplace.PARAM_DIRECTPUBLISH).append("=").append(CmsStringUtil.TRUE); params.append( CmsEncoder.escapeWBlanks( editor.key(Messages.GUI_MESSAGEBOX_TITLE_PUBLISHRESOURCE_0) + ": " + editor.getParamResource(), CmsEncoder.ENCODING_UTF_8)); params.append("&").append(CmsDialog.PARAM_REDIRECT).append("=").append(CmsStringUtil.TRUE); linkTarget = jsp.link(editor.getParamBacklink()); } else { linkTarget = jsp.link(editor.getParamResource());
/** * Creates a temporary file which is needed while working in an editor with preview option.<p> * * @return the file name of the temporary file * @throws CmsException if something goes wrong */ protected String createTempFile() throws CmsException { return OpenCms.getWorkplaceManager().createTempFile(getCms(), getParamResource(), getSettings().getProject()); }
/** * Creates a temporary file which is needed while working in an editor with preview option.<p> * * @return the file name of the temporary file * @throws CmsException if something goes wrong */ protected String createTempFile() throws CmsException { return OpenCms.getWorkplaceManager().createTempFile(getCms(), getParamResource(), getSettings().getProject()); }
/** * Shows the selected error page in case of an exception.<p> * * @param editor initialized instance of the editor class * @param exception the current exception * @throws JspException if inclusion of the error page fails */ protected void showErrorPage(Object editor, Exception exception) throws JspException { // save initialized instance of the editor class in request attribute for included sub-elements getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, editor); // reading of file contents failed, show error dialog setAction(ACTION_SHOW_ERRORMESSAGE); setParamTitle(key(Messages.GUI_TITLE_EDIT_1, new Object[] {CmsResource.getName(getParamResource())})); if (exception != null) { getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, exception); if (CmsLog.getLog(editor).isWarnEnabled()) { CmsLog.getLog(editor).warn(exception.getLocalizedMessage(), exception); } } // include the common error dialog getJsp().include(FILE_DIALOG_SCREEN_ERRORPAGE); } }
/** * Shows the selected error page in case of an exception.<p> * * @param editor initialized instance of the editor class * @param exception the current exception * @throws JspException if inclusion of the error page fails */ protected void showErrorPage(Object editor, Exception exception) throws JspException { // save initialized instance of the editor class in request attribute for included sub-elements getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, editor); // reading of file contents failed, show error dialog setAction(ACTION_SHOW_ERRORMESSAGE); setParamTitle(key(Messages.GUI_TITLE_EDIT_1, new Object[] {CmsResource.getName(getParamResource())})); if (exception != null) { getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, exception); if (CmsLog.getLog(editor).isWarnEnabled()) { CmsLog.getLog(editor).warn(exception.getLocalizedMessage(), exception); } } // include the common error dialog getJsp().include(FILE_DIALOG_SCREEN_ERRORPAGE); } }
/** * Returns the editor action for a "cancel" button.<p> * * This overwrites the cancel method of the CmsDialog class.<p> * * Always use this value, do not write anything directly in the html page.<p> * * @return the default action for a "cancel" button */ public String buttonActionCancel() { String target = null; if (Boolean.valueOf(getParamDirectedit()).booleanValue()) { // editor is in direct edit mode if (CmsStringUtil.isNotEmpty(getParamBacklink())) { // set link to the specified back link target target = getParamBacklink(); } else { // set link to the edited resource target = getParamResource(); } } else { // in workplace mode, show explorer view target = OpenCms.getLinkManager().substituteLink(getCms(), CmsWorkplace.JSP_WORKPLACE_URI); } return "onclick=\"top.location.href='" + getJsp().link(target) + "';\""; }
/** * Returns the editor action for a "cancel" button.<p> * * This overwrites the cancel method of the CmsDialog class.<p> * * Always use this value, do not write anything directly in the html page.<p> * * @return the default action for a "cancel" button */ public String buttonActionCancel() { String target = null; if (Boolean.valueOf(getParamDirectedit()).booleanValue()) { // editor is in direct edit mode if (CmsStringUtil.isNotEmpty(getParamBacklink())) { // set link to the specified back link target target = getParamBacklink(); } else { // set link to the edited resource target = getParamResource(); } } else { // in workplace mode, show explorer view target = OpenCms.getLinkManager().substituteLink(getCms(), CmsFrameset.JSP_WORKPLACE_URI); } return "onclick=\"top.location.href='" + getJsp().link(target) + "';\""; }
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamResource())) { editedResource = getCms().readResource(getParamResource());
if (cms.existsResource(getParamResource(), CmsResourceFilter.ALL)) { cms.writePropertyObjects(getParamResource(), properties); CmsFile orgFile = cms.readFile(getParamResource(), CmsResourceFilter.ALL); orgFile.setContents(tempFile.getContents()); getCloneCms().writeFile(orgFile); cms.copyResource(getParamTempfile(), getParamResource(), CmsResource.COPY_AS_NEW); CmsFile orgFile = cms.readFile(getParamResource(), CmsResourceFilter.ALL); getCloneCms().writeFile(orgFile); int flags = cms.readResource(getParamResource(), CmsResourceFilter.ALL).getFlags(); if ((flags & CmsResource.FLAG_TEMPFILE) == CmsResource.FLAG_TEMPFILE) { flags ^= CmsResource.FLAG_TEMPFILE; cms.chflags(getParamResource(), flags);
if (cms.existsResource(getParamResource(), CmsResourceFilter.ALL)) { cms.writePropertyObjects(getParamResource(), properties); CmsFile orgFile = cms.readFile(getParamResource(), CmsResourceFilter.ALL); orgFile.setContents(tempFile.getContents()); getCloneCms().writeFile(orgFile); cms.copyResource(getParamTempfile(), getParamResource(), CmsResource.COPY_AS_NEW); int flags = cms.readResource(getParamResource(), CmsResourceFilter.ALL).getFlags(); if ((flags & CmsResource.FLAG_TEMPFILE) == CmsResource.FLAG_TEMPFILE) { flags ^= CmsResource.FLAG_TEMPFILE; cms.chflags(getParamResource(), flags);
String filename = getParamResource();
String filename = getParamResource();
} else { setParamCloseLink(getJsp().link(getParamResource()));
} else { setParamCloseLink(getJsp().link(getParamResource()));