Author: xor
Date: 2008-09-18 16:11:07 +0000 (Thu, 18 Sep 2008)
New Revision: 22688
Modified:
trunk/plugins/WoT/WoT.java
Log:
Uncomment the use of the Config-class (I hope there was no reason why it was
disabled)
Modified: trunk/plugins/WoT/WoT.java
===================================================================
--- trunk/plugins/WoT/WoT.java 2008-09-18 16:10:18 UTC (rev 22687)
+++ trunk/plugins/WoT/WoT.java 2008-09-18 16:11:07 UTC (rev 22688)
@@ -56,7 +56,7 @@
private IdentityFetcher fetcher;
private String seedURI = "USK at
MF2Vc6FRgeFMZJ0s2l9hOop87EYWAydUZakJzL0OfV8,fQeN-RMQZsUrDha2LCJWOMFk1-EiXZxfTnBT8NEgY00,AQACAAE/WoT/0";
private Identity seed;
- //private Config config;
+ private Config config;
public static String SELF_URI = "/plugins/plugins.WoT.WoT";
@@ -66,19 +66,17 @@
// Init
this.pr = pr;
- Configuration config = Db4o.newConfiguration();
-
config.objectClass(Identity.class).objectField("id").indexed(true);
-
config.objectClass(OwnIdentity.class).objectField("id").indexed(true);
-
config.objectClass(Trust.class).objectField("truster").indexed(true);
-
config.objectClass(Trust.class).objectField("trustee").indexed(true);
-
config.objectClass(Score.class).objectField("treeOwner").indexed(true);
-
config.objectClass(Score.class).objectField("target").indexed(true);
- db = Db4o.openFile(config, "WoT.db4o");
+ Configuration cfg = Db4o.newConfiguration();
+ cfg.objectClass(Identity.class).objectField("id").indexed(true);
+
cfg.objectClass(OwnIdentity.class).objectField("id").indexed(true);
+
cfg.objectClass(Trust.class).objectField("truster").indexed(true);
+
cfg.objectClass(Trust.class).objectField("trustee").indexed(true);
+
cfg.objectClass(Score.class).objectField("treeOwner").indexed(true);
+
cfg.objectClass(Score.class).objectField("target").indexed(true);
+ db = Db4o.openFile(cfg, "WoT.db4o");
client = pr.getHLSimpleClient();
- web = new WebInterface(pr, db, client, SELF_URI);
- /*
try {
ObjectSet<Config> result =
db.queryByExample(Config.class);
if(result.size() == 0) {
@@ -95,8 +93,10 @@
catch(Exception e) {
Logger.error(this, e.getMessage(), e);
}
- */
+ web = new WebInterface(pr, db, config, client, SELF_URI);
+
+
// Create the seed Identity if it doesn't exist
try {
seed = Identity.getByURI(db, seedURI);
@@ -144,6 +144,9 @@
if(request.isParameterSet("knownidentities"))
return web.makeKnownIdentitiesPage();
+ if(request.isParameterSet("configuration"))
+ return web.makeConfigurationPage();
+
if(request.isParameterSet("getTrusters"))
return
web.getTrustersPage(request.getParam("id"));