[isidorus-cvs] r494 - in branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine: . Base TopicMaps jtmsBasedEngine

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Tue Jun 21 18:33:12 UTC 2011


Author: lgiessmann
Date: Tue Jun 21 11:33:11 2011
New Revision: 494

Log:
gdl-frontend: TmEngine: fixed a problem with java arrays and collections => GWT:JsArray

Modified:
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/Base/TmEngine.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/GDL_TmEngine.gwt.xml
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Association.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Construct.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Name.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Occurrence.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Role.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Scoped.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Topic.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/TopicMap.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Variant.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/JtmsTmEngine.java
   branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/TestClass.java

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/Base/TmEngine.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/Base/TmEngine.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/Base/TmEngine.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -3,8 +3,8 @@
 import us.isidor.gdl.anaToMia.TmEngine.TopicMaps.TopicMap;
 
 public interface TmEngine{
-	public TopicMap read(String tmData, TopicMap tm);
-	public String write(TopicMap tm);
+	public void importTm(String tmData, TopicMap tm);
+	public String exportTm(TopicMap tm);
 	public TopicMap createTopicMap(String tmLocator);
 	public TopicMap getTopicMap(String tmLocator);
 	public TopicMap[] getTopicMaps();

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/GDL_TmEngine.gwt.xml
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/GDL_TmEngine.gwt.xml	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/GDL_TmEngine.gwt.xml	Tue Jun 21 11:33:11 2011	(r494)
@@ -2,6 +2,7 @@
 <module rename-to='gdl_tmengine'>
   <!-- Inherit the core Web Toolkit stuff.                        -->
   <inherits name='com.google.gwt.user.User'/>
+  <!--<inherits name='com.google.gwt.json.JSON'/>-->
 
   <!-- Inherit the default GWT style sheet.  You can change       -->
   <!-- the theme of your GWT application by uncommenting          -->

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Association.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Association.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Association.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -1,8 +1,8 @@
 package us.isidor.gdl.anaToMia.TmEngine.TopicMaps;
 
-import java.util.Set;
-
 import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArray;
+
 
 public class Association extends JavaScriptObject implements Scoped, Reifiable, Typed{
 	protected Association() {}
@@ -23,7 +23,7 @@
 	}-*/;
 	
 
-	public final native Set<Locator> getItemIdentifiers() /*-{
+	public final native JsArray<Locator> getItemIdentifiers() /*-{
 		return this.getItemIdentifiers();
 	}-*/;
 
@@ -68,7 +68,7 @@
 	}-*/;
 
 	
-	public final native Set<Topic> getScope() /*-{
+	public final native JsArray<Topic> getScope() /*-{
 		return this.getScope();
 	}-*/;
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Construct.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Construct.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Construct.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -14,7 +14,7 @@
 	 	public String getId();
 	 	public boolean equals(Object other);
 		void addItemIdentifier(Locator itemIdentifier);
-		public Set<Locator> getItemIdentifiers();
+		public JsArray<Locator> getItemIdentifiers();
 		public Construct getParent();
 		public TopicMap getTopicMap();
 		public void remove();

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Name.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Name.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Name.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -1,23 +1,23 @@
 package us.isidor.gdl.anaToMia.TmEngine.TopicMaps;
 
-import java.util.Collection;
-import java.util.Set;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArray;
 
-public class Name implements Scoped, Reifiable, Typed {
+public class Name extends JavaScriptObject implements Scoped, Reifiable, Typed{
 	protected Name() {}
 	
 	
-	public final native Variant createVariant(Locator value, Collection<Topic> scope) /*-{
+	public final native Variant createVariant(Locator value, JsArray<Topic> scope) /*-{
 		return this.createVariant(value, scope);
 	}-*/;
 	
 	
-	public final native Variant createVariant(String value, Collection<Topic> scope) /*-{
+	public final native Variant createVariant(String value, JsArray<Topic> scope) /*-{
 		return this.createVariant(value, scope);
 	}-*/;
 	
 	
-	public final native Variant createVariant(Locator value, Locator datatype, Collection<Topic> scope) /*-{
+	public final native Variant createVariant(Locator value, Locator datatype, JsArray<Topic> scope) /*-{
 		return this.createVariant(value, datatype, scope);
 	}-*/;
 	
@@ -27,7 +27,7 @@
 	}-*/;
 	
 	
-	public final native Set<Variant> getVariants() /*-{
+	public final native JsArray<Variant> getVariants() /*-{
 		return this.getVariants();
 	}-*/;
 	
@@ -47,7 +47,7 @@
 	}-*/;
 
 	
