Author: batosai
Date: 2008-08-10 14:55:22 +0000 (Sun, 10 Aug 2008)
New Revision: 21714

Modified:
   trunk/apps/WoT/src/plugins/WoT/Identity.java
   trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java
   trunk/apps/WoT/src/plugins/WoT/IdentityParser.java
   trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
Log:
Doh ! The properties hashmap was never stored !

Modified: trunk/apps/WoT/src/plugins/WoT/Identity.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/Identity.java        2008-08-10 14:36:54 UTC 
(rev 21713)
+++ trunk/apps/WoT/src/plugins/WoT/Identity.java        2008-08-10 14:55:22 UTC 
(rev 21714)
@@ -91,8 +91,10 @@
                this.lastChange = lastChange;
        }

-       public void setProp(String key, String value) {
+       public void setProp(String key, String value, ObjectContainer db) {
                props.put(key, value);
+               db.store(props);
+               db.commit();
        }

        public String getProp(String key) {

Modified: trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java 2008-08-10 14:36:54 UTC 
(rev 21713)
+++ trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java 2008-08-10 14:55:22 UTC 
(rev 21714)
@@ -89,8 +89,10 @@
                ObjectSet<Identity> search = db.queryByExample(Identity.class);
                while (search.hasNext()) {
                        Identity id = search.next();
-                       
if(id.getRequestURI().getRoutingKey().equals(state.getURI().getRoutingKey()))
+                       
if(id.getRequestURI().getRoutingKey().equals(state.getURI().getRoutingKey())) {
                                identity = id;
+                               break;
+                       }
                }
                if (identity == null) {
                        System.out.println("Error, identity not found");

Modified: trunk/apps/WoT/src/plugins/WoT/IdentityParser.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/IdentityParser.java  2008-08-10 14:36:54 UTC 
(rev 21713)
+++ trunk/apps/WoT/src/plugins/WoT/IdentityParser.java  2008-08-10 14:55:22 UTC 
(rev 21714)
@@ -68,7 +68,7 @@
                        else elt_name = rawName;

                        if (elt_name.equals("prop")) {
-                               identity.setProp(attrs.getValue("key"), 
attrs.getValue("value"));
+                               identity.setProp(attrs.getValue("key"), 
attrs.getValue("value"), db);
                        }
                }
        }

Modified: trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoTplugin.java       2008-08-10 14:36:54 UTC 
(rev 21713)
+++ trunk/apps/WoT/src/plugins/WoT/WoTplugin.java       2008-08-10 14:55:22 UTC 
(rev 21714)
@@ -282,8 +282,8 @@
                                                                                
                        new 
FreenetURI(request.getPartAsString("requestURI",1024)).setKeyType("USK"),
                                                                                
                        new Date(0),
                                                                                
                        new Date());
-                       identity.setProp("nickName", 
request.getPartAsString("nickName", 1024));
-                       identity.setProp("publishTrustList", "true");
+                       identity.setProp("nickName", 
request.getPartAsString("nickName", 1024), db);
+                       identity.setProp("publishTrustList", "true", db);

                        //TODO Make the new identity trust the seed identity
                        db.store(identity);


Reply via email to