Sonar Fixes, Formatting
[aaf/authz.git] / auth / auth-gui / src / main / java / org / onap / aaf / auth / gui / pages / NsHistory.java
index dc9119b..6994a2c 100644 (file)
@@ -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>", "&lt;script&gt;").replace("</script>", "&lt;/script&gt;");
                                     rv.add(new AbsCell[] {
                                             new TextCell(i.getTimestamp().toGregorianCalendar().getTime().toString()),