/[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.7 by mudyc, Sun Mar 9 01:28:20 2003 UTC revision 1.8 by mudyc, Sun Mar 9 01:35:37 2003 UTC
# Line 303  public static final String rcsid = "$Id$ Line 303  public static final String rcsid = "$Id$
303    
304    
305      public void deleteText(String noteURI, int begin, int end)      public void deleteText(String noteURI, int begin, int end)
306          throws RemoteException { synchronized(model) {          throws RemoteException
307        { synchronized(model) { try {
308              /*              /*
309          Cell note = space.getCell(noteId);          Cell note = space.getCell(noteId);
310          note.deleteText(begin, end);          note.deleteText(begin, end);
311              */              */
312    
313          // not implemented          Resource note = model.getResource(noteURI);
314          // ===============          
315            // find actual data
316            Selector s =
317                new SelectorImpl(note, PP.LinkToContentRef, (RDFNode) null);
318            StmtIterator iter = model.listStatements(s);
319            Statement stmt = null;
320            while (iter.hasNext()) {
321                if (stmt != null) throw new Error("Too many data!!");
322                stmt = iter.next();
323            }
324    
325            Resource data = (Resource) stmt.getObject();
326    
327      }}          // find literal
328            s = new SelectorImpl(data, PP.Data, (RDFNode) null);
329            iter = model.listStatements(s);
330            stmt = null;
331            while (iter.hasNext()) {
332                if (stmt != null) throw new Error("Too many data!!");
333                stmt = iter.next();
334            }
335    
336            StringBuffer str = new StringBuffer(stmt.getObject().toString());
337            model.remove(stmt);
338            str.delete(begin, end);
339            data.addProperty(PP.Data, str.toString());
340    
341        } catch (RDFException e) {
342            pa("Fault inserting text to note: "+e);
343        }}}
344  }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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