X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-gui%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fgui%2Fpages%2FCredDetail.java;h=e98b40f25f2c69fb6f59fec15c4fbc5b4f12c18a;hb=HEAD;hp=70d86933c4aa4dc5d6d1e48b48e7c4b41458fa91;hpb=2c3cb70208785cf0272eae075206074318ca74cc;p=aaf%2Fauthz.git diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java index 70d86933..e98b40f2 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -67,7 +67,7 @@ import certman.v1_0.Artifacts; import certman.v1_0.Artifacts.Artifact; public class CredDetail extends Page { - + public static final String HREF = "/gui/creddetail"; public static final String NAME = "CredDetail"; private static Model model; @@ -76,7 +76,7 @@ public class CredDetail extends Page { public CredDetail(final AAF_GUI gui, Page ... breadcrumbs) throws APIException, IOException { - super(gui.env, NAME, HREF, Params.values(), + super(gui.env, NAME, HREF, Params.values(), new BreadCrumbs(breadcrumbs), new Table("Cred Details",gui.env.newTransNoAvg(),model = new Model(), slotCode = new SlotCode(false,gui.env,NAME,Params.values()) { @@ -109,7 +109,7 @@ public class CredDetail extends Page { }); } },"class=std") - + ); // Setting so we can get access to HTMLGen clone model.set(this,slotCode); @@ -119,7 +119,7 @@ public class CredDetail extends Page { /** * Implement the table content for Cred Detail - * + * * @author Jeremiah * */ @@ -136,7 +136,7 @@ public class CredDetail extends Page { cd = credDetail; sc = slotCode; } - + @Override public void prefix(AAF_GUI state, AuthzTrans trans, final Cache cache, final HTMLGen hgen) { } @@ -150,7 +150,7 @@ public class CredDetail extends Page { } final ArrayList rv = new ArrayList<>(); final TimeTaken tt = trans.start("AAF Cred Details",Env.REMOTE); - List la; + List la; try { la = gui.cmClientAsUser(trans.getUserPrincipal(), new Retryable>() { @Override @@ -177,18 +177,19 @@ public class CredDetail extends Page { if (fu.get(AAFcli.timeout())) { // Organize User entries Map>>> users = new HashMap<>(); - + List>> lmu=null; Map> mu = null; List lu = null; - + for (User u : fu.value.getUser()) { if (u.getType() == 200) { lns.remove(u.getId()); } lmu = users.get(u.getId()); if (lmu==null) { - users.put(u.getId(),lmu=new ArrayList<>()); + lmu=new ArrayList<>(); + users.put(u.getId(),lmu); } mu=null; for (Map> xmu : lmu) { @@ -196,14 +197,16 @@ public class CredDetail extends Page { mu = xmu; } } - + if (mu==null) { - lmu.add(mu=new HashMap<>()); + mu=new HashMap<>(); + lmu.add(mu); } - + lu = mu.get(u.getType()); if (lu==null) { - mu.put(u.getType(),lu = new ArrayList<>()); + lu = new ArrayList<>(); + mu.put(u.getType(),lu); } lu.add(u); } @@ -215,7 +218,7 @@ public class CredDetail extends Page { HTMLGen hgen = cd.clone(buttons); hgen.leaf("button","onclick=divVisibility('"+key+"');","class=button").text("Expand").end(); hgen.leaf(HTMLGen.A,"class=button","class=greenbutton","href="+CredHistory.HREF+"?user="+ulm.getKey()).text("History").end(); - + StringWriter creds = new StringWriter(); hgen = cd.clone(creds); Mark div = hgen.divID(key,ulm.getKey().equals(id)?"":"style=display:none;"); @@ -226,7 +229,7 @@ public class CredDetail extends Page { Mark uRow = new Mark(); String cls; boolean first = true; - + for ( Entry> es : miu.entrySet()) { Collections.sort(es.getValue(),new Comparator() { @Override @@ -256,8 +259,8 @@ public class CredDetail extends Page { if (first) { hgen.leaf(HTMLGen.TD,cls="class=detailFirst",STYLE_WIDTH_10); switch(es.getKey()) { - case 1: - case 2: hgen.text("Password"); + case 1: + case 2: hgen.text("Password"); break; case 10: hgen.text("Certificate"); break; } @@ -266,7 +269,7 @@ public class CredDetail extends Page { } hgen.end(); hgen.incr(HTMLGen.TD,cls,STYLE_WIDTH_20); - + hgen.leaf(HTMLGen.A, "class=button", "href="+PassDeleteAction.HREF+ @@ -282,9 +285,9 @@ public class CredDetail extends Page { } first=false; hgen.end().leaf(HTMLGen.TD,cls,STYLE_WIDTH_70) - .text(Chrono.niceDateStamp(u.getExpires())) + .text(Chrono.niceDateStamp(u.getExpires()) + ", TAG ID: " + u.getTag()) .end(); - + hgen.end(uRow); } } @@ -305,15 +308,15 @@ public class CredDetail extends Page { .end(uRow); } - + } hgen.end(utable); } - + hgen.end(div); rv.add(new AbsCell[] { - new TextCell(ulm.getKey(),STYLE_WIDTH_15), + new TextCell(ulm.getKey(),STYLE_WIDTH_15), new TextCell(buttons.toString(),STYLE_WIDTH_5), new TextCell(creds.toString(),STYLE_WIDTH_70) });