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";
41 public Home(final AAF_GUI gui) throws APIException, IOException {
42 super(gui.env,"Home",HREF, NO_FIELDS, new NamedCode(false,"content") {
44 public void code(final Cache<HTMLGen> cache, final HTMLGen htmlGen) throws APIException, IOException {
46 // JSGen jsg = xgen.js();
47 // jsg.function("httpPost","sURL","sParam")
48 // .text("var oURL = new java.net.URL(sURL)")
49 // .text("var oConn = oURL.openConnection();")
50 // .text("oConn.setDoInput(true);")
51 // .text("oConn.setDoOutpu(true);")
52 // .text("oConn.setUseCaches(false);")
53 // .text("oConn.setRequestProperty(\"Content-Type\",\"application/x-www-form-urlencoded\");")
57 final Mark pages = htmlGen.divID("Pages");
58 htmlGen.leaf(H3).text("Choose from the following:").end();
59 for(String[] mi : MENU_ITEMS) {
60 htmlGen.leaf(A,"href="+mi[0]).text(mi[1]).end();