- 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
- public int compare(User u1, User u2) {
- int rv = u1.getType().compareTo(u2.getType());
- return rv==0?u2.getExpires().compare(u1.getExpires()):rv;
- }
- });
- int xcnt = 0;
- XMLGregorianCalendar oldest=null, newest=null;
- String id = null;
- for(User u: es.getValue()) {
- if(id==null) {
- id = u.getId();
- }
- // Need to compile entries for Certificates on this screen
- if(es.getKey()==200) {
- ++xcnt;
- if(oldest==null || oldest.compare(u.getExpires())<0) {
- oldest = u.getExpires();
- }
- if(newest==null || newest.compare(u.getExpires())<0) {
- newest = u.getExpires();
- }
- } else {
- hgen.leaf(uRow,HTMLGen.TR);
- if(first) {
- hgen.leaf(HTMLGen.TD,cls="class=detailFirst",STYLE_WIDTH_10);
- switch(es.getKey()) {
- case 1:
- case 2: hgen.text("Password");
- break;
- case 10: hgen.text("Certificate"); break;
- }
- } else {
- hgen.leaf(HTMLGen.TD,cls="class=detail",STYLE_WIDTH_10+"text-align:center;").text("\"");
- }
- hgen.end();
- hgen.incr(HTMLGen.TD,cls,STYLE_WIDTH_20);
-
- hgen.leaf(HTMLGen.A,
- "class=button",
- "href="+PassDeleteAction.HREF+
- "?id="+id+
- "&ns="+ns+
- "&date="+u.getExpires().toXMLFormat() +
- "&type="+u.getType())
- .text("Delete").end();
- if(first && es.getKey()<10) { // Change Password Screen
- hgen.leaf(HTMLGen.A,"class=button","href="+PassChangeForm.HREF+"?id="+id+"&ns="+ns)
- .text("Add")
- .end();
- }
- first=false;
- hgen.end().leaf(HTMLGen.TD,cls,STYLE_WIDTH_70)
- .text(Chrono.niceDateStamp(u.getExpires()))
- .end();
-
- hgen.end(uRow);
- }
- }
- if(xcnt>0) { // print compilations, if any, of Certificate
- hgen.leaf(uRow,HTMLGen.TR)
- .leaf(HTMLGen.TD,cls="class=detailFirst",STYLE_WIDTH_10).text("x509").end()
- .leaf(HTMLGen.TD, cls,STYLE_WIDTH_20)
- .leaf(HTMLGen.A,"class=button","href="+CMArtifactShow.HREF+"?id="+id+"&ns="+ns)
- .text("View All")
- .end(2)
- .leaf(HTMLGen.TD, cls,STYLE_WIDTH_70).text(String.format(
- xcnt>0?"%d Certificate%s, ranging from %s to %s"
- :"%d Certificate%s",
- xcnt,
- xcnt==1?"":"s",
- Chrono.niceDateStamp(oldest),
- Chrono.niceDateStamp(newest)))
- .end(uRow);
-
- }
- }
- hgen.end(utable);
- }
-
- hgen.end(div);
+ 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
+ public int compare(User u1, User u2) {
+ int rv = u1.getType().compareTo(u2.getType());
+ return rv==0?u2.getExpires().compare(u1.getExpires()):rv;
+ }
+ });
+ int xcnt = 0;
+ XMLGregorianCalendar oldest=null, newest=null;
+ String id = null;
+ for(User u: es.getValue()) {
+ if(id==null) {
+ id = u.getId();
+ }
+ // Need to compile entries for Certificates on this screen
+ if(es.getKey()==200) {
+ ++xcnt;
+ if(oldest==null || oldest.compare(u.getExpires())<0) {
+ oldest = u.getExpires();
+ }
+ if(newest==null || newest.compare(u.getExpires())<0) {
+ newest = u.getExpires();
+ }
+ } else {
+ hgen.leaf(uRow,HTMLGen.TR);
+ if(first) {
+ hgen.leaf(HTMLGen.TD,cls="class=detailFirst",STYLE_WIDTH_10);
+ switch(es.getKey()) {
+ case 1:
+ case 2: hgen.text("Password");
+ break;
+ case 10: hgen.text("Certificate"); break;
+ }
+ } else {
+ hgen.leaf(HTMLGen.TD,cls="class=detail",STYLE_WIDTH_10+"text-align:center;").text("\"");
+ }
+ hgen.end();
+ hgen.incr(HTMLGen.TD,cls,STYLE_WIDTH_20);
+
+ hgen.leaf(HTMLGen.A,
+ "class=button",
+ "href="+PassDeleteAction.HREF+
+ "?id="+id+
+ "&ns="+ns+
+ "&date="+u.getExpires().toXMLFormat() +
+ "&type="+u.getType())
+ .text("Delete").end();
+ if(first && es.getKey()<10) { // Change Password Screen
+ hgen.leaf(HTMLGen.A,"class=button","href="+PassChangeForm.HREF+"?id="+id+"&ns="+ns)
+ .text("Add")
+ .end();
+ }
+ first=false;
+ hgen.end().leaf(HTMLGen.TD,cls,STYLE_WIDTH_70)
+ .text(Chrono.niceDateStamp(u.getExpires()))
+ .end();
+
+ hgen.end(uRow);
+ }
+ }
+ if(xcnt>0) { // print compilations, if any, of Certificate
+ hgen.leaf(uRow,HTMLGen.TR)
+ .leaf(HTMLGen.TD,cls="class=detailFirst",STYLE_WIDTH_10).text("x509").end()
+ .leaf(HTMLGen.TD, cls,STYLE_WIDTH_20)
+ .leaf(HTMLGen.A,"class=button","href="+CMArtifactShow.HREF+"?id="+id+"&ns="+ns)
+ .text("View All")
+ .end(2)
+ .leaf(HTMLGen.TD, cls,STYLE_WIDTH_70).text(String.format(
+ xcnt>0?"%d Certificate%s, ranging from %s to %s"
+ :"%d Certificate%s",
+ xcnt,
+ xcnt==1?"":"s",
+ Chrono.niceDateStamp(oldest),
+ Chrono.niceDateStamp(newest)))
+ .end(uRow);
+
+ }
+ }
+ hgen.end(utable);
+ }
+
+ hgen.end(div);