Hi,
Am Mittwoch, den 12.03.2008, 08:01 +0100 schrieb Bertrand Delacretaz:
> On Tue, Mar 11, 2008 at 7:12 PM, Tobias Bocanegra
> <[EMAIL PROTECTED]> wrote:
> > ...yes. in jackrabbit 1.4 the api exposes the import nodetypes
> > capabilities of the nodetype manager. this is also available in
> > jackrabbit:...(over RMI)...
>
> Thanks Toby, the code that you suggest is very similar to our current
> NodeTypeLoader.registerNodeType(), except that we don't check first if
> the nodetype is already defined.
We don't check, because we don't parse the CND files and don't know
which node types to check for ...
> So I'm not sure why that fails over RMI in Vidar's case (haven't tried
> it myself yet).
Looking at the jackrabbit-jcr-rmi, it seems that we are using the RMI
integration incorrectly in Sling :-( We just use the
ClientAdapterFactory and ServerAdapterFactory classes where we should
use the JackrabbitAdapterFactory and JackrabbitServerAdapterFactory
instead to really be able to support the Jackrabbit API.
Will fix this !
Regards
Felix
>
> -Bertrand
>
>
> >
> > private void initNodeTypes() throws RepositoryException {
> > // check if node types are registered
> > try {
> >
> > session.getWorkspace().getNodeTypeManager().getNodeType("my:HierarchyNode");
> > return;
> > } catch (RepositoryException e) {
> > // ignore
> > }
> > NodeTypeManager ntMgr = session.getWorkspace().getNodeTypeManager();
> > if (ntMgr instanceof JackrabbitNodeTypeManager) {
> > InputStream in =
> > getClass().getResourceAsStream(DEFAULT_NODETYPES);
> > try {
> > ((JackrabbitNodeTypeManager)
> > ntMgr).registerNodeTypes(in,
> > JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
> > in.close();
> > } catch (IOException e) {
> > throw new RepositoryException("Error while importing
> > nodetypes.", e);
> > }
> > }
> > }
> >
> > regards, toby