diff options
Diffstat (limited to 'auth/auth-gui/src/main/java/org/onap')
56 files changed, 590 insertions, 590 deletions
diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/AAF_GUI.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/AAF_GUI.java index e1870e94..5d243e9b 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/AAF_GUI.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/AAF_GUI.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. @@ -104,9 +104,9 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E public static final String HTTP_SERVLET_REQUEST = "HTTP_SERVLET_REQUEST"; public static final int TIMEOUT = 60000; public static final String app = "AAF GUI"; - + // AAF API - + // Certificate manager API public RosettaDF<Artifacts> artifactsDF; public RosettaDF<CertInfo> certInfoDF; @@ -114,7 +114,7 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E private final AAFConHttp cmCon; public final AAFConHttp aafCon; public final AAFLurPerm lur; - + public final Slot slot_httpServletRequest; protected final String deployedVersion; private StaticSlot sThemeWebPath; @@ -126,12 +126,12 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E sDefaultTheme = env.staticSlot(AAF_GUI_THEME); String defTheme = env.getProperty(AAF_GUI_THEME,"onap"); env.put(sDefaultTheme, defTheme); - + sThemeWebPath = env.staticSlot(CachingFileAccess.CFA_WEB_PATH); if(env.get(sThemeWebPath)==null) { env.put(sThemeWebPath,"theme"); } - + slot_httpServletRequest = env.slot(HTTP_SERVLET_REQUEST); deployedVersion = app_version; @@ -140,7 +140,7 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E cmCon = new AAFConHttp(env.access(),aaf_url_cm); artifactsDF = env.newDataFactory(Artifacts.class); certInfoDF = env.newDataFactory(CertInfo.class); - + ///////////////////////// // Screens @@ -158,7 +158,7 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E Page roleDetail = new Display(this, GET, new RoleDetail(this, start, myRoles)).page(); new Display(this, POST, new RoleDetailAction(this,start,myRoles,roleDetail)); new Display(this, GET, new RoleHistory(this,start,myRoles,roleDetail)); - + // MyNameSpace final Page myNamespaces = new Display(this, GET, new NssShow(this, start)).page(); Page nsDetail = new Display(this, GET, new NsDetail(this, start, myNamespaces)).page(); @@ -168,48 +168,48 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E Page artiShow = new Display(this, GET, new CMArtifactShow(this, start, myNamespaces, nsDetail, crdDetail)).page(); Page artiCForm = new Display(this, GET, new CMArtiChangeForm(this, start, myNamespaces, nsDetail, crdDetail,artiShow)).page(); new Display(this, POST, new CMArtiChangeAction(this, start,artiShow,artiCForm)); - + // Password Change Screens final Page pwc = new Display(this, GET, new PassChangeForm(this, start,crdDetail)).page(); new Display(this, POST, new PassChangeAction(this, start, pwc)); - + // Password Delete Screen new Display(this, GET, new PassDeleteAction(this, start,crdDetail)); // Validation Change Screens final Page validate = new Display(this, GET, new ApprovalForm(this, start)).page(); new Display(this, POST, new ApprovalAction(this, start, validate)); - + // Onboard, Detailed Edit Screens final Page onb = new Display(this, GET, new NsInfoForm(this, start)).page(); new Display(this, POST, new NsInfoAction(this, start, onb)); // Web Command Screens /* final Page webCommand =*/ new Display(this, GET, new WebCommand(this, start)).page(); - + // API Docs final Page apidocs = new Display(this, GET, new ApiDocs(this, start)).page(); new Display(this, GET, new ApiExample(this,start, apidocs)).page(); - + // Permission Grant Page final Page permGrant = new Display(this, GET, new PermGrantForm(this, start)).page(); new Display(this, POST, new PermGrantAction(this, start, permGrant)).page(); - + // Login Landing if no credentials detected final Page loginLanding = new Display(this, GET, new LoginLanding(this, start)).page(); new Display(this, POST, new LoginLandingAction(this, start, loginLanding)); - + // User Role Request Extend and Remove new Display(this, GET, new UserRoleExtend(this, start,myRoles)).page(); new Display(this, GET, new UserRoleRemove(this, start,myRoles)).page(); - + // See my Pending Requests final Page requestsShow = new Display(this, GET, new PendingRequestsShow(this, start)).page(); new Display(this, GET, new RequestDetail(this, start, requestsShow)); - + // Command line Mechanism route(env, PUT, "/gui/cui", new CUI(this),"text/plain;charset=utf-8","*/*"); - + route(env, GET, "/gui/clear", new HttpCode<AuthzTrans, Void>(null, "Clear"){ @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { @@ -226,8 +226,8 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E resp.sendRedirect("/gui/home"); } }, "text/plain;charset=utf-8","*/*"); - - /////////////////////// + + /////////////////////// // WebContent Handler /////////////////////// CachingFileAccess<AuthzTrans> cfa = new CachingFileAccess<AuthzTrans>(env); @@ -237,11 +237,11 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E aafCon = aafCon(); lur = aafCon.newLur(); } - + public<T> RosettaDF<T> getDF(Class<T> cls) throws APIException { return Cmd.getDF(env,cls); } - + public void writeError(AuthzTrans trans, Future<?> fp, HTMLGen hgen, int indent) { if (hgen!=null) { String msg = aafCon.readableErrMsg(fp); @@ -256,7 +256,7 @@ public class AAF_GUI extends AbsService<AuthzEnv, AuthzTrans> implements State<E public<RET> RET cmClientAsUser(TaggedPrincipal p,Retryable<RET> retryable) throws APIException, LocatorException, CadiException { return cmCon.hman().best(new HTransferSS(p,app, aafCon.securityInfo()), retryable); } - + @Override public Filter[] _filters(Object ... additionalTafLurs) throws CadiException, LocatorException { try { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/BreadCrumbs.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/BreadCrumbs.java index 621257b2..f056f4a7 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/BreadCrumbs.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/BreadCrumbs.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. @@ -43,7 +43,7 @@ public class BreadCrumbs extends NamedCode { super(false,"breadcrumbs"); breadcrumbs = pages; } - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { // BreadCrumbs diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/ContentCode.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/ContentCode.java index 175236df..3619e43d 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/ContentCode.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/ContentCode.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. diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Controls.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Controls.java index 76cb18ac..3bec5405 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Controls.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Controls.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. @@ -31,7 +31,7 @@ public class Controls extends NamedCode { public Controls() { super(false,"controls"); } - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { hgen.incr("form","method=post") diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Display.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Display.java index 24262e8f..74b5acc6 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Display.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Display.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. @@ -45,14 +45,14 @@ public class Display { /* * We handle all the "Form POST" calls here with a naming convention that allows us to create arrays from strings. - * - * On the HTTP side, elements concatenate their name with their Index number (if multiple). In this code, - * we turn such names into arrays with same index number. Then, we place them in the Transaction "Properties" so that + * + * On the HTTP side, elements concatenate their name with their Index number (if multiple). In this code, + * we turn such names into arrays with same index number. Then, we place them in the Transaction "Properties" so that * it can be transferred to subclasses easily. - */ + */ if (meth.equals(HttpMethods.POST)) { // Here, we'll expect FORM URL Encoded Data, which we need to get from the body - gui.route(gui.env, meth, page.url(), + gui.route(gui.env, meth, page.url(), new HttpCode<AuthzTrans,AAF_GUI>(gui,page.name()) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { @@ -90,8 +90,8 @@ public class Display { } else { // Transfer whether Page shouldn't be cached to local Final var. final boolean no_cache = page.no_cache; - - gui.route(gui.env, meth, page.url(), + + gui.route(gui.env, meth, page.url(), new HttpCode<AuthzTrans,AAF_GUI>(gui,page.name()) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { @@ -105,7 +105,7 @@ public class Display { } else { // multi value String[] array = new String[30]; String field=fields[i].substring(0, idx); - + for (Enumeration<String> mm = req.getParameterNames();mm.hasMoreElements();) { String key = mm.nextElement(); if (key.startsWith(field)) { @@ -127,7 +127,7 @@ public class Display { } page.replay(context,trans,resp.getOutputStream(),"general"); } - + /** * When the field is "as_user", make sure permission is granted */ @@ -146,8 +146,8 @@ public class Display { } } - - public Page page() { + + public Page page() { return get; } }
\ No newline at end of file diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Form.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Form.java index 40aef8fb..caa58601 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Form.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Form.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. @@ -30,18 +30,18 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class Form extends NamedCode { private String preamble; private NamedCode content; - + public Form(boolean no_cache, NamedCode content) { super(no_cache,content); this.content = content; preamble=null; } - + public Form preamble(String preamble) { this.preamble = preamble; return this; } - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { @@ -49,9 +49,9 @@ public class Form extends NamedCode { hgen.incr("p","class=preamble").text(preamble).end(); } hgen.incr("form","method=post"); - + content.code(cache, hgen); - + hgen.tagOnly("input", "type=submit", "value=Submit") .tagOnly("input", "type=reset", "value=Reset") .end(); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/NamedCode.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/NamedCode.java index 435197c8..22069c55 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/NamedCode.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/NamedCode.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. @@ -25,16 +25,16 @@ public abstract class NamedCode implements ContentCode { private final boolean no_cache; private String name; private String[] idattrs; - + /* - * Mark whether this code should not be cached, and any attributes + * Mark whether this code should not be cached, and any attributes */ public NamedCode(final boolean no_cache, final String name) { this.name = name; idattrs = new String[] {name}; this.no_cache = no_cache; } - + public NamedCode(boolean no_cache, NamedCode content) { this.no_cache = no_cache; name=content.name; @@ -48,7 +48,7 @@ public abstract class NamedCode implements ContentCode { public String[] idattrs() { return idattrs; } - + public void addAttr(boolean first, String attr) { String[] temp = new String[idattrs.length+1]; if (first) { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/OrgLookupFilter.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/OrgLookupFilter.java index deed77c0..9240ce4c 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/OrgLookupFilter.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/OrgLookupFilter.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. @@ -40,7 +40,7 @@ import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.principal.TaggedPrincipal; public class OrgLookupFilter implements Filter { - + @Override public void init(FilterConfig arg0) throws ServletException { } @@ -69,7 +69,7 @@ public class OrgLookupFilter implements Filter { } fc.doFilter(req, resp); } - + } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.java index 02654696..1d797aad 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.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. @@ -63,8 +63,8 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; import org.onap.aaf.misc.xgen.html.Imports; /** - * A Base "Mobile First" Page - * + * A Base "Mobile First" Page + * * @author Jonathan * */ @@ -92,7 +92,7 @@ public class Page extends HTMLCacheGen { // Note: Only access is synchronized in "getPerm" private final static Map<String,Map<String,Permission>> perms = new HashMap<>(); - + /* * Relative path, Menu Name, Full Path */ @@ -113,15 +113,15 @@ public class Page extends HTMLCacheGen { public String name() { return bcName; } - + public String url() { return bcUrl; } - + public String[] fields() { return fields; } - + public Page(AuthzEnv env, String name, String url, Enum<?>[] en, final NamedCode ...content) throws APIException, IOException { super(CacheGen.PRETTY, new PageCode(env, 1, content)); fields = new String[en.length]; @@ -135,7 +135,7 @@ public class Page extends HTMLCacheGen { // Mark which fields must be "no_cache" boolean no_cacheTemp=false; for (NamedCode nc : content) { - if (nc.no_cache()) { + if (nc.no_cache()) { no_cacheTemp=true; break; } @@ -145,7 +145,7 @@ public class Page extends HTMLCacheGen { public Page(AuthzEnv env, String name, String url, String [] fields, final NamedCode ... content) throws APIException,IOException { this(env,name,url,1,fields,content); } - + public Page(AuthzEnv env, String name, String url, int backdots, String [] fields, final NamedCode ... content) throws APIException,IOException { super(CacheGen.PRETTY, new PageCode(env, backdots, content)); if (fields==null) { @@ -158,19 +158,19 @@ public class Page extends HTMLCacheGen { // Mark which fields must be "no_cache" boolean no_cacheTemp=false; for (NamedCode nc : content) { - if (nc.no_cache()) { + if (nc.no_cache()) { no_cacheTemp=true; break; } } no_cache=no_cacheTemp; } - - + + private static class PageCode implements Code<HTMLGen> { private static final String AAF_GUI_THEME = "aaf.gui.theme"; private static final String AAF_GUI_TITLE = "aaf_gui_title"; - + private final ContentCode[] content; private final Slot browserSlot; private final int backdots; @@ -210,7 +210,7 @@ public class Page extends HTMLCacheGen { props = new Properties(); themeProps.put(t.getName(), props); } - + try { FileInputStream fis = new FileInputStream(f); try { @@ -233,7 +233,7 @@ public class Page extends HTMLCacheGen { } return themes.get(theme); } - + protected Imports getImports(Env env, String theme, int backdots, BROWSER browser) { List<String> ls = getThemeFiles(env,theme); Imports imp = new Imports(backdots); @@ -258,10 +258,10 @@ public class Page extends HTMLCacheGen { } return imp; } - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { - // Note: I found that App Storage saves everything about the page, or not. Thus, if you declare the page uncacheable, none of the + // Note: I found that App Storage saves everything about the page, or not. Thus, if you declare the page uncacheable, none of the // Artifacts, like JPGs are stored, which makes this feature useless for Server driven elements cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() { @Override @@ -277,14 +277,14 @@ public class Page extends HTMLCacheGen { }); hgen.html(); final String title = env.getProperty(AAF_GUI_TITLE,"Authentication/Authorization Framework"); - final String defaultTheme = env.get(sTheme,"onap"); - + final String defaultTheme = env.get(sTheme,"onap"); + Mark head = hgen.head(); hgen.leaf(TITLE).text(title).end(); cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() { @Override public void code(AAF_GUI state, AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { - BROWSER browser = browser(trans,browserSlot); + BROWSER browser = browser(trans,browserSlot); String theme = null; Cookie[] cookies = trans.hreq().getCookies(); if(cookies!=null) { @@ -298,7 +298,7 @@ public class Page extends HTMLCacheGen { } } } - + if(theme==null) { for(String t : themes.keySet()) { if(!t.equals(defaultTheme) && trans.fish(new AAFPermission(null,trans.user()+":id", AAF_GUI_THEME, t))) { @@ -311,7 +311,7 @@ public class Page extends HTMLCacheGen { } List<String> ls = getThemeFiles(trans, theme); if(ls==null) { - throw new APIException("Theme " + theme + " does not exist."); + throw new APIException("Theme " + theme + " does not exist."); } Cookie cookie = new Cookie(AAF_GUI_THEME,theme); cookie.setMaxAge(604_800); // one week @@ -329,11 +329,11 @@ public class Page extends HTMLCacheGen { break; default: } - + } }); hgen.end(head); - + Mark body = hgen.body(); Mark header = hgen.header(); cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() { @@ -345,7 +345,7 @@ public class Page extends HTMLCacheGen { String env = trans.getProperty(Config.AAF_ENV,"N/A"); xgen.leaf(H1).text(title + " on " + env).end(); xgen.leaf("p","id=version").text("AAF Version: " + state.deployedVersion).end(); - + // Obtain User Info, and print TaggedPrincipal p = trans.getUserPrincipal(); String user,secured; @@ -361,11 +361,11 @@ public class Page extends HTMLCacheGen { .text("<sup>") .text(secured) .text("</sup>").end(); - + switch(browser(trans,browserSlot)) { case ieOld: case ie: - xgen.incr("h5").text("This app is Mobile First HTML5. Internet Explorer " + xgen.incr("h5").text("This app is Mobile First HTML5. Internet Explorer " + " does not support all HTML5 standards. Old, non TSS-Standard versions may not function correctly.").br() .text(" For best results, use a highly compliant HTML5 browser like Firefox.") .end(); @@ -374,9 +374,9 @@ public class Page extends HTMLCacheGen { } } }); - + hgen.hr(); - + int cIdx; ContentCode nc; // If BreadCrumbs, put here @@ -389,7 +389,7 @@ public class Page extends HTMLCacheGen { } else { cIdx = 0; } - + hgen.end(header); hgen.divID("pageContent"); @@ -402,9 +402,9 @@ public class Page extends HTMLCacheGen { hgen.end(ctnt); } - hgen.end(inner); + hgen.end(inner); + - cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() { @Override public void code(AAF_GUI state, AuthzTrans trans,Cache<HTMLGen> cache, HTMLGen xgen) throws APIException, IOException { @@ -415,7 +415,7 @@ public class Page extends HTMLCacheGen { } else { props = themeProps==null?null:themeProps.get(theme); } - + if(props!=null && "TRUE".equalsIgnoreCase(props.getProperty("enable_nav_btn"))) { xgen.leaf("button", "id=navBtn").end(); } @@ -434,7 +434,7 @@ public class Page extends HTMLCacheGen { } else { props = themeProps==null?null:themeProps.get(theme); } - + if(props!=null) { if("TRUE".equalsIgnoreCase(props.getProperty("main_menu_in_nav"))) { xgen.incr("h2").text("Navigation").end(); @@ -516,15 +516,15 @@ public class Page extends HTMLCacheGen { hgen.end(); } hgen.end(); - + hgen.hr(); - + hgen.end(nav); // Footer - Using older Footer to work with decrepit IE versions Mark footer = hgen.divID("footer"); hgen.textCR(1, env.getProperty(AAF_GUI.AAF_GUI_COPYRIGHT)) .end(footer); - + hgen.end(body); hgen.endAll(); } @@ -533,27 +533,27 @@ public class Page extends HTMLCacheGen { public static String getBrowserType() { return BROWSER_TYPE; } - + /** * It's IE if int >=0 - * + * * Use int found in "ieVersion" - * + * * Official IE 7 - * Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; + * Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; * .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) * Official IE 8 - * Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; + * Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; * .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; ATT) - * + * * IE 11 Compatibility - * Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; + * Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; * .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3; HVD; ATT) - * + * * IE 11 (not Compatiblity) - * Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; + * Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; * .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3; HVD; ATT) - * + * * @param trans * @return */ @@ -561,7 +561,7 @@ public class Page extends HTMLCacheGen { BROWSER br = trans.get(slot, null); if (br==null) { String agent = trans.agent(); - int msie; + int msie; if (agent.contains("iPhone") /* other phones? */) { br=BROWSER.iPhone; } else if ((msie = agent.indexOf("MSIE"))>=0) { @@ -581,7 +581,7 @@ public class Page extends HTMLCacheGen { } return br; } - + /* * Get, rather than create each time, permissions for validations */ diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/SlotCode.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/SlotCode.java index 7462de80..ba1e1e3b 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/SlotCode.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/SlotCode.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. @@ -39,7 +39,7 @@ public abstract class SlotCode<TRANS extends TransStore> extends NamedCode { public<T> T get(TRANS trans,Enum<?> en, T dflt) { return get(trans,en.ordinal(),dflt); } - + public<T> T get(TRANS trans,int idx, T dflt) { if (idx>slots.length) { return dflt; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.java index 6451c4e7..bcef6de9 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Table.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. @@ -53,7 +53,7 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named this(title,trans,data,name, attrs); this.other = other; } - + public Table(String title, TRANS trans, Data<S,TRANS> data, String name, String ... attrs) { super(true,name); // prefix=postfix=null; @@ -73,7 +73,7 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named this.title = title; // Derive an ID from title (from no spaces, etc), and prepend to IDAttributes (Protected from NamedCode) addAttr(true,title(trans).replaceAll("\\s","")); - + other = null; } @@ -87,12 +87,12 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named }); Mark table = new Mark(); Mark tr = new Mark(); - + hgen.incr(table,TABLE); if (title==null) { cache.dynamic(hgen, new DynamicCode<HTMLGen,S,TRANS>() { @Override - public void code(S state, TRANS trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { + public void code(S state, TRANS trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { hgen.leaf("caption", "class=title").text(title(trans)).end(); } }); @@ -104,16 +104,16 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named hgen.leaf("th").text(column).end(); } hgen.end(tr); - + // Load Rows Dynamically cache.dynamic(hgen, rows); // End Table - hgen.end(table); - + hgen.end(table); + if (other!=null) { other.code(cache,hgen); } - + // Print Message from Row Gathering, if available cache.dynamic(hgen, new DynamicCode<HTMLGen,S,TRANS>() { @Override @@ -122,7 +122,7 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named if ((msg = trans.get(EMPTY_TABLE_SLOT, null))!=null) { hgen.incr("style").text("#inner tr,caption,input,p.preamble {display: none;}#inner p.notfound {margin: 0px 0px 0px 20px}").end(); hgen.incr(HTMLGen.P,"class=notfound").text(msg).end().br(); - } else if ((msg=trans.get(ROW_MSG_SLOT,null))!=null) { + } else if ((msg=trans.get(ROW_MSG_SLOT,null))!=null) { hgen.p(msg).br(); } } @@ -146,7 +146,7 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named cells = new AbsCell[0][0]; msg = "No Data Found"; } - + public Cells(ArrayList<AbsCell[]> arrayCells, String msg) { cells = new AbsCell[arrayCells.size()][]; arrayCells.toArray(cells); @@ -154,9 +154,9 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named } public AbsCell[][] cells; public String msg; - + } - + public interface Data<S extends State<Env>, TRANS extends Trans> { // Note: Trans is not first to avoid Method Name Collision public void prefix(S state, TRANS trans, final Cache<HTMLGen> cache, final HTMLGen hgen); @@ -168,17 +168,17 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named private class Rows extends DynamicCode<HTMLGen,S,TRANS> { private Data<S,TRANS> data; private int alt; - + public Rows(Data<S,TRANS> data, int alt) { this.data = data; this.alt = alt; } - + @Override public void code(final S state, final TRANS trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { Mark tr = new Mark(); Mark td = new Mark(); - + int alt = this.alt; Cells cells = data.get(trans,state); if (cells.cells.length>0) { @@ -220,7 +220,7 @@ public class Table<S extends State<Env>, TRANS extends TransStore> extends Named // prefix = dynamicCode; // return this; // } -// +// // public Table<S,TRANS> setPostfix(DynamicCode<HTMLGen, AuthGUI, AuthzTrans> dynamicCode) { // postfix = dynamicCode; // return this; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/XFrameFilter.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/XFrameFilter.java index cf3a6715..bec41ac8 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/XFrameFilter.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/XFrameFilter.java @@ -34,7 +34,7 @@ public class XFrameFilter implements Filter { enum TYPE {none,self}; // Note: Content-Security Params need to be worked out for GUI before activating. private final String xframe;//,csp; - + public XFrameFilter(TYPE type) { switch(type) { case self: @@ -46,10 +46,10 @@ public class XFrameFilter implements Filter { xframe="DENY"; // csp="default-src 'none'"; break; - + } } - + @Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain fc) throws IOException, ServletException { if (resp instanceof HttpServletResponse) { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java index 39e4d0b6..b171695e 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java @@ -59,11 +59,11 @@ public class ApiDocs extends Page { private static final String fields[] = {}; private static final String ERROR_LINK = "<a href=\"./example/" + "YXBwbGljYXRpb24vRXJyb3IranNvbg==" -// + Symm.base64noSplit().encode("application/Error+json") +// + Symm.base64noSplit().encode("application/Error+json") + "\">JSON</a> " + "<a href=\"./example/" + "YXBwbGljYXRpb24vRXJyb3IreG1s" -// + Symm.base64noSplit().encode("application/Error+xml") +// + Symm.base64noSplit().encode("application/Error+xml") + "\">XML</a> "; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiExample.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiExample.java index 7da77607..9d28d1dc 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiExample.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiExample.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. @@ -40,7 +40,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; /** * Detail Page for Permissions - * + * * @author Jonathan * */ @@ -54,7 +54,7 @@ public class ApiExample extends Page { new Model(NAME) ); } - + private static class Model extends NamedCode { private static final String WITH_OPTIONAL_PARAMETERS = "\n\n////////////\n Data with Optional Parameters \n////////////\n\n"; @@ -86,8 +86,8 @@ public class ApiExample extends Page { } else { fs2=null; } - - + + if (fp.get(5000)) { xgen.incr(HTMLGen.H1).text("Sample Code").end() .incr(HTMLGen.H5).text(typecode).end(); @@ -123,11 +123,11 @@ public class ApiExample extends Page { tt.done(); } } - + }); xgen.end(inner); } } -} +}
\ No newline at end of file diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalAction.java index 8c90b491..18499ac8 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalAction.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. @@ -50,9 +50,9 @@ public class ApprovalAction extends Page { new NamedCode(true,"content") { final Slot sAppr = gui.env.slot(ApprovalForm.NAME+'.'+ApprovalForm.FIELDS[0]); final Slot sUser = gui.env.slot(ApprovalForm.NAME+'.'+ApprovalForm.FIELDS[1]); - + @Override - public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { + public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() { @Override public void code(final AAF_GUI gui, final AuthzTrans trans,final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { @@ -62,7 +62,7 @@ public class ApprovalAction extends Page { if (user != null) { lastPage += "?user="+user; } - + if (appr==null) { hgen.p("No Approvals have been selected."); } else { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java index cb868b16..a5337369 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApprovalForm.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,8 +67,8 @@ public class ApprovalForm extends Page { static final String NAME="Approvals"; static final String HREF = "/gui/approve"; static final String[] FIELDS = new String[] {"line[]","user","delegate_of","as_user"}; - - + + public ApprovalForm(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, FIELDS, @@ -106,38 +106,38 @@ public class ApprovalForm extends Page { } }); } - + /** * Implement the Table Content for Approvals - * + * * @author Jonathan * */ private static class Model extends TableData<AAF_GUI,AuthzTrans> { //TODO come up with a generic way to do ILM Info (people page) // private static final String TODO_ILM_INFO = "TODO: ILM Info"; - - + + private static final String[] headers = new String[] {"Identity","Request","Approve","Deny"}; private Slot sUser; private Slot sAsDelegate; private Slot sAsUser; - + public Model(AuthzEnv env) { sUser = env.slot(NAME+".user"); sAsDelegate = env.slot(NAME+".delegate_of"); sAsUser = env.slot(NAME + ".as_user"); } - + @Override public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final String userParam = trans.get(sUser, null); - + final String asDelegate = trans.get(sAsDelegate, null); final String approver; if(asDelegate==null) { @@ -145,7 +145,7 @@ public class ApprovalForm extends Page { } else { approver = asDelegate; } - + ArrayList<AbsCell[]> rv = new ArrayList<>(); String msg = null; TimeTaken tt = trans.start("AAF Get Approvals for Approver",Env.REMOTE); @@ -158,7 +158,7 @@ public class ApprovalForm extends Page { Future<Approvals> fa = client.read("/authz/approval/approver/"+approver,gui.getDF(Approvals.class)); int numLeft = 0; if (fa.get(AAF_GUI.TIMEOUT)) { - + if (fa.value!=null) { for (Approval appr : fa.value.getApprovals()) { if ("pending".equals(appr.getStatus())) { @@ -170,10 +170,10 @@ public class ApprovalForm extends Page { } } } - + String prevApprover = null; int overallIndex = 0; - + for (Approval appr : pendingApprovals) { String currApprover = appr.getApprover(); if (!currApprover.equals(prevApprover)) { @@ -186,7 +186,7 @@ public class ApprovalForm extends Page { return numLeft; } }); - + if (!pendingApprovals.isEmpty()) { // Only add select all links if we have approvals AbsCell[] selectAllRow = new AbsCell[] { @@ -197,14 +197,14 @@ public class ApprovalForm extends Page { }; rv.add(selectAllRow); } - + int line=-1; - + while (!beginIndicesPerApprover.isEmpty()) { int beginIndex = beginIndicesPerApprover.remove(0); int endIndex = (beginIndicesPerApprover.isEmpty()?pendingApprovals.size():beginIndicesPerApprover.get(0)); List<Approval> currApproverList = pendingApprovals.subList(beginIndex, endIndex); - + Identity iapprover = trans.org().getIdentity(trans,currApproverList.get(0).getApprover()); if(iapprover==null) { rv.add(new AbsCell[] { @@ -213,25 +213,25 @@ public class ApprovalForm extends Page { }); } else { if (!iapprover.fullID().equals(trans.user())) { - + AbsCell[] approverHeader; // if (domainOfUser.equals(domainOfApprover)) { - // approverHeader = new AbsCell[] { + // approverHeader = new AbsCell[] { // new TextAndRefCell("Approvals Delegated to Me by ", currApproverFull, - // TODO_ILM_INFO + currApproverShort, + // TODO_ILM_INFO + currApproverShort, // true, // new String[] {"colspan=4", "class=head"}) // }; // } else { - approverHeader = new AbsCell[] { - new TextCell("Approvals Delegated to Me by " + iapprover.fullName() + approverHeader = new AbsCell[] { + new TextCell("Approvals Delegated to Me by " + iapprover.fullName() + '(' + iapprover.id() + ')', new String[] {"colspan=4", "class=head"}) }; // } rv.add(approverHeader); } - + // Sort by User Requesting Collections.sort(currApproverList, new Comparator<Approval>() { @Override @@ -239,16 +239,16 @@ public class ApprovalForm extends Page { return a1.getUser().compareTo(a2.getUser()); } }); - + String prevUser = null; boolean userOK=true; for (Approval appr : currApproverList) { if (++line<MAX_LINE) { // limit number displayed at one time. AbsCell userCell; String user = appr.getUser(); - + if (user.equals(prevUser)) { - userCell = AbsCell.Null; + userCell = AbsCell.Null; } else if (user.endsWith(trans.org().getRealm())){ userOK=true; String title; @@ -266,7 +266,7 @@ public class ApprovalForm extends Page { if (managedBy==null) { title ="Identity: " + au.type(); } else { - title="Sponsor: " + managedBy.fullName(); + title="Sponsor: " + managedBy.fullName(); } userCell = new TextToolTipCell(au.fullID(),title); } @@ -280,7 +280,7 @@ public class ApprovalForm extends Page { // TODO_ILM_INFO+user.substring(0, user.length()-domainOfApprover.length()), // true, // title); - + } else { userCell = new TextCell(user); } @@ -302,7 +302,7 @@ public class ApprovalForm extends Page { } if (rv.isEmpty()) { if (numLeft>0) { - msg = "No Approvals to process at this time for user " + userParam +". You have " + msg = "No Approvals to process at this time for user " + userParam +". You have " + numLeft + " other approvals to process."; } else { msg = "No Approvals to process at this time"; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeAction.java index c6821199..8f3fe958 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeAction.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 @@ public class CMArtiChangeAction extends Page { final Slot sOther = gui.env.slot(CMArtiChangeForm.NAME+'.'+CMArtiChangeForm.fields[9]); final Slot sType = gui.env.slot(CMArtiChangeForm.NAME+'.'+CMArtiChangeForm.fields[10]); final Slot sSans = gui.env.slot(CMArtiChangeForm.NAME+'.'+CMArtiChangeForm.fields[11]); - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() { @@ -83,7 +83,7 @@ public class CMArtiChangeAction extends Page { arti.getSans().add(s); } } - + // These checks to not apply to deletions if(!CMArtiChangeForm.DELETE.equals(trans.get(sCmd, ""))) { // Disallow IP entries, except by special Permission @@ -105,9 +105,9 @@ public class CMArtiChangeAction extends Page { return; } } - + } - + arti.setMechid((String)trans.get(sID,null)); arti.setMachine(machine); arti.setNs((String)trans.get(sNS,null)); @@ -128,11 +128,11 @@ public class CMArtiChangeAction extends Page { hgen.p("Data Entry Failure: Please enter a valid ID, including domain."); // VALIDATE OTHERS? } else { // everything else is checked by Server - + try { final Artifacts artifacts = new Artifacts(); artifacts.getArtifact().add(arti); - final Holder<Boolean> ok = new Holder<Boolean>(false); + final Holder<Boolean> ok = new Holder<Boolean>(false); final Holder<Boolean> deleted = new Holder<Boolean>(false); Future<?> f = gui.cmClientAsUser(trans.getUserPrincipal(), new Retryable<Future<?>>() { @Override @@ -221,7 +221,7 @@ public class CMArtiChangeAction extends Page { hgen.p("Unknown Error"); e.printStackTrace(); } - + } hgen.br(); } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeForm.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeForm.java index ee55fdbc..9df54107 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeForm.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtiChangeForm.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. @@ -55,18 +55,18 @@ import certman.v1_0.Artifacts.Artifact; public class CMArtiChangeForm extends Page { private static final String COPY_ARTIFACT = "copyArtifact"; private static final String DELETE_ARTIFACT = "deleteArtifact"; - + // Package on purpose static final String HREF = "/gui/artichange"; static final String NAME = "ArtifactChange"; static final String fields[] = {"id","machine","ns","directory","ca","osuser","renewal","notify","cmd","others","types[]","sans"}; - + static final String types[] = {"pkcs12","jks","file","script"}; static final String UPDATE = "Update"; static final String CREATE = "Create"; static final String COPY = "Copy"; static final String DELETE = "Delete"; - + public CMArtiChangeForm(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, fields, new BreadCrumbs(breadcrumbs), @@ -74,7 +74,7 @@ public class CMArtiChangeForm extends Page { private final Slot sID = gui.env.slot(CMArtiChangeForm.NAME+'.'+CMArtiChangeForm.fields[0]); private final Slot sMach = gui.env.slot(CMArtiChangeForm.NAME+'.'+CMArtiChangeForm.fields[1]); private final Slot sNS = gui.env.slot(CMArtiChangeForm.NAME+'.'+CMArtiChangeForm.fields[2]); - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { Mark js = new Mark(); @@ -121,7 +121,7 @@ public class CMArtiChangeForm extends Page { hgen.leaf(HTMLGen.TITLE).text("Certificate Artifact Form").end(); Mark form = new Mark(); hgen.incr(form, "form","action="+HREF,"method=post"); - + cache.dynamic(hgen, new DynamicCode<HTMLGen, AAF_GUI, AuthzTrans>() { @Override public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { @@ -199,7 +199,7 @@ public class CMArtiChangeForm extends Page { } sb.append(s); } - + hgen.text("IPs allowed, separated by commas.").end() .input(fields[11], "SANs", false, "value="+(sb==null?"":sb.toString()),"style=width:130%;"); // } @@ -215,7 +215,7 @@ public class CMArtiChangeForm extends Page { for (int i=0;i<types.length;++i) { hgen.leaf("input","type=checkbox","name=types."+i,arti.getType().contains(types[i])?"checked":"").text(types[i]).end().br(); } - + Mark tr = new Mark(); hgen.incr(tr,HTMLGen.TR).incr(HTMLGen.TD,"id=trcopy") .leaf("input","id=cbcopy","type=checkbox","onclick="+COPY_ARTIFACT+"()").text("Copy Artifact").end(2) @@ -228,10 +228,10 @@ public class CMArtiChangeForm extends Page { .leaf("input","id=cbdelete","type=checkbox","onclick="+DELETE_ARTIFACT+"()",delete?"style:display:none;":"").text("Delete Artifact").end(2) .end(tr); hgen.end(table); - + hgen.tagOnly("input","id="+fields[8],"name="+fields[8],"value="+submitText,"style=display:none;"); hgen.tagOnly("input","id=theButton","type=submit", "orig="+submitText,"value="+submitText); - + } catch (CadiException | LocatorException | OrganizationException e) { throw new APIException(e); } @@ -241,6 +241,6 @@ public class CMArtiChangeForm extends Page { hgen.end(form); } }); - + } } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java index 85797cb5..2362951b 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.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. @@ -63,7 +63,7 @@ import certman.v1_0.Artifacts.Artifact; import certman.v1_0.CertInfo; public class CMArtifactShow extends Page { - + public static final String HREF = "/gui/cmarti"; public static final String NAME = "ArtifactsShow"; private static ArtiTable arti; @@ -72,14 +72,14 @@ public class CMArtifactShow extends Page { public CMArtifactShow(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), arti = new ArtiTable(gui.env) ); // Setting so we can get access to HTMLGen clone and Slots arti.set(this,slotCode); } - + private static class ArtiTable extends Table<AAF_GUI, AuthzTrans> { private static Model model; private SlotCode<AuthzTrans> sc; @@ -108,13 +108,13 @@ public class CMArtifactShow extends Page { } },"class=std"); } - + public void set(CMArtifactShow cmArtifactShow, SlotCode<AuthzTrans> sc) { this.sc = sc; model.set(cmArtifactShow,sc); } - + @Override protected String title(AuthzTrans trans) { StringBuilder sb = new StringBuilder("X509 Certificates"); @@ -132,7 +132,7 @@ public class CMArtifactShow extends Page { } /** * Implement the table content for Cred Detail - * + * * @author Jeremiah * */ @@ -151,7 +151,7 @@ public class CMArtifactShow extends Page { public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { String str = sc.get(trans,Params.id, null); @@ -167,7 +167,7 @@ public class CMArtifactShow extends Page { public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException { Future<CertInfo> fuCI = client.read("/cert/id/"+id,gui.certInfoDF); Future<Artifacts> fuArt = client.read("/cert/artifacts?mechid="+id, gui.artifactsDF); - + X509Certificate[] lc; if (fuCI.get(AAFcli.timeout())) { TimeTaken tt1 = trans.start("x509Certificate", Env.SUB); @@ -214,7 +214,7 @@ public class CMArtifactShow extends Page { } rv.add(new AbsCell[] { - new TextCell(arti.getMachine(),"style=width:20%;"), + new TextCell(arti.getMachine(),"style=width:20%;"), new TextCell(arti.getDir(),"style=width:25%;"), new TextCell(arti.getCa(),"style=width:2%;text-align:center;"), new TextCell(renew==null? @@ -247,5 +247,5 @@ public class CMArtifactShow extends Page { } } - + } 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..07aa99a6 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<AAF_GUI,AuthzTrans>("Cred Details",gui.env.newTransNoAvg(),model = new Model(), slotCode = new SlotCode<AuthzTrans>(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<HTMLGen> cache, final HTMLGen hgen) { } @@ -150,7 +150,7 @@ public class CredDetail extends Page { } final ArrayList<AbsCell[]> rv = new ArrayList<>(); final TimeTaken tt = trans.start("AAF Cred Details",Env.REMOTE); - List<Artifact> la; + List<Artifact> la; try { la = gui.cmClientAsUser(trans.getUserPrincipal(), new Retryable<List<Artifact>>() { @Override @@ -177,11 +177,11 @@ public class CredDetail extends Page { if (fu.get(AAFcli.timeout())) { // Organize User entries Map<String,List<Map<Integer,List<User>>>> users = new HashMap<>(); - + List<Map<Integer,List<User>>> lmu=null; Map<Integer, List<User>> mu = null; List<User> lu = null; - + for (User u : fu.value.getUser()) { if (u.getType() == 200) { lns.remove(u.getId()); @@ -196,11 +196,11 @@ public class CredDetail extends Page { mu = xmu; } } - + if (mu==null) { lmu.add(mu=new HashMap<>()); } - + lu = mu.get(u.getType()); if (lu==null) { mu.put(u.getType(),lu = new ArrayList<>()); @@ -215,7 +215,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 +226,7 @@ public class CredDetail extends Page { Mark uRow = new Mark(); String cls; boolean first = true; - + for ( Entry<Integer, List<User>> es : miu.entrySet()) { Collections.sort(es.getValue(),new Comparator<User>() { @Override @@ -256,8 +256,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 +266,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+ @@ -284,7 +284,7 @@ public class CredDetail extends Page { hgen.end().leaf(HTMLGen.TD,cls,STYLE_WIDTH_70) .text(Chrono.niceDateStamp(u.getExpires())) .end(); - + hgen.end(uRow); } } @@ -305,15 +305,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) }); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredHistory.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredHistory.java index 7e3962ec..af26a430 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredHistory.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredHistory.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. @@ -61,7 +61,7 @@ public class CredHistory extends Page { static final String HREF = "/gui/credHistory"; static final String FIELDS[] = {"user","dates"}; - + public CredHistory(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, FIELDS, new BreadCrumbs(breadcrumbs), @@ -74,24 +74,24 @@ public class CredHistory extends Page { @Override public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { String obUser = trans.get(user, null); - + // Use Javascript to make the table title more descriptive hgen.js() .text("var caption = document.querySelector(\".title\");") - .text("caption.innerHTML='History for User [ " + obUser + " ]';") + .text("caption.innerHTML='History for User [ " + obUser + " ]';") .done(); - + // Use Javascript to change Link Target to our last visited Detail page String lastPage = CredDetail.HREF + "?role=" + obUser; hgen.js() - .text("alterLink('roledetail', '"+lastPage + "');") + .text("alterLink('roledetail', '"+lastPage + "');") .done(); - + hgen.br(); hgen.leaf("a", "href=#advanced_search","onclick=divVisibility('advanced_search');","class=greenbutton").text("Advanced Search").end() .divID("advanced_search", "style=display:none"); hgen.incr("table"); - + addDateRow(hgen,"Start Date"); addDateRow(hgen,"End Date"); hgen.incr("tr").incr("td"); @@ -106,9 +106,9 @@ public class CredHistory extends Page { } ); - + } - + private static void addDateRow(HTMLGen hgen, String s) { hgen .incr("tr") @@ -129,16 +129,16 @@ public class CredHistory extends Page { .end() .incr("td") .tagOnly("input","type=number","id=year"+s.substring(0, s.indexOf(' ')),"required", - "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", + "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", "max="+Calendar.getInstance().get(Calendar.YEAR), "placeholder=Year").end() .end(); } - - + + /** * Implement the Table Content for History - * + * * @author Jonathan * */ @@ -146,25 +146,25 @@ public class CredHistory extends Page { private static final String[] headers = new String[] {"Date","User","Memo"}; private Slot user; private Slot dates; - + public Model(AuthzEnv env) { user = env.slot(NAME+".user"); dates = env.slot(NAME+".dates"); } - + @Override public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final String oName = trans.get(user,null); final String oDates = trans.get(dates,null); - + Cells rv = Cells.EMPTY; if (oName!=null) { - + try { rv = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Cells>() { @Override @@ -181,14 +181,14 @@ public class CredHistory extends Page { tt.done(); tt = trans.start("Load History Data", Env.SUB); List<Item> histItems = fh.value.getItem(); - + java.util.Collections.sort(histItems, new Comparator<Item>() { @Override public int compare(Item o1, Item o2) { return o2.getTimestamp().compare(o1.getTimestamp()); } }); - + for (Item i : histItems) { String user = i.getUser(); AbsCell userCell = new TextCell(user); @@ -209,7 +209,7 @@ public class CredHistory extends Page { } } finally { tt.done(); - } + } return new Cells(rv,msg); } }); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/Home.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/Home.java index 3553da2b..7ac17ef5 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/Home.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/Home.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. @@ -37,7 +37,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class Home extends Page { public static final String HREF = "/gui/home"; - + public Home(final AAF_GUI gui) throws APIException, IOException { super(gui.env,"Home",HREF, NO_FIELDS, new NamedCode(false,"content") { @Override @@ -63,5 +63,5 @@ public class Home extends Page { } }); } - + } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLanding.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLanding.java index 3fd69aca..aa10289c 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLanding.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLanding.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. @@ -42,16 +42,16 @@ public class LoginLanding extends Page { static final String NAME = "Login"; static final String fields[] = {"id","password","environment"}; static final String envs[] = {"DEV","TEST","PROD"}; - + public LoginLanding(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env, NAME,HREF, fields, new NamedCode(true, "content") { @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { hgen.leaf("p").text("No login credentials are found in your current session. " + "Choose your preferred login option to continue.").end(); - + Mark loginPaths = hgen.divID("Pages"); - + cache.dynamic(hgen, new DynamicCode<HTMLGen, AAF_GUI, AuthzTrans>() { @Override public void code(AAF_GUI authGUI, AuthzTrans trans, Cache<HTMLGen> cache, HTMLGen xgen) throws APIException, IOException { @@ -74,13 +74,13 @@ public class LoginLanding extends Page { // .incr("p", "id=tguard","style=display:none").text("this will redirect to tGuard login").end() // hgen.leaf("a", "href=#","onclick=divVisibility('basicauth');").text("AAF Basic Auth").end(); hgen.end(loginPaths); - + // hgen.incr("form","method=post","style=display:none","id=basicauth","gui/home?Authentication=BasicAuth"); // Mark table = new Mark(TABLE); // hgen.incr(table); // cache.dynamic(hgen, new DynamicCode<HTMLGen, AuthGUI, AuthzTrans>() { // @Override -// public void code(final AuthGUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) +// public void code(final AuthGUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) // throws APIException, IOException { // hgen // .input(fields[0],"Username",true) @@ -97,9 +97,9 @@ public class LoginLanding extends Page { // for (String env : envs) { // hgen.incr("option", "value="+env).text(env).end(); // } -// hgen -// .end(selectRow) - +// hgen +// .end(selectRow) + // hgen.end(); // } // }); @@ -107,7 +107,7 @@ public class LoginLanding extends Page { // hgen.tagOnly("input", "type=submit", "value=Submit") // .tagOnly("input", "type=reset", "value=Reset") // .end(); - + } }); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLandingAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLandingAction.java index f20caebb..0c5979ec 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLandingAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/LoginLandingAction.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. @@ -41,7 +41,7 @@ public class LoginLandingAction extends Page { new NamedCode(true,"content") { final Slot sID = gui.env.slot(LoginLanding.NAME+'.'+LoginLanding.fields[0]); // final Slot sPassword = gui.env.slot(LoginLanding.NAME+'.'+LoginLanding.fields[1]); - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() { @@ -52,11 +52,11 @@ public class LoginLandingAction extends Page { hgen.p("User: "+username); hgen.p("Pass: ********"); - + // TODO: clarification from JG // put in request header? // then pass through authn/basicAuth call? - + } }); } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java index 6b1c6120..38e7e2a0 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.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. @@ -58,7 +58,7 @@ import aaf.v2_0.Role; import aaf.v2_0.Roles; public class NsDetail extends Page { - + public static final String HREF = "/gui/nsdetail"; public static final String NAME = "NsDetail"; public static enum NS_FIELD { OWNERS, ADMINS, ROLES, PERMISSIONS, CREDS}; @@ -69,7 +69,7 @@ public class NsDetail extends Page { public NsDetail(final AAF_GUI gui, Page ... breadcrumbs) throws APIException, IOException { - super(gui.env, NAME, HREF, new String[] {"ns"}, + super(gui.env, NAME, HREF, new String[] {"ns"}, new BreadCrumbs(breadcrumbs), new Table<AAF_GUI,AuthzTrans>("Namespace Details",gui.env.newTransNoAvg(),model=new Model(),"class=detail") ); @@ -85,7 +85,7 @@ public class NsDetail extends Page { /** * Implement the table content for Namespace Detail - * + * * @author Jeremiah * */ @@ -123,11 +123,11 @@ public class NsDetail extends Page { tt.done(); try { // TimeTaken tt = trans.start("Load Data", Env.SUB); - + for (Ns n : fn.value.getNs()) { String desc = (n.getDescription()!=null?n.getDescription():BLANK); rv.add(new AbsCell[]{new TextCell("Description:"),new TextCell(desc)}); - + addField(trans, nsName, rv, n.getAdmin(), NS_FIELD.ADMINS); addField(trans, nsName, rv, n.getResponsible(), NS_FIELD.OWNERS); @@ -138,10 +138,10 @@ public class NsDetail extends Page { new TextCell("Credentials"), new TextCell(sw.toString()) }); - - + + Future<Roles> fr = client.read( - "/authz/roles/ns/"+nsName, + "/authz/roles/ns/"+nsName, gui.getDF(Roles.class) ); List<String> roles = new ArrayList<>(); @@ -151,14 +151,14 @@ public class NsDetail extends Page { } } addField(trans, nsName, rv, roles, NS_FIELD.ROLES); - - + + Future<Perms> fp = client.read( - "/authz/perms/ns/"+nsName, + "/authz/perms/ns/"+nsName, gui.getDF(Perms.class) ); List<String> perms = new ArrayList<>(); - + if (fp.get(AAFcli.timeout())) { for (Perm p : fp.value.getPerm()) { perms.add(p.getType() + "|" + p.getInstance() + "|" + p.getAction()); @@ -166,7 +166,7 @@ public class NsDetail extends Page { } addField(trans, nsName, rv, perms, NS_FIELD.PERMISSIONS); } - String historyLink = NsHistory.HREF + String historyLink = NsHistory.HREF + "?name=" + nsName; rv.add(new AbsCell[] {new RefCell("See History",historyLink,false,"class=greenbutton")}); } finally { @@ -197,7 +197,7 @@ public class NsDetail extends Page { String user = values.get(i); AbsCell userCell = (new TextCell(user)); rv.add(new AbsCell[] { - label, + label, userCell }); } @@ -217,14 +217,14 @@ public class NsDetail extends Page { AbsCell label = (i==0?new TextCell(sentenceCase(field)+":","style=width:20%"):AbsCell.Null); String perm = values.get(i); String[] fields = perm.split("\\|"); - String grantLink = locate_url + String grantLink = locate_url + PermGrantForm.HREF + "?type=" + fields[0].trim() + "&instance=" + fields[1].trim() + "&action=" + fields[2].trim(); - + rv.add(new AbsCell[] { - label, + label, new TextCell(perm,"style=width:60%;"), new RefCell("Grant", grantLink,false,"class=button","style=width:20%;") }); @@ -239,6 +239,6 @@ public class NsDetail extends Page { String sField = field.toString(); return sField.substring(0, 1).toUpperCase() + sField.substring(1).toLowerCase(); } - + } } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java index dc9119bf..6994a2c8 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.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. @@ -58,9 +58,9 @@ public class NsHistory extends Page { static final String NAME="NsHistory"; static final String HREF = "/gui/nsHistory"; static final String FIELDS[] = {"name","dates"}; - static enum Month { JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, + static enum Month { JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER }; - + public NsHistory(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, FIELDS, new BreadCrumbs(breadcrumbs), @@ -73,24 +73,24 @@ public class NsHistory extends Page { @Override public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { String obName = trans.get(name, null); - + // Use Javascript to make the table title more descriptive hgen.js() .text("var caption = document.querySelector(\".title\");") - .text("caption.innerHTML='History for Namespace [ " + obName + " ]';") + .text("caption.innerHTML='History for Namespace [ " + obName + " ]';") .done(); - + // Use Javascript to change Link Target to our last visited Detail page String lastPage = NsDetail.HREF + "?name=" + obName; hgen.js() - .text("alterLink('nsdetail', '"+lastPage + "');") + .text("alterLink('nsdetail', '"+lastPage + "');") .done(); - + hgen.br(); hgen.leaf("a","href=#advanced_search","onclick=divVisibility('advanced_search');","class=greenbutton").text("Advanced Search").end() .divID("advanced_search", "style=display:none"); hgen.incr("table"); - + addDateRow(hgen,"Start Date"); addDateRow(hgen,"End Date"); hgen.incr("tr").incr("td"); @@ -99,7 +99,7 @@ public class NsHistory extends Page { hgen.end().end(); hgen.end(); hgen.end(); - + } }); } @@ -128,18 +128,18 @@ public class NsHistory extends Page { .end() .incr("td") .tagOnly("input","type=number","id=year"+s.substring(0, s.indexOf(' ')),"required", - "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", + "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", "max="+Calendar.getInstance().get(Calendar.YEAR), "placeholder=Year").end() .end(); } - - - + + + /** * Implement the Table Content for History - * + * * @author Jeremiah * */ @@ -147,26 +147,26 @@ public class NsHistory extends Page { private static final String[] headers = new String[] {"Date","User","Memo"}; private Slot name; private Slot dates; - + public Model(AuthzEnv env) { name = env.slot(NAME+".name"); dates = env.slot(NAME+".dates"); } - + @Override public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final String oName = trans.get(name,null); final String oDates = trans.get(dates,null); - + if (oName==null) { return Cells.EMPTY; } - + final ArrayList<AbsCell[]> rv = new ArrayList<>(); String msg = null; final TimeTaken tt = trans.start("AAF Get History for Namespace ["+oName+"]",Env.REMOTE); @@ -183,18 +183,18 @@ public class NsHistory extends Page { TimeTaken tt2 = trans.start("Load History Data", Env.SUB); try { List<Item> histItems = fh.value.getItem(); - + java.util.Collections.sort(histItems, new Comparator<Item>() { @Override public int compare(Item o1, Item o2) { return o2.getTimestamp().compare(o1.getTimestamp()); } }); - + for (Item i : histItems) { String user = i.getUser(); AbsCell userCell = new TextCell(user); - + String memo = i.getMemo().replace("<script>", "<script>").replace("</script>", "</script>"); rv.add(new AbsCell[] { new TextCell(i.getTimestamp().toGregorianCalendar().getTime().toString()), diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoAction.java index cb942c6c..c93d1562 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoAction.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. @@ -55,7 +55,7 @@ public class NsInfoAction extends Page { final Slot sPassword = gui.env.slot(PassChangeForm.NAME+'.'+PassChangeForm.fields[2]); final Slot sPassword2 = gui.env.slot(PassChangeForm.NAME+'.'+PassChangeForm.fields[3]); final Slot startDate = gui.env.slot(PassChangeForm.NAME+'.'+PassChangeForm.fields[4]); - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() { @@ -65,10 +65,10 @@ public class NsInfoAction extends Page { String currPass = trans.get(sCurrPass,null); final String password = trans.get(sPassword,null); String password2 = trans.get(sPassword2,null); - + // Run Validations boolean fail = true; - + if (id==null || id.indexOf('@')<=0) { hgen.p("Data Entry Failure: Please enter a valid ID, including domain."); } else if (password == null || password2 == null || currPass == null) { @@ -114,13 +114,13 @@ public class NsInfoAction extends Page { throw new CadiException(e); } } - + fcr = client.create( "/authn/cred", gui.getDF(CredRequest.class), cred ); - + if (fcr.get(5000)) { // Do Remote Call hgen.p("New Password has been added."); @@ -148,7 +148,7 @@ public class NsInfoAction extends Page { if (fail) { hgen.incr("a",true,"href="+PassChangeForm.HREF+"?id="+id).text("Try again").end(); } else { - hgen.incr("a",true,"href="+Home.HREF).text("Home").end(); + hgen.incr("a",true,"href="+Home.HREF).text("Home").end(); } } }); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoForm.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoForm.java index 2306a1a5..cdd97558 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoForm.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsInfoForm.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. @@ -55,7 +55,7 @@ public class NsInfoForm extends Page { static final String HREF = "/gui/onboard"; static final String NAME = "Onboarding"; static final String fields[] = {"ns","description","mots","owners","admins"}; - + public NsInfoForm(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, fields, new BreadCrumbs(breadcrumbs), @@ -79,7 +79,7 @@ public class NsInfoForm extends Page { public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { final String incomingID= trans.get(sID, ""); final String[] info = new String[fields.length]; - final Object own_adm[] = new Object[2]; + final Object own_adm[] = new Object[2]; for (int i=0;i<info.length;++i) { info[i]=""; } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java index 6f090a49..3c3c0ed3 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.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. @@ -55,13 +55,13 @@ public class NssShow extends Page { public NssShow(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env, "MyNamespaces",HREF, NO_FIELDS, - new BreadCrumbs(breadcrumbs), - new Table<AAF_GUI,AuthzTrans>("Namespaces I administer",gui.env.newTransNoAvg(),new Model(true,"Administrator",gui.env), + new BreadCrumbs(breadcrumbs), + new Table<AAF_GUI,AuthzTrans>("Namespaces I administer",gui.env.newTransNoAvg(),new Model(true,"Administrator",gui.env), "class=std", "style=display: inline-block; width: 45%; margin: 10px;"), new Table<AAF_GUI,AuthzTrans>("Namespaces I own",gui.env.newTransNoAvg(),new Model(false,"Owner",gui.env), "class=std", "style=display: inline-block; width: 45%; margin: 10px;")); } - + private static class Model extends TableData<AAF_GUI,AuthzTrans> { private String[] headers; private String privilege = null; @@ -80,7 +80,7 @@ public class NssShow extends Page { public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { ArrayList<AbsCell[]> rv = new ArrayList<>(); @@ -104,7 +104,7 @@ public class NssShow extends Page { } }); trans.put(sNssByUser,nss); - } + } } finally { tt.done(); } @@ -120,7 +120,7 @@ public class NssShow extends Page { tt.done(); } } - + if (nss!=null) { for (Ns n : nss) { if ((isAdmin && !n.getAdmin().isEmpty()) @@ -137,6 +137,6 @@ public class NssShow extends Page { return new Cells(rv,null); } } - + } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeAction.java index 10af074a..4fbce006 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeAction.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. @@ -65,7 +65,7 @@ public class PassChangeAction extends Page { final Slot sPassword2 = gui.env.slot(PassChangeForm.NAME+'.'+PassChangeForm.fields[3]); final Slot startDate = gui.env.slot(PassChangeForm.NAME+'.'+PassChangeForm.fields[4]); final Slot sNS = gui.env.slot(PassChangeForm.NAME+'.'+PassChangeForm.fields[5]); - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() { @@ -76,10 +76,10 @@ public class PassChangeAction extends Page { final String password = trans.get(sPassword,null); final String password2 = trans.get(sPassword2,null); final String ns = trans.get(sNS, null); - + // Run Validations boolean fail = true; - + if (id==null || id.indexOf('@')<=0) { hgen.p("Data Entry Failure: Please enter a valid ID, including domain."); } else if (password == null || password2 == null) { @@ -121,7 +121,7 @@ public class PassChangeAction extends Page { } return true; // no existing, no expired password } else { - if (fc.code()==404) { // not found... + if (fc.code()==404) { // not found... return true; } else { trans.error().log(gui.aafCon.readableErrMsg(fc)); @@ -169,7 +169,7 @@ public class PassChangeAction extends Page { throw new CadiException(e); } } - + Future<CredRequest> fcr = gui.clientAsUser(trans.getUserPrincipal()).create("/authn/cred",gui.getDF(CredRequest.class),cred); if (fcr.get(AAFcli.timeout())) { // Do Remote Call @@ -182,16 +182,16 @@ public class PassChangeAction extends Page { } finally { tt.done(); } - } + } return fail; } - + }); } catch (Exception e) { hgen.p("Unknown Error"); e.printStackTrace(); } - + } hgen.br(); if (fail) { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeForm.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeForm.java index 499c02dd..5b98d018 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeForm.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassChangeForm.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. @@ -56,15 +56,15 @@ public class PassChangeForm extends Page { static final String HREF = "/gui/passwd"; static final String NAME = "PassChange"; static final String fields[] = {"id","current","password","password2","startDate","ns"}; - + public PassChangeForm(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, fields, new BreadCrumbs(breadcrumbs), - new NamedCode(true,NAME) { + new NamedCode(true,NAME) { private final Slot sID = gui.env.slot(PassChangeForm.NAME+'.'+PassChangeForm.fields[0]); @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { - + // p tags not closing right using .p() - causes issues in IE8 password form - so using leaf for the moment hgen.incr(HTMLGen.H4,true,"style=margin: 0em 0em .4em 0em") .text("You are <i>adding</i> a New Password in the AAF System.") @@ -72,7 +72,7 @@ public class PassChangeForm extends Page { Mark form = new Mark(); hgen.incr(form,"form","method=post"); - + Mark table = new Mark(TABLE); hgen.incr(table); @@ -96,7 +96,7 @@ public class PassChangeForm extends Page { } else { // Owners/or the IDs themselves are allowed to reset password without previous one skipCurrent=skipCurrent(trans, user); - + if (!skipCurrent) { final String id = incomingID; try { @@ -113,7 +113,7 @@ public class PassChangeForm extends Page { } return true; // no existing, no expired password } else { - if (fc.code()==404) { // not found... + if (fc.code()==404) { // not found... return true; } else { trans.error().log(gui.aafCon.readableErrMsg(fc)); @@ -127,13 +127,13 @@ public class PassChangeForm extends Page { } } } - } + } } catch (OrganizationException e) { hgen.incr(HTMLGen.H4,"style=color:red;").text("Error: ") .text(e.getMessage()).end(); } } - + hgen.input(fields[0],"ID*",true,"value="+incomingID,(incomingID.length()==0?"":"readonly")); if (!skipCurrent) { hgen.input(fields[1],"Current Password*",true,"type=password"); @@ -159,7 +159,7 @@ public class PassChangeForm extends Page { "This allows you to migrate services to this new password until the old ones expire.").br().br() .p("Note: You must be an Admin of the Namespace where the MechID is defined.").br() ; - + Mark div = hgen.divID("passwordRules"); cache.dynamic(hgen, new DynamicCode<HTMLGen, AAF_GUI, AuthzTrans>() { @Override diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassDeleteAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassDeleteAction.java index f66e8bcb..76aef6e2 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassDeleteAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PassDeleteAction.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. @@ -46,7 +46,7 @@ public class PassDeleteAction extends Page { public static final String NAME = "PassDeleteAction"; public static final String HREF = "/gui/passdelete"; private static enum Params{id,date,ns,type}; - + public PassDeleteAction(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF,Params.values(), new BreadCrumbs(breadcrumbs), diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.java index 585a75ae..b528b24b 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.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. @@ -62,10 +62,10 @@ public class PendingRequestsShow extends Page { public static final String NAME = "MyRequests"; private static final String[] FIELDS = new String[] {"as_user"}; // as_user Checked in Display private static final String AS_USER=NAME+".as_user"; - + public PendingRequestsShow(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env, NAME,HREF, FIELDS, - new BreadCrumbs(breadcrumbs), + new BreadCrumbs(breadcrumbs), new TopOfPage(gui.env,true, "expedite"), new Table<AAF_GUI,AuthzTrans>("Pending Requests",gui.env.newTransNoAvg(),new Model(gui.env), "class=std") ); @@ -98,7 +98,7 @@ public class PendingRequestsShow extends Page { .leaf("a","href=#expedite_directions","onclick=divVisibility('expedite_directions');") .text("Click Here").end() .divID("expedite_directions", "style=display:none"); - + hgen .incr(HTMLGen.OL) .incr(HTMLGen.LI) @@ -120,7 +120,7 @@ public class PendingRequestsShow extends Page { /** * Implement the Table Content for Requests by User - * + * * @author Jeremiah * */ @@ -137,7 +137,7 @@ public class PendingRequestsShow extends Page { public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final ArrayList<AbsCell[]> rv = new ArrayList<>(); @@ -163,12 +163,12 @@ public class PendingRequestsShow extends Page { return id1.timestamp()<=id2.timestamp()?1:-1; } }); - + String prevTicket = null; for (Approval a : approvals) { String approver = a.getApprover(); // String approverShort = approver.substring(0,approver.indexOf('@')); - + AbsCell tsCell = null; String ticket = a.getTicket(); if (ticket==null || ticket.equals(prevTicket)) { @@ -180,7 +180,7 @@ public class PendingRequestsShow extends Page { RequestDetail.HREF + "?ticket=" + ticket,false); prevTicket = ticket; } - + AbsCell approverCell = new TextCell(approver); AbsCell[] sa = new AbsCell[] { tsCell, diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.java index 4a5a940a..00bec4cd 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.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. @@ -53,7 +53,7 @@ import aaf.v2_0.Perms; /** * Detail Page for Permissions - * + * * @author Jonathan * */ @@ -71,7 +71,7 @@ public class PermDetail extends Page { /** * Implement the table content for Permissions Detail - * + * * @author Jonathan * */ @@ -91,7 +91,7 @@ public class PermDetail extends Page { v.permTypeWithUser(trans.user(),pType) .permInstance(pInstance) .permAction(pAction); - + if (v.err()) { trans.warn().printf("Error in PermDetail Request: %s", v.errs()); return Cells.EMPTY; @@ -107,7 +107,7 @@ public class PermDetail extends Page { TimeTaken tt = trans.start("AAF Perm Details",Env.REMOTE); try { Future<Perms> fp= client.read("/authz/perms/"+pType + '/' + pInstance + '/' + pAction,gui.getDF(Perms.class)); - + if (fp.get(AAF_GUI.TIMEOUT)) { tt.done(); tt = trans.start("Load Data", Env.SUB); @@ -132,9 +132,9 @@ public class PermDetail extends Page { } } } - String historyLink = PermHistory.HREF + String historyLink = PermHistory.HREF + "?type=" + pType + "&instance=" + pInstance + "&action=" + pAction; - + rv.add(new AbsCell[] {new RefCell("See History",historyLink,false,"class=greenbutton")}); } else { rv.add(new AbsCell[] {new TextCell( @@ -156,5 +156,5 @@ public class PermDetail extends Page { return new Cells(rv,null); } } -} +}
\ No newline at end of file diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantAction.java index 9d53c535..4512e473 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantAction.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. @@ -45,8 +45,8 @@ import aaf.v2_0.Pkey; import aaf.v2_0.RolePermRequest; public class PermGrantAction extends Page { - - + + public PermGrantAction(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,PermGrantForm.NAME, PermGrantForm.HREF, PermGrantForm.fields, new BreadCrumbs(breadcrumbs), @@ -55,7 +55,7 @@ public class PermGrantAction extends Page { final Slot sInstance = gui.env.slot(PermGrantForm.NAME+'.'+PermGrantForm.fields[1]); final Slot sAction = gui.env.slot(PermGrantForm.NAME+'.'+PermGrantForm.fields[2]); final Slot sRole = gui.env.slot(PermGrantForm.NAME+'.'+PermGrantForm.fields[3]); - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() { @@ -66,16 +66,16 @@ public class PermGrantAction extends Page { String instance = trans.get(sInstance,null); String action = trans.get(sAction,null); String role = trans.get(sRole,null); - - String lastPage = PermGrantForm.HREF + + String lastPage = PermGrantForm.HREF + "?type=" + type + "&instance=" + instance + "&action=" + action; - + // Run Validations boolean fail = true; - + TimeTaken tt = trans.start("AAF Grant Permission to Role",Env.REMOTE); try { - + final RolePermRequest grantReq = new RolePermRequest(); Pkey pkey = new Pkey(); pkey.setType(type); @@ -83,7 +83,7 @@ public class PermGrantAction extends Page { pkey.setAction(action); grantReq.setPerm(pkey); grantReq.setRole(role); - + fail = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Boolean>() { @Override public Boolean code(Rcli<?> client) throws CadiException, ConnectException, APIException { @@ -114,7 +114,7 @@ public class PermGrantAction extends Page { } finally { tt.done(); } - + hgen.br(); hgen.incr("a",true,"href="+lastPage); if (fail) { @@ -124,7 +124,7 @@ public class PermGrantAction extends Page { } hgen.end(); hgen.js() - .text("alterLink('permgrant', '"+lastPage + "');") + .text("alterLink('permgrant', '"+lastPage + "');") .done(); } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java index 71958060..ac9cdf1e 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.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. @@ -53,7 +53,7 @@ public class PermGrantForm extends Page { static final String HREF = "/gui/permgrant"; static final String NAME = "Permission Grant"; static final String fields[] = {"type","instance","action","role"}; - + public PermGrantForm(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, fields, new BreadCrumbs(breadcrumbs), @@ -72,7 +72,7 @@ public class PermGrantForm extends Page { cache.dynamic(hgen, new DynamicCode<HTMLGen, AAF_GUI, AuthzTrans>() { @Override public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { - + Mark copyRoleJS = new Mark(); hgen.js(copyRoleJS); hgen.text("function copyRole(role) {"); @@ -81,7 +81,7 @@ public class PermGrantForm extends Page { hgen.text("txtRole.value=role;"); hgen.text("}"); hgen.end(copyRoleJS); - + String typeValue = trans.get(type, ""); String instanceValue = trans.get(instance, ""); String actionValue = trans.get(action, ""); @@ -91,7 +91,7 @@ public class PermGrantForm extends Page { .input(fields[0],"Perm Type",true,"value="+typeValue,"disabled") .input(fields[1],"Perm Instance",true,"value="+instanceValue,"disabled") .input(fields[2],"Perm Action",true,"value="+actionValue,"disabled"); - + // select & options are not an input type, so we must create table row & cell tags Mark selectRow = new Mark(); hgen @@ -106,7 +106,7 @@ public class PermGrantForm extends Page { hgen.incr("option", "value="+role).text(role).end(); } hgen - .incr("option", "value=").text("Other").end() + .incr("option", "value=").text("Other").end() .end(selectRow); if (roleValue==null) { hgen.input(fields[3],"Role", true, "placeholder=or type a role here"); @@ -123,7 +123,7 @@ public class PermGrantForm extends Page { } }); } - + private static List<String> getMyRoles(final AAF_GUI gui, final AuthzTrans trans) { final List<String> myRoles = new ArrayList<>(); try { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.java index 4c3bd32e..4885827d 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.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. @@ -60,7 +60,7 @@ public class PermHistory extends Page { static final String NAME="PermHistory"; static final String HREF = "/gui/permHistory"; static final String FIELDS[] = {"type","instance","action","dates"}; - + public PermHistory(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, FIELDS, new BreadCrumbs(breadcrumbs), @@ -77,26 +77,26 @@ public class PermHistory extends Page { String type = trans.get(sType, null); String instance = trans.get(sInstance,null); String action = trans.get(sAction,null); - + // Use Javascript to make the table title more descriptive hgen.js() .text("var caption = document.querySelector(\".title\");") - .text("caption.innerHTML='History for Permission [ " + type + " ]';") + .text("caption.innerHTML='History for Permission [ " + type + " ]';") .done(); - + // Use Javascript to change Link Target to our last visited Detail page String lastPage = PermDetail.HREF + "?type=" + type + "&instance=" + instance + "&action=" + action; hgen.js() - .text("alterLink('permdetail', '"+lastPage + "');") + .text("alterLink('permdetail', '"+lastPage + "');") .done(); - + hgen.br(); hgen.leaf("a", "href=#advanced_search", "onclick=divVisibility('advanced_search');","class=greenbutton").text("Advanced Search").end() .divID("advanced_search", "style=display:none"); hgen.incr("table"); - + addDateRow(hgen,"Start Date"); addDateRow(hgen,"End Date"); hgen.incr("tr").incr("td"); @@ -113,9 +113,9 @@ public class PermHistory extends Page { } ); - + } - + private static void addDateRow(HTMLGen hgen, String s) { hgen .incr("tr") @@ -136,15 +136,15 @@ public class PermHistory extends Page { .end() .incr("td") .tagOnly("input","type=number","id=year"+s.substring(0, s.indexOf(' ')),"required", - "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", + "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", "max="+Calendar.getInstance().get(Calendar.YEAR), "placeholder=Year").end() .end(); } - + /** * Implement the Table Content for History - * + * * @author Jeremiah * */ @@ -152,26 +152,26 @@ public class PermHistory extends Page { private static final String[] headers = new String[] {"Date","User","Memo"}; private Slot sType; private Slot sDates; - + public Model(AuthzEnv env) { sType = env.slot(NAME+".type"); sDates = env.slot(NAME+".dates"); } - + @Override public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final String oName = trans.get(sType,null); final String oDates = trans.get(sDates,null); - + if (oName==null) { return Cells.EMPTY; } - + final ArrayList<AbsCell[]> rv = new ArrayList<>(); String msg = null; try { @@ -187,20 +187,20 @@ public class PermHistory extends Page { "/authz/hist/perm/"+oName, gui.getDF(History.class) ); - - + + if (fh.get(AAF_GUI.TIMEOUT)) { tt.done(); tt = trans.start("Load History Data", Env.SUB); List<Item> histItems = fh.value.getItem(); - + java.util.Collections.sort(histItems, new Comparator<Item>() { @Override public int compare(Item o1, Item o2) { return o2.getTimestamp().compare(o1.getTimestamp()); } }); - + for (Item i : histItems) { String user = i.getUser(); AbsCell userCell = new TextCell(user); @@ -211,7 +211,7 @@ public class PermHistory extends Page { new TextCell(memo) }); } - + } else { if (fh.code()==403) { rv.add(new AbsCell[] {new TextCell("You may not view History of Permission [" + oName + "]", "colspan = 3", "class=center")}); @@ -226,7 +226,7 @@ public class PermHistory extends Page { return null; } }); - + } catch (Exception e) { trans.error().log(e); } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java index 7dff0815..ad2c5b02 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.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. @@ -48,22 +48,22 @@ import aaf.v2_0.Perms; /** * Page content for My Permissions - * + * * @author Jonathan * */ public class PermsShow extends Page { public static final String HREF = "/gui/myperms"; - + public PermsShow(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env, "MyPerms",HREF, NO_FIELDS, - new BreadCrumbs(breadcrumbs), + new BreadCrumbs(breadcrumbs), new Table<AAF_GUI,AuthzTrans>("Permissions",gui.env.newTransNoAvg(),new Model(), "class=std")); } /** * Implement the Table Content for Permissions by User - * + * * @author Jonathan * */ @@ -74,7 +74,7 @@ public class PermsShow extends Page { public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final ArrayList<AbsCell[]> rv = new ArrayList<>(); @@ -87,7 +87,7 @@ public class PermsShow extends Page { if (fp.get(5000)) { TimeTaken ttld = trans.start("Load Data", Env.SUB); try { - if (fp.value!=null) { + if (fp.value!=null) { for (Perm p : fp.value.getPerm()) { AbsCell[] sa = new AbsCell[] { new RefCell(p.getType(),PermDetail.HREF diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java index 09b583bf..b6a6a016 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.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. @@ -68,7 +68,7 @@ public class RequestDetail extends Page { /** * Implement the table content for Request Detail - * + * * @author Jeremiah * */ @@ -92,10 +92,10 @@ public class RequestDetail extends Page { ArrayList<AbsCell[]> rv = new ArrayList<>(); try { Future<Approvals> fa = client.read( - "/authz/approval/ticket/"+ticket, + "/authz/approval/ticket/"+ticket, gui.getDF(Approvals.class) ); - + if (fa.get(AAF_GUI.TIMEOUT)) { Approval app = fa.value.getApprovals().get(0); if(app==null) { @@ -118,39 +118,39 @@ public class RequestDetail extends Page { if (first) { DateFormat createdDF = new SimpleDateFormat(DATE_TIME_FORMAT); UUID id = UUID.fromString(approval.getId()); - + rv.add(new AbsCell[]{new TextCell("Ticket ID:"),new TextCell(approval.getTicket(),"colspan=3")}); rv.add(new AbsCell[]{new TextCell("Memo:"),new TextCell(approval.getMemo(),"colspan=3")}); - rv.add(new AbsCell[]{new TextCell("Requested On:"), + rv.add(new AbsCell[]{new TextCell("Requested On:"), new TextCell(createdDF.format((id.timestamp() - NUM_100NS_INTERVALS_SINCE_UUID_EPOCH)/10000),"colspan=3") }); rv.add(new AbsCell[]{new TextCell("Operation:"),new TextCell(decodeOp(approval.getOperation()),"colspan=3")}); String user = approval.getUser(); rv.add(new AbsCell[]{new TextCell("User:"),new TextCell(user,"colspan=3")}); - + // headers for listing each approver rv.add(new AbsCell[]{new TextCell(" ","colspan=4","class=blank_line")}); rv.add(new AbsCell[]{AbsCell.Null, - new TextCell("Approver","class=bold"), - new TextCell("Type","class=bold"), + new TextCell("Approver","class=bold"), + new TextCell("Type","class=bold"), new TextCell("Status","class=bold")}); approverLine[0] = new TextCell("Approvals:"); - + first = false; } else { approverLine[0] = AbsCell.Null; } - + approverLine[1] = new TextCell(approval.getApprover()); String type = approval.getType(); if ("owner".equalsIgnoreCase(type)) { type = "resource owner"; } - + approverLine[2] = new TextCell(type); approverLine[3] = new TextCell(approval.getStatus()); rv.add(approverLine); - + } } else { rv.add(new AbsCell[] {new TextCell("*** Data Unavailable ***")}); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java index dcf0f928..7b01e8f2 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.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. @@ -63,7 +63,7 @@ import aaf.v2_0.UserRoles; /** * Detail Page for Permissions - * + * * @author Jonathan * */ @@ -82,7 +82,7 @@ public class RoleDetail extends Page { /** * Implement the table content for Permissions Detail - * + * * @author Jonathan * */ @@ -116,8 +116,8 @@ public class RoleDetail extends Page { return; } - - try { + + try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Boolean>() { @Override public Boolean code(Rcli<?> client) throws CadiException, ConnectException, APIException { @@ -134,7 +134,7 @@ public class RoleDetail extends Page { trans.put(sMayWrite,mayWrite); Boolean mayApprove = trans.fish(new AAFPermission(role.getNs(),ACCESS,":role:"+role.getName(),"approve")); trans.put(sMayApprove, mayApprove); - + if (mayWrite || mayApprove) { Mark js = new Mark(); Mark fn = new Mark(); @@ -153,7 +153,7 @@ public class RoleDetail extends Page { "dcb.checked= (d.orig != d.value)" ).end(fn) .end(js); - + Mark mark = new Mark(); hgen.incr(mark,"form","method=post"); trans.put(sMark, mark); @@ -163,7 +163,7 @@ public class RoleDetail extends Page { trans.error().printf("Error calling AAF for Roles in GUI, Role Detail %d: %s",fr.code(),fr.body()); return false; } - + if (fur.get(AAF_GUI.TIMEOUT)) { trans.put(sUserRole, fur.value.getUserRole()); } else { @@ -187,7 +187,7 @@ public class RoleDetail extends Page { final String pRole = trans.get(sRoleName, null); final Role role = trans.get(sRole,null); ArrayList<AbsCell[]> rv = new ArrayList<>(); - + if (role!=null) { boolean mayWrite = trans.get(sMayWrite, false); boolean mayApprove = trans.get(sMayApprove, false); @@ -241,11 +241,11 @@ public class RoleDetail extends Page { } } } - + if (mayApprove) { rv.add(AbsCell.HLINE); - // + // rv.add(new AbsCell[] { new TextCell("Users in Role:","width=25%"), new TextCell("Delete","width=10%"), @@ -256,7 +256,7 @@ public class RoleDetail extends Page { if (userroles!=null) { for (UserRole ur : userroles) { String tag = "userrole"; - + rv.add(new AbsCell[] { AbsCell.Null, new CheckBoxCell(tag+".delete", ur.getUser()), @@ -267,8 +267,8 @@ public class RoleDetail extends Page { } } } - - // History + + // History rv.add(new AbsCell[] { new RefCell("See History",RoleHistory.HREF + "?role=" + pRole,false,"class=greenbutton") }); @@ -299,5 +299,5 @@ public class RoleDetail extends Page { } } -} +}
\ No newline at end of file diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java index fb64cd6e..74526361 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.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. @@ -59,7 +59,7 @@ public class RoleDetailAction extends Page { new BreadCrumbs(breadcrumbs), new NamedCode(true,"content") { final Slot sReq = gui.env.slot(AAF_GUI.HTTP_SERVLET_REQUEST); - + @Override public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI, AuthzTrans>() { @@ -68,7 +68,7 @@ public class RoleDetailAction extends Page { final HttpServletRequest req = trans.get(sReq, null); final String role = getSingleParam(req,"role"); if (role==null) { - hgen.text("Parameter 'role' is required").end(); + hgen.text("Parameter 'role' is required").end(); } else { // Run Validations // boolean fail; @@ -81,7 +81,7 @@ public class RoleDetailAction extends Page { Map<String, String[]> pm = (Map<String, String[]>)req.getParameterMap(); for (final Entry<String, String[]> es : pm.entrySet()) { for (final String v : es.getValue()) { - TimeTaken tt = null; + TimeTaken tt = null; try { switch(es.getKey()) { case "desc": // Check box set @@ -92,7 +92,7 @@ public class RoleDetailAction extends Page { RoleRequest rr = new RoleRequest(); rr.setName(role); rr.setDescription(desc); - ltf.add(new TypedFuture(ActionType.desc, text, + ltf.add(new TypedFuture(ActionType.desc, text, client.update("/authz/role", gui.getDF(RoleRequest.class),rr ))); @@ -111,7 +111,7 @@ public class RoleDetailAction extends Page { rpr.setPerm(perm); rpr.setRole(role); ltf.add(new TypedFuture(ActionType.ungrant,text, - client.delete("/authz/role/" + role + "/perm", + client.delete("/authz/role/" + role + "/perm", gui.getDF(RolePermRequest.class),rpr ))); } else { @@ -142,7 +142,7 @@ public class RoleDetailAction extends Page { } } } - + if (ltf.isEmpty()) { hgen.p("No Changes"); } else { @@ -150,7 +150,7 @@ public class RoleDetailAction extends Page { if (tf.future.get(5000)) { hgen.p("<font color=\"green\"><i>Success</i>:</font> " + tf.text); } else { - // Note: if handling of special Error codes is required, use + // Note: if handling of special Error codes is required, use // switch(tf.type) { // } hgen.p(tf.text); @@ -172,13 +172,13 @@ public class RoleDetailAction extends Page { } }); } - + enum ActionType {desc, ungrant, deleteUR, extendUR}; private static class TypedFuture { // public final ActionType type; public final Future<?> future; public final String text; - + public TypedFuture(ActionType type, String text, Future<?> future) { // this.type = type; this.future = future; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java index a9f0eeb0..ce308354 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.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. @@ -61,7 +61,7 @@ public class RoleHistory extends Page { static final String HREF = "/gui/roleHistory"; static final String FIELDS[] = {"role","dates"}; - + public RoleHistory(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env,NAME,HREF, FIELDS, new BreadCrumbs(breadcrumbs), @@ -74,24 +74,24 @@ public class RoleHistory extends Page { @Override public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { String obRole = trans.get(role, null); - + // Use Javascript to make the table title more descriptive hgen.js() .text("var caption = document.querySelector(\".title\");") - .text("caption.innerHTML='History for Role [ " + obRole + " ]';") + .text("caption.innerHTML='History for Role [ " + obRole + " ]';") .done(); - + // Use Javascript to change Link Target to our last visited Detail page String lastPage = RoleDetail.HREF + "?role=" + obRole; hgen.js() - .text("alterLink('roledetail', '"+lastPage + "');") + .text("alterLink('roledetail', '"+lastPage + "');") .done(); - + hgen.br(); hgen.leaf("a", "href=#advanced_search","onclick=divVisibility('advanced_search');","class=greenbutton").text("Advanced Search").end() .divID("advanced_search", "style=display:none"); hgen.incr("table"); - + addDateRow(hgen,"Start Date"); addDateRow(hgen,"End Date"); hgen.incr("tr").incr("td"); @@ -106,9 +106,9 @@ public class RoleHistory extends Page { } ); - + } - + private static void addDateRow(HTMLGen hgen, String s) { hgen .incr("tr") @@ -129,16 +129,16 @@ public class RoleHistory extends Page { .end() .incr("td") .tagOnly("input","type=number","id=year"+s.substring(0, s.indexOf(' ')),"required", - "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", + "value="+Calendar.getInstance().get(Calendar.YEAR), "min=1900", "max="+Calendar.getInstance().get(Calendar.YEAR), "placeholder=Year").end() .end(); } - - + + /** * Implement the Table Content for History - * + * * @author Jeremiah * */ @@ -146,25 +146,25 @@ public class RoleHistory extends Page { private static final String[] headers = new String[] {"Date","User","Memo"}; private Slot role; private Slot dates; - + public Model(AuthzEnv env) { role = env.slot(NAME+".role"); dates = env.slot(NAME+".dates"); } - + @Override public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final String oName = trans.get(role,null); final String oDates = trans.get(dates,null); - + Cells rv = Cells.EMPTY; if (oName!=null) { - + try { rv = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Cells>() { @Override @@ -181,14 +181,14 @@ public class RoleHistory extends Page { tt.done(); tt = trans.start("Load History Data", Env.SUB); List<Item> histItems = fh.value.getItem(); - + java.util.Collections.sort(histItems, new Comparator<Item>() { @Override public int compare(Item o1, Item o2) { return o2.getTimestamp().compare(o1.getTimestamp()); } }); - + for (Item i : histItems) { String user = i.getUser(); AbsCell userCell = new TextCell(user); @@ -209,7 +209,7 @@ public class RoleHistory extends Page { } } finally { tt.done(); - } + } return new Cells(rv,msg); } }); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RolesShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RolesShow.java index 414c4161..ea1cfabf 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RolesShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RolesShow.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. @@ -51,23 +51,23 @@ import aaf.v2_0.UserRoles; /** * Page content for My Roles - * + * * @author Jonathan * */ public class RolesShow extends Page { public static final String HREF = "/gui/myroles"; private static final String DATE_TIME_FORMAT = "yyyy-MM-dd"; - + public RolesShow(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env, "MyRoles",HREF, NO_FIELDS, - new BreadCrumbs(breadcrumbs), + new BreadCrumbs(breadcrumbs), new Table<AAF_GUI,AuthzTrans>("Roles",gui.env.newTransNoAvg(),new Model(), "class=std")); } /** * Implement the Table Content for Permissions by User - * + * * @author Jonathan * */ @@ -81,7 +81,7 @@ public class RolesShow extends Page { public String[] headers() { return headers; } - + @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { Cells rv = Cells.EMPTY; @@ -107,7 +107,7 @@ public class RolesShow extends Page { UserRoleRemove.HREF+USER +trans.user()+ROLE+u.getRole(), false, new String[]{CLASS_EXPIRED}) - + }; rv.add(sa); } else { @@ -124,7 +124,7 @@ public class RolesShow extends Page { rv.add(sa); } } - + } finally { tt.done(); } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.java index ed4c19d9..10a82267 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.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. @@ -54,11 +54,11 @@ public class UserRoleExtend extends Page { public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { final Slot sUser = gui.env.slot(NAME+".user"); final Slot sRole = gui.env.slot(NAME+".role"); - - + + cache.dynamic(hgen, new DynamicCode<HTMLGen, AAF_GUI, AuthzTrans>() { @Override - public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { + public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { final String user = trans.get(sUser, ""); final String role = trans.get(sRole, ""); @@ -87,12 +87,12 @@ public class UserRoleExtend extends Page { } finally { tt.done(); } - - + + } }); } - + }); } } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleRemove.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleRemove.java index 11126f89..75611b3f 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleRemove.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleRemove.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. @@ -54,11 +54,11 @@ public class UserRoleRemove extends Page { public void code(final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { final Slot sUser = gui.env.slot(NAME+".user"); final Slot sRole = gui.env.slot(NAME+".role"); - - + + cache.dynamic(hgen, new DynamicCode<HTMLGen, AAF_GUI, AuthzTrans>() { @Override - public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { + public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException { final String user = trans.get(sUser, ""); final String role = trans.get(sRole, ""); @@ -69,7 +69,7 @@ public class UserRoleRemove extends Page { public Void code(Rcli<?> client) throws CadiException, ConnectException, APIException { Future<Void> fv = client.delete( "/authz/userRole/"+user+"/"+role+"?request=true",Void.class); - + if (fv.get(5000)) { // not sure if we'll ever hit this hgen.p("User ["+ user+"] Removed from Role [" +role+"]"); @@ -91,7 +91,7 @@ public class UserRoleRemove extends Page { } }); } - + }); } } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/WebCommand.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/WebCommand.java index 73f4981c..3c30e807 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/WebCommand.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/WebCommand.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. @@ -38,7 +38,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class WebCommand extends Page { public static final String HREF = "/gui/cui"; - + public WebCommand(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { super(gui.env, "Web Command Client",HREF, NO_FIELDS, new BreadCrumbs(breadcrumbs), @@ -54,21 +54,21 @@ public class WebCommand extends Page { .end() .text(". Type 'help' below for a list of AAF commands") .end() - + .divID("console_and_options"); - hgen.divID("console_area"); + hgen.divID("console_area"); hgen.end(); //console_area - + hgen.divID("options_link", "class=closed"); cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() { @Override public void code(AAF_GUI state, AuthzTrans trans, Cache<HTMLGen> cache, HTMLGen xgen) throws APIException, IOException { String image_root = "src=../../"+state.env.get(sThemeWebPath).toString() + '/' + state.env.get(sTheme) + "/images/icons"; - hgen.img(image_root + "/options_down.png", "onclick=handleDivHiding('options',this);", - "id=options_img", "alt=Options", "title=Options") + hgen.img(image_root + "/options_down.png", "onclick=handleDivHiding('options',this);", + "id=options_img", "alt=Options", "title=Options") .end(); //options_link - + hgen.divID("options"); switch(browser(trans,trans.env().slot(getBrowserType()))) { @@ -82,29 +82,29 @@ public class WebCommand extends Page { } // xgen.img("src=../../"+gui.theme+"/AAF_email.png", "onclick=emailLog();", // "alt=Email log to me", "title=Email log to me"); - xgen.img(image_root+"/AAF_font_size.png", "onclick=handleDivHiding('text_slider',this);", + xgen.img(image_root+"/AAF_font_size.png", "onclick=handleDivHiding('text_slider',this);", "id=fontsize_img", "alt=Change text size", "title=Change text size"); - xgen.img(image_root+"/AAF_details.png", "onclick=selectOption(this,0);", + xgen.img(image_root+"/AAF_details.png", "onclick=selectOption(this,0);", "id=details_img", "alt=Turn on/off details mode", "title=Turn on/off details mode"); xgen.img(image_root+"/AAF_maximize.png", "onclick=maximizeConsole(this);", "id=maximize_img", "alt=Maximize Console Window", "title=Maximize Console Window"); - } + } }); hgen.divID("text_slider"); hgen.tagOnly("input", "type=button", "class=change_font", "onclick=buttonChangeFontSize('dec')", "value=-") - .tagOnly("input", "id=text_size_slider", "type=range", "min=75", "max=200", "value=100", + .tagOnly("input", "id=text_size_slider", "type=range", "min=75", "max=200", "value=100", "oninput=changeFontSize(this.value)", "onchange=changeFontSize(this.value)", "title=Change Text Size") - .tagOnly("input", "type=button", "class=change_font", "onclick=buttonChangeFontSize('inc')", "value=+") + .tagOnly("input", "type=button", "class=change_font", "onclick=buttonChangeFontSize('inc')", "value=+") .end(); //text_slider hgen.end(); //options hgen.end(); //console_and_options - + hgen.divID("input_area"); - hgen.tagOnly("input", "type=text", "id=command_field", + hgen.tagOnly("input", "type=text", "id=command_field", "autocomplete=off", "autocorrect=off", "autocapitalize=off", "spellcheck=false", "onkeypress=keyPressed()", "placeholder=Type your AAFCLI commands here", "autofocus") - .tagOnly("input", "id=submit", "type=button", "value=Submit", + .tagOnly("input", "id=submit", "type=button", "value=Submit", "onclick=http('put','../../gui/cui',getCommand(),callCUI);") .end(); @@ -112,10 +112,10 @@ public class WebCommand extends Page { hgen.js(callCUI); hgen.text("function callCUI(resp) {") .text("moveCommandToDiv();") - .text("printResponse(resp);") + .text("printResponse(resp);") .text("}"); - hgen.end(callCUI); - + hgen.end(callCUI); + } }); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/AbsCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/AbsCell.java index e461cf54..102d674e 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/AbsCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/AbsCell.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. @@ -35,13 +35,13 @@ public abstract class AbsCell { * @param hgen */ public abstract void write(HTMLGen hgen); - + public final static AbsCell Null = new AbsCell() { @Override public void write(final HTMLGen hgen) { } }; - + public String[] attrs() { return NONE; } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/ButtonCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/ButtonCell.java index 2443eb98..79c7483a 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/ButtonCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/ButtonCell.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. @@ -25,7 +25,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class ButtonCell extends AbsCell { private String[] attrs; - + public ButtonCell(String value, String ... attributes) { attrs = new String[2+attributes.length]; attrs[0]="type=button"; @@ -37,7 +37,7 @@ public class ButtonCell extends AbsCell { hgen.incr("input",true,attrs).end(); } - + @Override public String[] attrs() { return AbsCell.CENTER; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/CheckBoxCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/CheckBoxCell.java index 91abfa42..b34efd05 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/CheckBoxCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/CheckBoxCell.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. @@ -27,7 +27,7 @@ public class CheckBoxCell extends AbsCell { public enum ALIGN{ left, right, center }; private String[] attrs; private ALIGN align; - + public CheckBoxCell(String name, ALIGN align, String value, String ... attributes) { this.align = align; attrs = new String[3 + attributes.length]; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RadioCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RadioCell.java index 9f21fac8..bccce8f9 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RadioCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RadioCell.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. @@ -25,7 +25,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class RadioCell extends AbsCell { private String[] attrs; - + public RadioCell(String name, String radioClass, String value, String ... attributes) { attrs = new String[4 + attributes.length]; attrs[0]="type=radio"; @@ -35,7 +35,7 @@ public class RadioCell extends AbsCell { System.arraycopy(attributes, 0, attrs, 4, attributes.length); } - + @Override public void write(HTMLGen hgen) { hgen.tagOnly("input",attrs); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RefCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RefCell.java index 759d87f4..7058a243 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RefCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/RefCell.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. @@ -33,7 +33,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class RefCell extends AbsCell { public final String name; public final String[] str; - + public RefCell(String name, String href, boolean newWindow, String... attributes) { this.name = name; if (newWindow) { @@ -46,7 +46,7 @@ public class RefCell extends AbsCell { System.arraycopy(attributes, 0, str, 1, attributes.length); } - + @Override public void write(HTMLGen hgen) { hgen.leaf(A,str).text(name); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TableData.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TableData.java index d202ffa0..df0ad967 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TableData.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TableData.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. @@ -29,7 +29,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; import org.onap.aaf.misc.xgen.html.State; public abstract class TableData<S extends State<Env>, TRANS extends Trans> implements Table.Data<S,TRANS>{ - public static final String[] headers = new String[0]; + public static final String[] headers = new String[0]; /* (non-Javadoc) * @see org.onap.aaf.auth.gui.Table.Data#prefix(org.onap.aaf.misc.xgen.html.State, com.att.inno.env.Trans, org.onap.aaf.misc.xgen.Cache, org.onap.aaf.misc.xgen.html.HTMLGen) diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextAndRefCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextAndRefCell.java index aefb3a46..ac65d741 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextAndRefCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextAndRefCell.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. @@ -28,7 +28,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class TextAndRefCell extends RefCell { private String text; - + public TextAndRefCell(String text, String name, String href, boolean newWindow, String[] attributes) { super(name, href, newWindow, attributes); this.text = text; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextCell.java index 5d2a7262..2fdd914a 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextCell.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. @@ -31,17 +31,17 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class TextCell extends AbsCell { public final String name; private String[] attrs; - + public TextCell(String name, String... attributes) { attrs = attributes; this.name = name; } - + @Override public void write(HTMLGen hgen) { hgen.text(name); } - + @Override public String[] attrs() { return attrs; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextInputCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextInputCell.java index c55759ea..655ae8db 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextInputCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextInputCell.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. @@ -31,7 +31,7 @@ import org.onap.aaf.misc.xgen.html.HTMLGen; public class TextInputCell extends AbsCell { private static final String[] NULL_ATTRS=new String[0]; private String[] attrs; - + public TextInputCell(String name, String textClass, String value, String ... attributes) { attrs = new String[5 + attributes.length]; attrs[0]="type=text"; @@ -41,12 +41,12 @@ public class TextInputCell extends AbsCell { attrs[4]="style=font-size:100%;"; System.arraycopy(attributes, 0, attrs, 5, attributes.length); } - + @Override public void write(HTMLGen hgen) { hgen.tagOnly("input",attrs); } - + @Override public String[] attrs() { return NULL_ATTRS; diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.java index 5eaa69d1..8f047d85 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/table/TextToolTipCell.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. @@ -32,18 +32,18 @@ public class TextToolTipCell extends AbsCell { public final String name; private final String[] attrs; private final String tooltip; - + public TextToolTipCell(String name, String tooltip, String... attributes) { attrs = attributes; this.name = name; this.tooltip = "<abbr title=\"" + tooltip + "\">"; } - + @Override public void write(HTMLGen hgen) { hgen.text(tooltip + name + "</abbr>"); } - + @Override public String[] attrs() { return attrs; |