KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > administration > CmsAdminEditorWrapper


1 /*
2  * File : $Source$
3  * Date : $Date$
4  * Version: $Revision$
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.administration;
33
34 import org.opencms.jsp.CmsJspActionElement;
35 import org.opencms.workplace.CmsDialog;
36
37 import javax.servlet.http.HttpServletRequest JavaDoc;
38 import javax.servlet.http.HttpServletResponse JavaDoc;
39 import javax.servlet.jsp.JspWriter JavaDoc;
40 import javax.servlet.jsp.PageContext JavaDoc;
41
42 /**
43  * Workplace class for /system/workplace/views/admin/admin-editor.jsp .<p>
44  *
45  * @author Michael Moossen
46  *
47  * @version $Revision$
48  *
49  * @since 6.0.0
50  */

51 public class CmsAdminEditorWrapper extends CmsDialog {
52
53     /**
54      * Public constructor with JSP action element.<p>
55      *
56      * @param jsp an initialized JSP action element
57      */

58     public CmsAdminEditorWrapper(CmsJspActionElement jsp) {
59
60         super(jsp);
61     }
62
63     /**
64      * Public constructor with JSP variables.<p>
65      *
66      * @param context the JSP page context
67      * @param req the JSP request
68      * @param res the JSP response
69      */

70     public CmsAdminEditorWrapper(PageContext JavaDoc context, HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc res) {
71
72         this(new CmsJspActionElement(context, req, res));
73     }
74
75     /**
76      * Performs the dialog actions depending on the initialized action and displays the dialog form.<p>
77      *
78      * @throws Exception if writing to the JSP out fails
79      */

80     public void displayDialog() throws Exception JavaDoc {
81
82         initAdminTool();
83         getToolManager().setCurrentToolPath(this, getParentPath());
84
85         JspWriter JavaDoc out = getJsp().getJspContext().getOut();
86         out.print(htmlStart());
87         out.print(bodyStart(null));
88         out.print("<form name='editor' method='post' target='_top' action='");
89         out.print(getJsp().link("/system/workplace/editors/editor.jsp"));
90         out.print("'>\n");
91         out.print(allParamsAsHidden());
92         out.print("</form>\n");
93         out.print("<script type='text/javascript'>\n");
94         out.print("document.forms['editor'].submit();\n");
95         out.print("</script>\n");
96         out.print(dialogContentStart(getParamTitle()));
97         out.print(dialogContentEnd());
98         out.print(dialogEnd());
99         out.print(bodyEnd());
100         out.print(htmlEnd());
101     }
102 }
103
Popular Tags