Post Init Service Starter
[aaf/authz.git] / auth / auth-gui / src / main / java / org / onap / aaf / auth / gui / pages / Home.java
index e0a73dc..e7a643c 100644 (file)
@@ -37,10 +37,25 @@ import org.onap.aaf.misc.xgen.html.HTMLGen;
 
 public class Home extends Page {
     public static final String HREF = "/gui/home";
+    /*
+     *      Relative path, Menu Name, Full Path
+     */
+    public static String[][] MENU_ITEMS = new String[][] {
+               {"myperms","My Permissions","/gui/myperms"},
+               {"myroles","My Roles","/gui/myroles"},
+               {"ns","My Namespaces","/gui/ns"},
+               {"approve","My Approvals","/gui/approve"},
+               {"myrequests","My Pending Requests","/gui/myrequests"},
+                   // Enable later
+               //  {"onboard","Onboarding"},
+               {"passwd","Password Management","/gui/passwd"},
+               {"cui","Command Prompt","/gui/cui"},
+               {"api","AAF API","/gui/api"}
+    };
     public Home(final AAF_GUI gui) throws APIException, IOException {
         super(gui.env,"Home",HREF, NO_FIELDS, new NamedCode(false,"content") {
             @Override
-            public void code(final Cache<HTMLGen> cache, final HTMLGen xgen) throws APIException, IOException {
+            public void code(final Cache<HTMLGen> cache, final HTMLGen htmlGen) throws APIException, IOException {
 //                // TEMP
 //                JSGen jsg = xgen.js();
 //                jsg.function("httpPost","sURL","sParam")
@@ -53,25 +68,14 @@ public class Home extends Page {
 //                    .text(text)
 //                jsg.done();
                 // TEMP
-                final Mark pages = xgen.divID("Pages");
-                xgen.leaf(H3).text("Choose from the following:").end()
-                    .leaf(A,"href=myperms").text("My Permissions").end()
-                    .leaf(A,"href=myroles").text("My Roles").end()
-                //    TODO: uncomment when on cassandra 2.1.2 for MyNamespace GUI page
-                    .leaf(A,"href=ns").text("My Namespaces").end()
-                    .leaf(A,"href=approve").text("My Approvals").end()
-                    .leaf(A, "href=myrequests").text("My Pending Requests").end()
-                    // Enable later
-//                    .leaf(A, "href=onboard").text("Onboarding").end()
-                // Password Change.  If logged in as CSP/GSO, go to their page
-                    .leaf(A,"href=passwd").text("Password Management").end()
-                    .leaf(A,"href=cui").text("Command Prompt").end()
-                    .leaf(A,"href=api").text("AAF API").end()
-                    ;
-                
-                xgen.end(pages);
+                final Mark pages = htmlGen.divID("Pages");
+                htmlGen.leaf(H3).text("Choose from the following:").end();
+                for(String[] mi : MENU_ITEMS) {
+                       htmlGen.leaf(A,"href="+mi[0]).text(mi[1]).end();
+                }
+                htmlGen.end(pages);
             }
         });
     }
-
+    
 }