-	public final native Set<Locator> getItemIdentifiers() /*-{
+	public final native JsArray<Locator> getItemIdentifiers() /*-{
 		return this.getItemIdentifiers();
 	}-*/;
 
@@ -103,7 +103,7 @@
 	}-*/;
 	
 
-	public final native Set<Topic> getScope() /*-{
+	public final native JsArray<Topic> getScope() /*-{
 		return this.getScope();
 	}-*/;
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Occurrence.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Occurrence.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Occurrence.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -2,8 +2,8 @@
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Set;
 import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArray;
 
 
 public class Occurrence extends JavaScriptObject implements DatatypeAware, Typed {
@@ -20,7 +20,7 @@
 	}-*/;
 	
 
-	public final native Set<Locator> getItemIdentifiers() /*-{
+	public final native JsArray<Locator> getItemIdentifiers() /*-{
 		return this.getItemIdentifiers();
 	}-*/;
 	
@@ -65,7 +65,7 @@
 	}-*/;
 
 
-	public final native Set<Topic> getScope() /*-{
+	public final native JsArray<Topic> getScope() /*-{
 		return this.getScope();
 	}-*/;
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Role.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Role.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Role.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -1,8 +1,9 @@
 package us.isidor.gdl.anaToMia.TmEngine.TopicMaps;
 
-import java.util.Set;
 
 import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArray;
+
 
 public class Role extends JavaScriptObject implements Reifiable, Typed {
 	protected Role() {}
@@ -28,7 +29,7 @@
 	}-*/;
 
 	
-	public final native Set<Locator> getItemIdentifiers() /*-{
+	public final native JsArray<Locator> getItemIdentifiers() /*-{
 		return this.getItemIdentifiers();
 	}-*/;
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Scoped.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Scoped.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Scoped.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -13,6 +13,6 @@
 	/*
 		public void addTheme(Topic theme);
 		public void removeTheme(Topic theme);
-		public Set<Topic> getScope();
+		public JsArray<Topic> getScope();
 	*/
 }

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Topic.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Topic.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Topic.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -1,9 +1,8 @@
 package us.isidor.gdl.anaToMia.TmEngine.TopicMaps;
 
-import java.util.Collection;
-import java.util.Set;
-
 import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArray;
+
 
 public class Topic extends JavaScriptObject implements Construct{
 	protected Topic() {}
@@ -23,47 +22,47 @@
 	}-*/;
 	
 	
-	public final native Name createName(String value, Collection<Topic> scope) /*-{
+	public final native Name createName(String value, JsArray<Topic> scope) /*-{
 		return this.createName(value, scope);
 	}-*/;
 	
 	
-	public final native Name createName(Topic type, String value, Collection<Topic> scope) /*-{
+	public final native Name createName(Topic type, String value, JsArray<Topic> scope) /*-{
 		return this.createName(type, value, scope);
 	}-*/;
 	
 	
-	public final native Occurrence createOccurrence(Topic type, Locator value, Collection<Topic> scope) /*-{
+	public final native Occurrence createOccurrence(Topic type, Locator value, JsArray<Topic> scope) /*-{
 		return this.createOccurrence(type, value, scope);
 	}-*/;
 	
 	
-	public final native Occurrence createOccurrence(Topic type, String value, Collection<Topic> scope) /*-{
+	public final native Occurrence createOccurrence(Topic type, String value, JsArray<Topic> scope) /*-{
 		return this.createOccurrence(type, value, scope);
 	}-*/;
 	
 	
-	public final native Occurrence createOccurrence(Topic type, String value, Locator datatype, Collection<Topic> scope) /*-{
+	public final native Occurrence createOccurrence(Topic type, String value, Locator datatype, JsArray<Topic> scope) /*-{
 		return this.createOccurrence(type, value, datatype, scope);
 	}-*/;
 	
 	
-	public final native Set<Name> getNames() /*-{
+	public final native JsArray<Name> getNames() /*-{
 		return this.getNames();
 	}-*/;
 	
 	
-	public final native Set<Name> getNames(Topic type) /*-{
+	public final native JsArray<Name> getNames(Topic type) /*-{
 		return this.getNames(type);
 	}-*/;
 	
 	
-	public final native Set<Occurrence> getOccurrences() /*-{
+	public final native JsArray<Occurrence> getOccurrences() /*-{
 		return this.getOccurrences();
 	}-*/;
 
 
-	public final native Set<Occurrence> getOccurrences(Topic type) /*-{
+	public final native JsArray<Occurrence> getOccurrences(Topic type) /*-{
 		return this.getOccurrences(type);
 	}-*/;
 	
@@ -73,32 +72,32 @@
 	}-*/;
 	
 	
