yes. in jackrabbit 1.4 the api exposes the import nodetypes
capabilities of the nodetype manager. this is also available in
jackrabbit:
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
On 3/11/08, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 10, 2008 at 11:27 AM, Vidar Ramdal <[EMAIL PROTECTED]> wrote:
>
> > ...This
>
> > leads me to suspect that the error has to do with
> > http://issues.apache.org/jira/browse/JCR-585 - that the
>
> > NodeTypeRegistry is not available via the "normal" RMI interfaces....
>
> I think you're right, does anyone know about a workaround?
>
> > ...What would be the easisest way to get Sling running on a remote JCR?...
>
> If there's no workaround that allows the nodetypes to be registered
> over RMI, you might have to register them in another way in that
> repository, and we would have to modify Sling so that a failure to
> register the node types only triggers warnings, not a fatal error.
>
> I think we'll need that anyway if people want to run Sling on other
> JCR repositories than Jackrabbit, as registering nodetypes is not part
> of the JCR API.
>
> What do people think?
>
>
> -Bertrand
>
--
-----------------------------------------< [EMAIL PROTECTED] >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---