001: /*
002: * File : $Source: /usr/local/cvs/alkacon/com.alkacon.opencms.newsletter/src/com/alkacon/opencms/newsletter/admin/CmsNewsletterEditorWrapper.java,v $
003: * Date : $Date: 2007-11-30 11:57:27 $
004: * Version: $Revision: 1.4 $
005: *
006: * This file is part of the Alkacon OpenCms Add-On Module Package
007: *
008: * Copyright (c) 2007 Alkacon Software GmbH (http://www.alkacon.com)
009: *
010: * The Alkacon OpenCms Add-On Module Package is free software:
011: * you can redistribute it and/or modify
012: * it under the terms of the GNU General Public License as published by
013: * the Free Software Foundation, either version 3 of the License, or
014: * (at your option) any later version.
015: *
016: * The Alkacon OpenCms Add-On Module Package is distributed
017: * in the hope that it will be useful,
018: * but WITHOUT ANY WARRANTY; without even the implied warranty of
019: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
020: * GNU General Public License for more details.
021: *
022: * You should have received a copy of the GNU General Public License
023: * along with the Alkacon OpenCms Add-On Module Package.
024: * If not, see http://www.gnu.org/licenses/.
025: *
026: * For further information about Alkacon Software GmbH, please see the
027: * company website: http://www.alkacon.com.
028: *
029: * For further information about OpenCms, please see the
030: * project website: http://www.opencms.org.
031: */
032:
033: package com.alkacon.opencms.newsletter.admin;
034:
035: import org.opencms.jsp.CmsJspActionElement;
036: import org.opencms.workplace.CmsDialog;
037:
038: import javax.servlet.http.HttpServletRequest;
039: import javax.servlet.http.HttpServletResponse;
040: import javax.servlet.jsp.JspWriter;
041: import javax.servlet.jsp.PageContext;
042:
043: /**
044: * Editor wrapper for editing newsletter resources in the administration view.<p>
045: *
046: * Sets the <code>backlink</code> parameter when opening the editor containing the organizational unit information.<p>
047: *
048: * @author Andreas Zahner
049: *
050: * @version $Revision $
051: *
052: * @since 7.0.3
053: */
054: public class CmsNewsletterEditorWrapper extends CmsDialog {
055:
056: /** The backlink request parameter. */
057: private String m_paramBacklink;
058:
059: /**
060: * Public constructor with JSP action element.<p>
061: *
062: * @param jsp an initialized JSP action element
063: */
064: public CmsNewsletterEditorWrapper(CmsJspActionElement jsp) {
065:
066: super (jsp);
067: }
068:
069: /**
070: * Public constructor with JSP variables.<p>
071: *
072: * @param context the JSP page context
073: * @param req the JSP request
074: * @param res the JSP response
075: */
076: public CmsNewsletterEditorWrapper(PageContext context,
077: HttpServletRequest req, HttpServletResponse res) {
078:
079: this (new CmsJspActionElement(context, req, res));
080: }
081:
082: /**
083: * Performs the dialog actions depending on the initialized action and displays the dialog form.<p>
084: *
085: * @throws Exception if writing to the JSP out fails
086: */
087: public void displayDialog() throws Exception {
088:
089: initAdminTool();
090:
091: JspWriter out = getJsp().getJspContext().getOut();
092: out.print(htmlStart());
093: out.print(bodyStart(null));
094: out
095: .print("<form name='editor' method='post' target='_top' action='");
096: out
097: .print(getJsp().link(
098: "/system/workplace/editors/editor.jsp"));
099: out.print("'>\n");
100: out.print(paramsAsHidden());
101: out.print("</form>\n");
102: out.print("<script type='text/javascript'>\n");
103: out.print("document.forms['editor'].submit();\n");
104: out.print("</script>\n");
105: out.print(bodyEnd());
106: out.print(htmlEnd());
107: }
108:
109: /**
110: * Returns the backlink request parameter.<p>
111: *
112: * @return the backlink request parameter
113: */
114: public String getParamBacklink() {
115:
116: return m_paramBacklink;
117: }
118:
119: /**
120: * Sets the backlink request parameter.<p>
121: *
122: * @param paramBacklink the backlink request parameter
123: */
124: public void setParamBacklink(String paramBacklink) {
125:
126: m_paramBacklink = paramBacklink;
127: }
128: }
|