3c6abd037f235aab18ab1c9661a21d2e8e048887
[aaf/authz.git] / authz-gui / src / main / java / com / att / authz / gui / pages / Home.java
1 /*******************************************************************************
2  * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
3  *******************************************************************************/
4 package com.att.authz.gui.pages;
5
6 import static com.att.xgen.html.HTMLGen.A;
7 import static com.att.xgen.html.HTMLGen.H3;
8
9 import java.io.IOException;
10
11 import com.att.authz.gui.AuthGUI;
12 import com.att.authz.gui.NamedCode;
13 import com.att.authz.gui.Page;
14 import org.onap.aaf.inno.env.APIException;
15 import com.att.xgen.Cache;
16 import com.att.xgen.Mark;
17 import com.att.xgen.html.HTMLGen;
18
19
20 public class Home extends Page {
21         public static final String HREF = "/gui/home";
22         public Home(final AuthGUI gui) throws APIException, IOException {
23                 super(gui.env,"Home",HREF, NO_FIELDS, new NamedCode(false,"content") {
24                         @Override
25                         public void code(final Cache<HTMLGen> cache, final HTMLGen xgen) throws APIException, IOException {
26 //                              // TEMP
27 //                              JSGen jsg = xgen.js();
28 //                              jsg.function("httpPost","sURL","sParam")
29 //                                      .text("var oURL = new java.net.URL(sURL)")
30 //                                      .text("var oConn = oURL.openConnection();")
31 //                                      .text("oConn.setDoInput(true);")
32 //                                      .text("oConn.setDoOutpu(true);")
33 //                                      .text("oConn.setUseCaches(false);")
34 //                                      .text("oConn.setRequestProperty(\"Content-Type\",\"application/x-www-form-urlencoded\");")
35 //                                      .text(text)
36 //                              jsg.done();
37                                 // TEMP
38                                 final Mark pages = xgen.divID("Pages");
39                                 xgen.leaf(H3).text("Choose from the following:").end()
40                                         .leaf(A,"href=myperms").text("My Permissions").end()
41                                         .leaf(A,"href=myroles").text("My Roles").end()
42                                 //      TODO: uncomment when on cassandra 2.1.2 for MyNamespace GUI page
43                                         .leaf(A,"href=mynamespaces").text("My Namespaces").end()
44                                         .leaf(A,"href=approve").text("My Approvals").end()
45                                         .leaf(A, "href=myrequests").text("My Pending Requests").end()
46                                         // Enable later
47 //                                      .leaf(A, "href=onboard").text("Onboarding").end()
48                                 // Password Change.  If logged in as CSP/GSO, go to their page
49                                         .leaf(A,"href=passwd").text("Password Management").end()
50                                         .leaf(A,"href=cui").text("Command Prompt").end()
51                                         .leaf(A,"href=api").text("AAF API").end()
52                                         ;
53                                 
54                                 xgen.end(pages);
55                         }
56                 });
57         }
58
59 }