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 RobertRitchy
Date Fri, 08 Jul 2005 20:07:32 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 RobertRitchy:
http://wiki.apache.org/jackrabbit/ExamplesPage

------------------------------------------------------------------------------
  {{{
      void rename (Item item, String newName) throws RepositoryException 
      {
-       item.getSession().move(item.getPath(), item.getParent().getPath() + "/" + newName);
+         item.getSession().move(item.getPath(), item.getParent().getPath() + "/" + newName);
      }
  }}}
  
+ 
+ '''Register a Node type'''
+ {{{
+     public void registerNodeType(NodeTypeDef nodeTypeDef, Session session) throws RepositoryException
+     {
+         //NodeTypeRegistry object
+         Workspace wsp = session.getWorkspace();
+         NodeTypeManager ntMgr = wsp.getNodeTypeManager();
+         
+         //non-JSR 170 - jackrabbit specific
+         NodeTypeRegistry ntReg = 
+                 ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
+         NodeTypeRegistry.registerNodeType(nodeTypeDef);
+     }
+ }}}
+ 
+ 

Mime
View raw message