KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/administration/CmsAdminDialog.java,v $
3  * Date : $Date: 2006/03/28 13:10:02 $
4  * Version: $Revision: 1.10 $
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 import org.opencms.workplace.tools.CmsExplorerDialog;
37 import org.opencms.workplace.tools.CmsToolManager;
38
39 import java.util.Map JavaDoc;
40
41 import javax.servlet.http.HttpServletRequest JavaDoc;
42 import javax.servlet.http.HttpServletResponse JavaDoc;
43 import javax.servlet.jsp.JspWriter JavaDoc;
44 import javax.servlet.jsp.PageContext JavaDoc;
45
46 /**
47  * Workplace class for /system/workplace/views/admin/admin-main.jsp .<p>
48  *
49  * @author Michael Moossen
50  *
51  * @version $Revision: 1.10 $
52  *
53  * @since 6.0.0
54  */

55 public class CmsAdminDialog extends CmsDialog {
56
57     /**
58      * Public constructor with JSP action element.<p>
59      *
60      * @param jsp an initialized JSP action element
61      */

62     public CmsAdminDialog(CmsJspActionElement jsp) {
63
64         super(jsp);
65     }
66
67     /**
68      * Public constructor with JSP variables.<p>
69      *
70      * @param context the JSP page context
71      * @param req the JSP request
72      * @param res the JSP response
73      */

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

84     public void displayDialog() throws Exception JavaDoc {
85
86         Map JavaDoc params = initAdminTool();
87
88         // explorer view dialogs
89
if (CmsExplorerDialog.EXPLORER_TOOLS.contains(getCurrentToolPath())) {
90             if (getAction() == CmsDialog.ACTION_CANCEL) {
91                 actionCloseDialog();
92                 return;
93             }
94             getToolManager().jspForwardPage(this, CmsToolManager.ADMINVIEW_ROOT_LOCATION + "/tool-fs.jsp", params);
95             return;
96         }
97
98         // real tool
99
if (!getAdminTool().getHandler().getLink().equals(getCms().getRequestContext().getUri())) {
100             getToolManager().jspForwardPage(this, getAdminTool().getHandler().getLink(), params);
101             return;
102         }
103
104         // just grouping
105
if (getAction() == CmsDialog.ACTION_CANCEL) {
106             actionCloseDialog();
107             return;
108         }
109
110         JspWriter JavaDoc out = getJsp().getJspContext().getOut();
111         out.print(htmlStart());
112         out.print(bodyStart(null));
113         out.print(dialogStart());
114         out.print(dialogContentStart(getParamTitle()));
115         out.print(dialogContentEnd());
116         out.print(dialogEnd());
117         out.print(bodyEnd());
118         out.print(htmlEnd());
119     }
120 }
121
Popular Tags