-	public final native Set<Role> getRolesPlayed() /*-{
+	public final native JsArray<Role> getRolesPlayed() /*-{
 		return this.getRolesPlayed();
 	}-*/;
 	
 	
-	public final native Set<Role> getRolesPlayed(Topic type) /*-{
+	public final native JsArray<Role> getRolesPlayed(Topic type) /*-{
 		return this.getRolesPlayed(type);
 	}-*/;
 	
 	
-	public final native Set<Role> getRolesPlayed(Topic type, Topic assocType) /*-{
+	public final native JsArray<Role> getRolesPlayed(Topic type, Topic assocType) /*-{
 		return this.getRolesPlayed(type, assocType);
 	}-*/;
 	
 	
-	public final native Set<Locator> getSubjectIdentifiers() /*-{
+	public final native JsArray<Locator> getSubjectIdentifiers() /*-{
 		return this.getSubjectIdentifiers();
 	}-*/;
 	
 	
-	public final native Set<Locator> getSubjectLocators() /*-{
+	public final native JsArray<Locator> getSubjectLocators() /*-{
 		return this.getSubjectLocators();
 	}-*/;
 	
 	
-	public final native Set<Topic> getTypes() /*-{
+	public final native JsArray<Topic> getTypes() /*-{
 		return this.getTypes();
 	}-*/;
 	
@@ -133,7 +132,7 @@
 	}-*/;
 	
 
-	public final native Set<Locator> getItemIdentifiers() /*-{
+	public final native JsArray<Locator> getItemIdentifiers() /*-{
 		return this.getItemIdentifier();
 	}-*/;
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/TopicMap.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/TopicMap.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/TopicMap.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -1,9 +1,8 @@
 package us.isidor.gdl.anaToMia.TmEngine.TopicMaps;
 
-import java.util.Collection;
-import java.util.Set;
-
 import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArray;
+
 
 public class TopicMap extends JavaScriptObject implements Reifiable{
 	protected TopicMap() {}
@@ -14,7 +13,7 @@
 	}-*/;
 	
 	
-	public final native Association createAssociation(Topic type, Collection<Topic> scope) /*-{
+	public final native Association createAssociation(Topic type, JsArray<Topic> scope) /*-{
 		this.createAssociation(type, scope);
 	}-*/;
 	
@@ -39,7 +38,7 @@
 	}-*/;
 	
 	
-	public final native Set<Association> getAssociations() /*-{
+	public final native JsArray<Association> getAssociations() /*-{
 		return this.getAssociations();
 	}-*/;
 	
@@ -74,7 +73,7 @@
 	}-*/;
 	
 	
-	public final native Set<Topic> getTopics() /*-{
+	public final native JsArray<Topic> getTopics() /*-{
 		return this.getTopics();
 	}-*/;
 	
@@ -94,7 +93,7 @@
 	}-*/;
 
 
-	public final native Set<Locator> getItemIdentifiers() /*-{
+	public final native JsArray<Locator> getItemIdentifiers() /*-{
 		return this.getItemIdentifiers();
 	}-*/;
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Variant.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Variant.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/TopicMaps/Variant.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -2,8 +2,8 @@
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Set;
 import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.core.client.JsArray;
 
 
 public class Variant extends JavaScriptObject implements DatatypeAware{
@@ -19,7 +19,7 @@
 	}-*/;
 	
 
-	public final native Set<Topic> getScope() /*-{
+	public final native JsArray<Topic> getScope() /*-{
 		return this.getScope();
 	}-*/;
 	
@@ -34,7 +34,7 @@
 	}-*/;
 	
 
-	public final native Set<Locator> getItemIdentifiers() /*-{
+	public final native JsArray<Locator> getItemIdentifiers() /*-{
 		return this.getItemIdentifiers();
 	}-*/;
 	

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/JtmsTmEngine.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/JtmsTmEngine.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/JtmsTmEngine.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -1,6 +1,11 @@
 package us.isidor.gdl.anaToMia.TmEngine.jtmsBasedEngine;
 
 import java.util.ArrayList;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+
 import us.isidor.gdl.anaToMia.TmEngine.Base.TmEngine;
 import us.isidor.gdl.anaToMia.TmEngine.TopicMaps.TopicMap;
 
@@ -13,7 +18,7 @@
 		factory = $wnd.TopicMapSystemFactory.newInstance();
 		factory.setProperty('com.semanticheadache.tmjs.backend', 'memory');
 		sys = factory.newTopicMapSystem();
-		tmid = sys.createLocator("http://example.org/mytm");
+		tmid = sys.createLocator(tmLocator);
 		tm = sys.createTopicMap(tmid);
 		
 		return tm;
