You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2005/07/09 12:02:02 UTC

[Jackrabbit Wiki] Update of "ExamplesPage" by stefan

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);
      }
  }}}