KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

28     private static final long serialVersionUID = 222L;
29
30     protected void draw(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) throws IOException JavaDoc {
31         PrintWriter JavaDoc out = response.getWriter();
32
33         DialogWebDAV dav = (DialogWebDAV) request.getSession().getAttribute(
34             request.getParameter(DialogSuper.SESSION_ATTRIBUTENAME_DIALOGOBJECT));
35         // do not remove session attribute!
36
if (dav != null) {
37             if (request.getParameter("subDirectory") != null) { //$NON-NLS-1$
38
dav.setSubDirectory(request.getParameter("subDirectory")); //$NON-NLS-1$
39
}
40             if (request.getParameter("selectedValue") != null) { //$NON-NLS-1$
41
dav.setValue(request.getParameter("selectedValue")); //$NON-NLS-1$
42
}
43             dav.drawHtmlList(out);
44         }
45         else {
46             out.println("<i>" + MessagesManager.get(request, "webdav.error") + "</i>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
47
}
48
49     }
50
51 }
52
Popular Tags