gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] fenfire/org/fenfire/modules/pp PPActionsImpl.java


From: Matti Katila
Subject: [Gzz-commits] fenfire/org/fenfire/modules/pp PPActionsImpl.java
Date: Fri, 07 Mar 2003 09:24:52 -0500

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Changes by:     Matti Katila <address@hidden>   03/03/07 09:24:52

Modified files:
        org/fenfire/modules/pp: PPActionsImpl.java 

Log message:
        ok, now it even compiles..

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/modules/pp/PPActionsImpl.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/modules/pp/PPActionsImpl.java
diff -u fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.2 
fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.3
--- fenfire/org/fenfire/modules/pp/PPActionsImpl.java:1.2       Fri Mar  7 
07:20:03 2003
+++ fenfire/org/fenfire/modules/pp/PPActionsImpl.java   Fri Mar  7 09:24:51 2003
@@ -2,47 +2,69 @@
 
 package org.fenfire.modules.pp;
 
-import com.hp.hpl.mesa.rdf.jena.model.*;
 //import java.util.*;
 import java.io.IOException;
 import java.rmi.*;
 import java.rmi.server.*;
 
-import gzz.util.URN5NameSpace;
+//import gzz.util.URN5NameSpace;
 import com.hp.hpl.mesa.rdf.jena.vocabulary.RDF;
+import com.hp.hpl.mesa.rdf.jena.model.*;
+import com.hp.hpl.mesa.rdf.jena.common.*;
 
 /** The implementation of PPActions.
  */
 public class PPActionsImpl extends UnicastRemoteObject implements PPActions {
-public static final String rcsid = "$Id: PPActionsImpl.java,v 1.2 2003/03/07 
12:20:03 mudyc Exp $";
+public static final String rcsid = "$Id: PPActionsImpl.java,v 1.3 2003/03/07 
14:24:51 mudyc Exp $";
     public static final boolean dbg = true;
     protected static void p(String s) { if(dbg) pa(s); }
     protected static void pa(String s) { System.out.println(s); }
 
 
+    class URN5NameSpace {
+       public String generateId() {  return "foobar"; }
+    }
+
+
+    static public Property CONTAINS;
+    static public Property CREATION_TIME;
+    static public Property COORD_X; 
+    static public Property COORD_Y; 
+    static public Property DEPTH;
 
-    static public Property CONTAINS =
-       new PropertyImpl("http://fenfire.org/vocabularity/pp.html#contains";);
-    static public Property CREATION_TIME = 
-       new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#creationTime";);
-    static public Property COORD_X = 
-       new PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordX";);
-    static public Property COORD_Y = 
-       new PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordY";);
-    static public Property DEPTH = 
-       new PropertyImpl("http://fenfire.org/vocabularity/pp.html#depth";);
-
-
-    static public Resource PAPER_TYPE =
-       new ResourceImpl("http://fenfire.org/vocabularity/pp.html#paper_type";);
-    static public Resource NOTE =
-       new ResourceImpl("http://fenfire.org/vocabularity/pp.html#note";);
+
+    static public Resource PAPER_TYPE;
+    static public Resource NOTE;
 
     
 
     public PPActionsImpl(Model model) throws RemoteException {
        super();
        setModel(model);
+
+       try {
+           CONTAINS =
+               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#contains";);
+           CREATION_TIME =
+               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#creationTime";);
+           COORD_X = 
+               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordX";);
+           COORD_Y =
+               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordY";);
+           DEPTH = 
+               new 
PropertyImpl("http://fenfire.org/vocabularity/pp.html#depth";);
+
+
+           // Resources
+           PAPER_TYPE =
+               new 
ResourceImpl("http://fenfire.org/vocabularity/pp.html#paper_type";);
+           NOTE =
+               new 
ResourceImpl("http://fenfire.org/vocabularity/pp.html#note";);
+
+
+       } catch (RDFException e) {
+           pa("Failed: "+e);
+       }
     }
 
     private Model model;
@@ -58,18 +80,23 @@
        n.setText("Uusi paperi");
        return n.getId();
        */
+       
+       try {
 
-       // We need a unique uri for paper       
-       String uri = URN5NameSpace.instance().generateId();
-       Resource paper = model.createResource(uri);
+           // We need a unique uri for paper   
+           String uri = (new URN5NameSpace()).generateId();
+           Resource paper = model.createResource(uri);
 
-       // and resource must be also paper..
-       paper.addProperty(RDF.type, PAPER_TYPE);
+           // and resource must be also paper..
+           paper.addProperty(RDF.type, PAPER_TYPE);
 
-       // set creation time
-       paper.addProperty(CREATION_TIME, "123");  // XXX we need iso 8601 time 
presentation here
+           // set creation time
+           paper.addProperty(CREATION_TIME, "123");  // XXX we need iso 8601 
time presentation here
        
-       return uri;
+           return uri;
+       } catch (RDFException e) {
+           return "";
+       }
     }}
 
 
@@ -109,27 +136,35 @@
        arg.setText("" + y);
        return c.getId();
        */
+       
+       try {
 
-       // find the paper
-       Resource paper = model.getResource(paperURI);
+           // find the paper
+           Resource paper = model.getResource(paperURI);
        
-       // We need a unique uri for note        
-       String uri = URN5NameSpace.instance().generateId();
-       Resource note = model.createResource(uri);
-       note.addProperty(RDF.type, NOTE);
-
-       // set note to paper
-       paper.addProperty(CONTAINS, note);
-
-       // set coords
-       note.addProperty(COORD_X, ""+x);
-       note.addProperty(COORD_X, ""+x);
+           // We need a unique uri for note    
+           String uri = (new URN5NameSpace()).generateId();
+           Resource note = model.createResource(uri);
+           note.addProperty(RDF.type, NOTE);
 
-       // set depth...
-       note.addProperty(DEPTH,  "5");
+           // set note to paper
+           paper.addProperty(CONTAINS, note);
 
-       // scale etc..  XXX
+           // set coords
+           note.addProperty(COORD_X, ""+x);
+           note.addProperty(COORD_X, ""+x);
 
+           // set depth...
+           note.addProperty(DEPTH,  "5");
+
+           // scale etc..  XXX
+
+           return uri;
+
+       } catch (RDFException e) {
+           pa("Fault doing a new note: "+e);
+           return "";
+       }
     }}
 
     public void deleteNote(String noteURI)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]