/[fenfire]/fenfire/org/fenfire/modules/pp/PPActionsImpl.java
ViewVC logotype

Diff of /fenfire/org/fenfire/modules/pp/PPActionsImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mudyc, Fri Mar 7 14:24:51 2003 UTC revision 1.4 by mudyc, Fri Mar 7 14:58:27 2003 UTC
# Line 26  public static final String rcsid = "$Id$ Line 26  public static final String rcsid = "$Id$
26      }      }
27    
28    
29        // Propertys
30      static public Property CONTAINS;      static public Property CONTAINS;
31      static public Property CREATION_TIME;      static public Property CREATION_TIME;
32      static public Property COORD_X;      static public Property COORD_X;
# Line 33  public static final String rcsid = "$Id$ Line 34  public static final String rcsid = "$Id$
34      static public Property DEPTH;      static public Property DEPTH;
35    
36    
37        // Resources
38      static public Resource PAPER_TYPE;      static public Resource PAPER_TYPE;
39      static public Resource NOTE;      static public Resource NOTE;
40    
# Line 42  public static final String rcsid = "$Id$ Line 44  public static final String rcsid = "$Id$
44          super();          super();
45          setModel(model);          setModel(model);
46    
47            String pp_voc = "http://fenfire.org/vocabulary/pp.html";
48          try {          try {
49              CONTAINS =              // Propertys
50                  new PropertyImpl("http://fenfire.org/vocabularity/pp.html#contains");              CONTAINS = new PropertyImpl(pp_voc+"#contains");
51              CREATION_TIME =              CREATION_TIME = new PropertyImpl(pp_voc + "#creationTime");
52                  new PropertyImpl("http://fenfire.org/vocabularity/pp.html#creationTime");              COORD_X = new PropertyImpl(pp_voc + "#coordX");
53              COORD_X =              COORD_Y = new PropertyImpl(pp_voc + "#coordY");
54                  new PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordX");              DEPTH = new PropertyImpl(pp_voc + "#depth");
             COORD_Y =  
                 new PropertyImpl("http://fenfire.org/vocabularity/pp.html#coordY");  
             DEPTH =  
                 new PropertyImpl("http://fenfire.org/vocabularity/pp.html#depth");  
   
55    
56              // Resources              // Resources
57              PAPER_TYPE =              PAPER_TYPE = new ResourceImpl(pp_voc + "#paper_type");
58                  new ResourceImpl("http://fenfire.org/vocabularity/pp.html#paper_type");              NOTE = new ResourceImpl(pp_voc + "#note");
             NOTE =  
                 new ResourceImpl("http://fenfire.org/vocabularity/pp.html#note");  
   
   
59          } catch (RDFException e) {          } catch (RDFException e) {
60              pa("Failed: "+e);              pa("Failed: "+e);
61          }          }
# Line 123  public static final String rcsid = "$Id$ Line 117  public static final String rcsid = "$Id$
117    
118      public String newNote(String paperURI, int x, int y, String text)      public String newNote(String paperURI, int x, int y, String text)
119          throws RemoteException          throws RemoteException
120      { synchronized(model) {      { synchronized(model) { try {
         /*  
         Cell c = space.getCell(paperId);  
121    
122          p("New note\n");          // find the paper
123          c = c.N(d.contains);          Resource paper = model.getResource(paperURI);
         c.setText(text); // XXX null content crashes  
         Cell arg = c.N(d.pan);  
         arg.setText("" + x);  
         arg = arg.N(d.pan);  
         arg.setText("" + y);  
         return c.getId();  
         */  
124                    
125          try {          // We need a unique uri for note        
126            String uri = (new URN5NameSpace()).generateId();
127              // find the paper          Resource note = model.createResource(uri);
128              Resource paper = model.getResource(paperURI);          note.addProperty(RDF.type, NOTE);
129            
130              // We need a unique uri for note              // set note to paper
131              String uri = (new URN5NameSpace()).generateId();          paper.addProperty(CONTAINS, note);
132              Resource note = model.createResource(uri);  
133              note.addProperty(RDF.type, NOTE);          // set coords
134            note.addProperty(COORD_X, ""+x);
135              // set note to paper          note.addProperty(COORD_X, ""+x);
136              paper.addProperty(CONTAINS, note);  
137            // set depth...
138              // set coords          note.addProperty(DEPTH,  "5");
139              note.addProperty(COORD_X, ""+x);  
140              note.addProperty(COORD_X, ""+x);          // scale etc..  XXX
141    
142              // set depth...          return uri;
143              note.addProperty(DEPTH,  "5");      } catch (RDFException e) {
144            pa("Fault doing a new note: "+e);
145              // scale etc..  XXX          return "";
146        }}}
             return uri;  
   
         } catch (RDFException e) {  
             pa("Fault doing a new note: "+e);  
             return "";  
         }  
     }}  
147    
148      public void deleteNote(String noteURI)      public void deleteNote(String noteURI)
149                      throws RemoteException                      throws RemoteException

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26