@@ -52,25 +57,33 @@
 	
 	
 	@Override
-	public TopicMap read(String tmData, TopicMap tm) {
-		return readJtm10(tmData, tm);
+	public void importTm(String tmData, TopicMap tm) {
+		importJTM10(tmData, tm);
 	}
 	
 
 	@Override
-	public String write(TopicMap tm) {
-		return writeJtm10(tm);
+	public String exportTm(TopicMap tm) {
+		return exportJTM10(tm);
 	}
 	
 	
-	private TopicMap readJtm10(String jtm, TopicMap tm){
+	private final native void importJTM10(String jtm, TopicMap tm) /*-{
 		// TODO: implement
-		return null;
-	}
+	}-*/;
 	
 	
-	private String writeJtm10(TopicMap tm){
+	private String exportJTM10(TopicMap tm){
+		JavaScriptObject json = writeJtm10ToJSON(tm);
+		
 		// TODO: implement
+		
 		return null;
 	}
+	
+	
+	private final native JavaScriptObject writeJtm10ToJSON(TopicMap tm) /*-{
+		var writer = new $wnd.TM.JTM.Writer(tm);
+		return writer.toObject(tm);
+	}-*/;
 }

Modified: branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/TestClass.java	Tue Jun 21 08:10:09 2011	(r493)
+++ branches/gdl-frontend/src/anaToMia/GDL_TmEngine/src/us/isidor/gdl/anaToMia/TmEngine/jtmsBasedEngine/TestClass.java	Tue Jun 21 11:33:11 2011	(r494)
@@ -2,8 +2,6 @@
 
 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.user.client.Window;
-import us.isidor.gdl.anaToMia.TmEngine.TopicMaps.Locator;
-import us.isidor.gdl.anaToMia.TmEngine.TopicMaps.Topic;
 import us.isidor.gdl.anaToMia.TmEngine.TopicMaps.TopicMap;
 
 
@@ -13,13 +11,28 @@
 	public void onModuleLoad() {
 		Window.alert(">> TEST !!!");
 		
+		/*
 		JtmsTmEngine tme = new JtmsTmEngine();
 		TopicMap tm = tme.createTopicMap("http://my.tm/tm-1");
+		Window.alert(">> tm: " + tm.getLocator().getReference());
+		*/
 		
-		Window.alert(">> tm reference: " + tm.getLocator().getReference());
+		/*
+		tm.createTopicBySubjectIdentifier(tm.createLocator("http://my.tm/tm-1/top-1"));
+		Window.alert("1: " + tm.getTopics().length());
+		tm.createTopicBySubjectIdentifier(tm.createLocator("http://my.tm/tm-1/top-2"));
+		Window.alert("2: " + tm.getTopics().length());
+		tm.createTopicBySubjectIdentifier(tm.createLocator("http://my.tm/tm-1/top-3"));
+		Window.alert("3: " + tm.getTopics().length());
+		*/
 		
-		Locator psi = tm.createLocator("http://this.is.topic.top");
-		Topic top = tm.createTopicBySubjectIdentifier(psi);
-		Window.alert(">> top: " + top.classType());
+		
+		/*
+		String jtm =  "{\"version\": \"1.0\",\"item_type\": \"topicmap\",\"topics\": [{\"subject_identifiers\": [\"http://psi.topincs.com/movies/dear-wendy\",\"http://psi.semanticheadache.com/movies/dear-wendy\"],\"names\": [{\"value\": \"Dear Wendy\",\"type\": \"si:http://psi.topincs.com/title\",\"scope\": [\"si:http://www.topicmaps.org/xtm/1.0/country.xtm#US\",\"si:http://www.topicmaps.org/xtm/1.0/country.xtm#DE\"]}],\"occurrences\": [{\"value\": \"2005\",\"type\": \"si:http://psi.topincs.com/publication-year\",\"datatype\": \"http://www.w3.org/2001/XMLSchema#gYear\"}]}],\"associations\": [{\"type\": \"si:http://psi.topicmaps.org/iso13250/model/type-instance\",\"roles\": [{\"player\": \"si:http://psi.topincs.com/movies/dear-wendy\",\"type\": \"si:http://psi.topicmaps.org/iso13250/model/instance\"},{\"player\": \"si:http://psi.topincs.com/movie\",\"type\": \"si:http://psi.topicmaps.org/iso13250/model/type\"}]}]}";
+		
+		
+		tme.importTm(jtm, tm);
+		Window.alert("" + tm.getTopics().length());
+		*/
 	}
 }




More information about the Isidorus-cvs mailing list