KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > projectmanagement > presentation > worksheets > Context


1 /*
2  * projectManagement
3  *
4  * Enhydra super-servlet presentation object
5  *
6  */

7
8 package projectmanagement.presentation.worksheets;
9
10 import projectmanagement.presentation.*;
11
12 import org.w3c.dom.*;
13 import org.w3c.dom.html.*;
14
15 // Enhydra SuperServlet imports
16
import com.lutris.appserver.server.httpPresentation.*;
17 import org.enhydra.xml.xmlc.XMLObject;
18
19 // Standard imports
20
import java.io.IOException JavaDoc;
21
22 /**
23 * Generates the blank HTML page.
24 */

25 public class Context extends BasePO {
26
27    private static String JavaDoc IS_PERSONAL = "isPersonal";
28    private static String JavaDoc DISPLAY_ADMIN= "displayAdmin";
29    private static String JavaDoc EMPLOYEE= "employee";
30
31    /**
32     * Superclass method override. Returns 1 or 2, depending on action.
33     */

34    protected int getRequiredAuthLevel() {
35       String JavaDoc isPersonal="";
36       try {
37          isPersonal=this.getComms().request.getParameter(IS_PERSONAL);
38       } catch (Exception JavaDoc ex) {}
39
40       if (isPersonal!=null && isPersonal.equalsIgnoreCase("true")) {
41          return 1;
42       } else {
43          return 2;
44       }
45    }
46
47    /**
48     * Default event. Just show the page.
49     */

50    public XMLObject handleDefault() throws HttpPresentationException {
51
52       ContextHTML page=new ContextHTML();
53
54       String JavaDoc isPersonal=this.getComms().request.getParameter(IS_PERSONAL);
55       String JavaDoc displayAdmin=this.getComms().request.getParameter(DISPLAY_ADMIN);
56       String JavaDoc employee=this.getComms().request.getParameter(EMPLOYEE);
57
58       if (isPersonal!=null && isPersonal.equalsIgnoreCase("true")) {
59          page.getElementFrameControl().setSrc("Controls.po?isPersonal=true");
60       }
61
62       return page;
63    }
64
65 }
66
Popular Tags