jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jackrabbit Wiki] Update of "ExamplesPage" by stefan
Date Sat, 09 Jul 2005 10:02:02 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The following page has been changed by stefan:
http://wiki.apache.org/jackrabbit/ExamplesPage

The comment on the change is:
fixing type, correcting rename example (works only for nodes)

------------------------------------------------------------------------------
          //create the file node - see section 6.7.22.6 of the spec
          Node fileNode = folderNode.addNode (file.getName (), "nt:file");
          
-         //create the manditory child node - jcr:content
+         //create the mandatory child node - jcr:content
          Node resNode = fileNode.addNode ("jcr:content", "nt:resource");
          resNode.setProperty ("jcr:mimeType", mimeType);
          resNode.setProperty ("jcr:encoding", encoding);
@@ -31, +31 @@

  
  
  
- '''Renaming a Property or Node'''
+ '''Renaming a Node'''
  {{{
-     void rename (Item item, String newName) throws RepositoryException 
+     void rename(Node node, String newName) throws RepositoryException 
      {
-         item.getSession().move(item.getPath(), item.getParent().getPath() + "/" + newName);
+         node.getSession().move(node.getPath(), node.getParent().getPath() + "/" + newName);
      }
  }}}
  

Mime
View raw message