Author: batosai
Date: 2008-09-12 15:34:20 +0000 (Fri, 12 Sep 2008)
New Revision: 22622

Modified:
   trunk/plugins/WoT/src/plugins/WoT/Identity.java
   trunk/plugins/WoT/src/plugins/WoT/WebInterface.java
Log:
Display them on KnownIdentities page

Modified: trunk/plugins/WoT/src/plugins/WoT/Identity.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/Identity.java     2008-09-12 15:30:00 UTC 
(rev 22621)
+++ trunk/plugins/WoT/src/plugins/WoT/Identity.java     2008-09-12 15:34:20 UTC 
(rev 22622)
@@ -37,8 +37,8 @@
                        1       // Every identity above rank 5 can give 1 point
        };                      // Identities with negative score have zero 
capacity

-       @SuppressWarnings("unused")
        private String id;
+
        private FreenetURI requestURI;

        private Date lastChange;
@@ -349,6 +349,10 @@
        public void updated() {
                lastChange = new Date();
        }
+       
+       public String getId() {
+               return id;
+       }

        public FreenetURI getRequestURI() {
                return requestURI.setMetaString(new String[] {"identity.xml"} );

Modified: trunk/plugins/WoT/src/plugins/WoT/WebInterface.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/WebInterface.java 2008-09-12 15:30:00 UTC 
(rev 22621)
+++ trunk/plugins/WoT/src/plugins/WoT/WebInterface.java 2008-09-12 15:34:20 UTC 
(rev 22622)
@@ -225,6 +225,8 @@
                row.addChild("th", "Publish TrustList ?");
                row.addChild("th", "Score (Rank)");
                row.addChild("th", "Trust/Comment");
+               row.addChild("th", "Trusters");
+               row.addChild("th", "Trustees");

                ObjectSet<Identity> identities = Identity.getAllIdentities(db);
                while(identities.hasNext()) {
@@ -242,11 +244,11 @@
                        else row.addChild("td", id.getLastChange().toString());

                        // Publish TrustList
-                       row.addChild("td", id.doesPublishTrustList() ? "Yes" : 
"No");
+                       row.addChild("td", new String[] { "align" }, new 
String[] { "center" } , id.doesPublishTrustList() ? "Yes" : "No");

                        //Score
                        try {
-                               row.addChild("td", 
String.valueOf(id.getScore((OwnIdentity)treeOwner, db).getScore())+" 
("+id.getScore((OwnIdentity)treeOwner, db).getRank()+")");
+                               row.addChild("td", new String[] { "align" }, 
new String[] { "center" } , String.valueOf(id.getScore((OwnIdentity)treeOwner, 
db).getScore())+" ("+id.getScore((OwnIdentity)treeOwner, db).getRank()+")");
                        }
                        catch (NotInTrustTreeException e) {
                                // This only happen with identities added 
manually by the user
@@ -273,6 +275,14 @@
                        trustForm.addChild("input", new String[] { "type", 
"name", "size", "value" }, new String[] { "text", "value", "2", trustValue });
                        trustForm.addChild("input", new String[] { "type", 
"name", "size", "value" }, new String[] { "text", "comment", "20", trustComment 
});
                        trustForm.addChild("input", new String[] { "type", 
"name", "value" }, new String[] { "submit", "update", "Update !" });
+                       
+                       // Trusters
+                       HTMLNode trustersCell = row.addChild("td", new String[] 
{ "align" }, new String[] { "center" });
+                       trustersCell.addChild(new HTMLNode("a", "href", 
SELF_URI + "?getTrusters&id="+id.getId(), 
Long.toString(id.getNbReceivedTrusts(db))));
+                       
+                       //Trustees
+                       HTMLNode trusteesCell = row.addChild("td", new String[] 
{ "align" }, new String[] { "center" });
+                       trusteesCell.addChild(new HTMLNode("a", "href", 
SELF_URI + "?getTrustees&id="+id.getId(), 
Long.toString(id.getNbGivenTrusts(db))));
                }
                contentNode.addChild(addBox);
                contentNode.addChild(listBox);


Reply via email to