d70aca459868fbf5c1eaac16eb4baeff923a29f6
[aaf/authz.git] / authz-gui / src / main / java / com / att / authz / gui / pages / LoginLandingAction.java
1 /*******************************************************************************
2  * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
3  *******************************************************************************/
4 package com.att.authz.gui.pages;
5
6 import java.io.IOException;
7
8 import com.att.authz.env.AuthzTrans;
9 import com.att.authz.gui.AuthGUI;
10 import com.att.authz.gui.BreadCrumbs;
11 import com.att.authz.gui.NamedCode;
12 import com.att.authz.gui.Page;
13 import org.onap.aaf.inno.env.APIException;
14 import org.onap.aaf.inno.env.Slot;
15 import com.att.xgen.Cache;
16 import com.att.xgen.DynamicCode;
17 import com.att.xgen.html.HTMLGen;
18
19 public class LoginLandingAction extends Page {
20         public LoginLandingAction(final AuthGUI gui, final Page ... breadcrumbs) throws APIException, IOException {
21                 super(gui.env,"Login",LoginLanding.HREF, LoginLanding.fields,
22                         new BreadCrumbs(breadcrumbs),
23                         new NamedCode(true,"content") {
24                                 final Slot sID = gui.env.slot(LoginLanding.NAME+'.'+LoginLanding.fields[0]);
25 //                              final Slot sPassword = gui.env.slot(LoginLanding.NAME+'.'+LoginLanding.fields[1]);
26                                 
27                                 @Override
28                                 public void code(Cache<HTMLGen> cache, HTMLGen hgen) throws APIException, IOException {
29                                         cache.dynamic(hgen, new DynamicCode<HTMLGen,AuthGUI, AuthzTrans>() {
30                                                 @Override
31                                                 public void code(final AuthGUI gui, final AuthzTrans trans,Cache<HTMLGen> cache, HTMLGen hgen) throws APIException, IOException {
32                                                         String username = trans.get(sID,null);
33 //                                                      String password = trans.get(sPassword,null);
34
35                                                         hgen.p("User: "+username);
36                                                         hgen.p("Pass: ********");
37                                                         
38                                                         // TODO: clarification from JG
39                                                         // put in request header?
40                                                         // then pass through authn/basicAuth call?
41                                                         
42                                                 }
43                                         });
44                                 }
45                 });
46         }
47 }