KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > module > admininterface > dialogpages > RichEditorIFrameDialogPage


1 package info.magnolia.module.admininterface.dialogpages;
2
3 import info.magnolia.cms.gui.dialog.DialogRichedit;
4 import info.magnolia.cms.gui.dialog.DialogSuper;
5 import info.magnolia.module.admininterface.DialogPageMVCHandler;
6
7 import java.io.IOException JavaDoc;
8 import java.io.PrintWriter JavaDoc;
9
10 import javax.servlet.http.HttpServletRequest JavaDoc;
11 import javax.servlet.http.HttpServletResponse JavaDoc;
12
13 import org.apache.log4j.Logger;
14
15
16 /**
17  * @author Fabrizio Giustina
18  * @version $Id: $
19  */

20 public class RichEditorIFrameDialogPage extends DialogPageMVCHandler {
21
22     public RichEditorIFrameDialogPage(String JavaDoc name, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
23         super(name, request, response);
24     }
25
26     /**
27      * Stable serialVersionUID.
28      */

29     private static final long serialVersionUID = 222L;
30
31     /**
32      * Logger.
33      */

34     private static Logger log = Logger.getLogger(RichEditorIFrameDialogPage.class);
35
36     protected void draw(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) throws IOException JavaDoc {
37         PrintWriter JavaDoc out = response.getWriter();
38
39         DialogRichedit richE = (DialogRichedit) request.getSession().getAttribute(
40             request.getParameter(DialogSuper.SESSION_ATTRIBUTENAME_DIALOGOBJECT));
41         if (richE != null) {
42             richE.removeSessionAttribute();
43             richE.drawHtmlEditor(out);
44         }
45         else {
46             log.error("DialogRichedit not found in session with name [" //$NON-NLS-1$
47
+ request.getParameter(DialogSuper.SESSION_ATTRIBUTENAME_DIALOGOBJECT) + "]"); //$NON-NLS-1$
48
}
49     }
50
51 }
52
Popular Tags