2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.auth.gui.pages;
24 import static org.onap.aaf.misc.xgen.html.HTMLGen.A;
25 import static org.onap.aaf.misc.xgen.html.HTMLGen.H3;
27 import java.io.IOException;
29 import org.onap.aaf.auth.gui.AAF_GUI;
30 import org.onap.aaf.auth.gui.NamedCode;
31 import org.onap.aaf.auth.gui.Page;
32 import org.onap.aaf.misc.env.APIException;
33 import org.onap.aaf.misc.xgen.Cache;
34 import org.onap.aaf.misc.xgen.Mark;
35 import org.onap.aaf.misc.xgen.html.HTMLGen;
38 public class Home extends Page {
39 public static final String HREF = "/gui/home";
40 public Home(final AAF_GUI gui) throws APIException, IOException {
41 super(gui.env,"Home",HREF, NO_FIELDS, new NamedCode(false,"content") {
43 public void code(final Cache<HTMLGen> cache, final HTMLGen xgen) throws APIException, IOException {
45 // JSGen jsg = xgen.js();
46 // jsg.function("httpPost","sURL","sParam")
47 // .text("var oURL = new java.net.URL(sURL)")
48 // .text("var oConn = oURL.openConnection();")
49 // .text("oConn.setDoInput(true);")
50 // .text("oConn.setDoOutpu(true);")
51 // .text("oConn.setUseCaches(false);")
52 // .text("oConn.setRequestProperty(\"Content-Type\",\"application/x-www-form-urlencoded\");")
56 final Mark pages = xgen.divID("Pages");
57 xgen.leaf(H3).text("Choose from the following:").end()
58 .leaf(A,"href=myperms").text("My Permissions").end()
59 .leaf(A,"href=myroles").text("My Roles").end()
60 // TODO: uncomment when on cassandra 2.1.2 for MyNamespace GUI page
61 .leaf(A,"href=ns").text("My Namespaces").end()
62 .leaf(A,"href=approve").text("My Approvals").end()
63 .leaf(A, "href=myrequests").text("My Pending Requests").end()
65 // .leaf(A, "href=onboard").text("Onboarding").end()
66 // Password Change. If logged in as CSP/GSO, go to their page
67 .leaf(A,"href=passwd").text("Password Management").end()
68 .leaf(A,"href=cui").text("Command Prompt").end()
69 .leaf(A,"href=api").text("AAF API").end()