You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sean Callan <se...@gmail.com> on 2007/12/18 15:51:34 UTC

Jackrabbit Custom Nodes

I'm having some trouble creating my own custom nodes and I've done a
fair amount of searching online but I'm still ending up with errors.

This is the exception that is being generated, it's very cyptic and
not very informative : "(java.lang.String) Error while parsing
'webfmis:resource' (cnd input stream, line 1)"

I have the following code:

## CND File
[webfmis:resource] > nt:resource
- webfmis:fileName (string)
- webfmis:size (string)

## Java Loading
JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
ticket.getWorkspace().getNodeTypeManager();
manager.registerNodeTypes(new
FileInputStream(Properties.getWebInfPath() +
"/repositoryNodeTypes.cnd"),
JackrabbitNodeTypeManager.TEXT_X_JCR_CND);

Thanks guys!

Re: Jackrabbit Custom Nodes

Posted by Sean Callan <se...@gmail.com>.
Hi Julian,

Declaring it in the CND or are you referring to the code?  I do
register it in the code, but I just left that portion off as I didn't
think it was necessary.

On Dec 18, 2007 10:09 AM, Julian Reschke <ju...@gmx.de> wrote:
> Sean Callan wrote:
> > I'm having some trouble creating my own custom nodes and I've done a
> > fair amount of searching online but I'm still ending up with errors.
> >
> > This is the exception that is being generated, it's very cyptic and
> > not very informative : "(java.lang.String) Error while parsing
> > 'webfmis:resource' (cnd input stream, line 1)"
> >
> > I have the following code:
> >
> > ## CND File
> > [webfmis:resource] > nt:resource
> > - webfmis:fileName (string)
> > - webfmis:size (string)
> > ...
>
> Shouldn't you declaring the "webfmis" prefix?
>
> BR, Julian
>

Re: Jackrabbit Custom Nodes

Posted by Julian Reschke <ju...@gmx.de>.
Sean Callan wrote:
> I'm having some trouble creating my own custom nodes and I've done a
> fair amount of searching online but I'm still ending up with errors.
> 
> This is the exception that is being generated, it's very cyptic and
> not very informative : "(java.lang.String) Error while parsing
> 'webfmis:resource' (cnd input stream, line 1)"
> 
> I have the following code:
> 
> ## CND File
> [webfmis:resource] > nt:resource
> - webfmis:fileName (string)
> - webfmis:size (string)
> ...

Shouldn't you declaring the "webfmis" prefix?

BR, Julian

Re: Jackrabbit Custom Nodes

Posted by Brian Thompson <el...@gmail.com>.
I had this issue last time I was using Jackrabbit in a project.  As a
workaround, I specified the base namespaces in the CND:

## CND
<nt = 'http://www.jcp.org/jcr/nt/1.0'>

<webfmis="http://www.mysite.com">
[webfmis:doc] > nt:resource
- webfmis:fileName (string)
- webfmis:size (string)


-Brian



On Dec 18, 2007 9:55 AM, Sean Callan <se...@gmail.com> wrote:

> Hi,
>
> I made some modification to my CND as instructed:
>
> ## CND
> <webfmis="http://www.mysite.com">
> [webfmis:doc] > nt:resource
> - webfmis:fileName (string)
> - webfmis:size (string)
>
> However, now this error is generated
> "(java.lang.String) Error while parsing 'nt:resource' (cnd input
> stream, line 2)"
>
> Could there be an issue with the line return characters?  I'm
> currently on Windows I wasn't sure if perhaps the issue was with the
> \n\r.
>
>
> On Dec 18, 2007 10:04 AM, Tobias Bocanegra <to...@day.com>
> wrote:
> > you probably forgot the register your namespace:
> >
> > <webfmis=http://your.company.org>
> > [webfmis:resource] > nt:resource
> > - webfmis:fileName (string)
> > - webfmis:size (string)
> >
> > regards, toby
> >
> >
> >
> > On 12/18/07, Sean Callan <se...@gmail.com> wrote:
> > > I'm having some trouble creating my own custom nodes and I've done a
> > > fair amount of searching online but I'm still ending up with errors.
> > >
> > > This is the exception that is being generated, it's very cyptic and
> > > not very informative : "(java.lang.String) Error while parsing
> > > 'webfmis:resource' (cnd input stream, line 1)"
> > >
> > > I have the following code:
> > >
> > > ## CND File
> > > [webfmis:resource] > nt:resource
> > > - webfmis:fileName (string)
> > > - webfmis:size (string)
> > >
> > > ## Java Loading
> > > JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
> > > ticket.getWorkspace().getNodeTypeManager();
> > > manager.registerNodeTypes(new
> > > FileInputStream(Properties.getWebInfPath() +
> > > "/repositoryNodeTypes.cnd"),
> > > JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
> > >
> > > Thanks guys!
> > >
> >
> >
> > --
> > -----------------------------------------< tobias.bocanegra@day.com >---
> > 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 >---
> >
>

Re: Jackrabbit Custom Nodes

Posted by Sean Callan <se...@gmail.com>.
Hi,

I made some modification to my CND as instructed:

## CND
<webfmis="http://www.mysite.com">
[webfmis:doc] > nt:resource
- webfmis:fileName (string)
- webfmis:size (string)

However, now this error is generated
"(java.lang.String) Error while parsing 'nt:resource' (cnd input
stream, line 2)"

Could there be an issue with the line return characters?  I'm
currently on Windows I wasn't sure if perhaps the issue was with the
\n\r.


On Dec 18, 2007 10:04 AM, Tobias Bocanegra <to...@day.com> wrote:
> you probably forgot the register your namespace:
>
> <webfmis=http://your.company.org>
> [webfmis:resource] > nt:resource
> - webfmis:fileName (string)
> - webfmis:size (string)
>
> regards, toby
>
>
>
> On 12/18/07, Sean Callan <se...@gmail.com> wrote:
> > I'm having some trouble creating my own custom nodes and I've done a
> > fair amount of searching online but I'm still ending up with errors.
> >
> > This is the exception that is being generated, it's very cyptic and
> > not very informative : "(java.lang.String) Error while parsing
> > 'webfmis:resource' (cnd input stream, line 1)"
> >
> > I have the following code:
> >
> > ## CND File
> > [webfmis:resource] > nt:resource
> > - webfmis:fileName (string)
> > - webfmis:size (string)
> >
> > ## Java Loading
> > JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
> > ticket.getWorkspace().getNodeTypeManager();
> > manager.registerNodeTypes(new
> > FileInputStream(Properties.getWebInfPath() +
> > "/repositoryNodeTypes.cnd"),
> > JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
> >
> > Thanks guys!
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> 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 >---
>

Re: Jackrabbit Custom Nodes

Posted by Tobias Bocanegra <to...@day.com>.
you probably forgot the register your namespace:

<webfmis=http://your.company.org>
[webfmis:resource] > nt:resource
- webfmis:fileName (string)
- webfmis:size (string)

regards, toby


On 12/18/07, Sean Callan <se...@gmail.com> wrote:
> I'm having some trouble creating my own custom nodes and I've done a
> fair amount of searching online but I'm still ending up with errors.
>
> This is the exception that is being generated, it's very cyptic and
> not very informative : "(java.lang.String) Error while parsing
> 'webfmis:resource' (cnd input stream, line 1)"
>
> I have the following code:
>
> ## CND File
> [webfmis:resource] > nt:resource
> - webfmis:fileName (string)
> - webfmis:size (string)
>
> ## Java Loading
> JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
> ticket.getWorkspace().getNodeTypeManager();
> manager.registerNodeTypes(new
> FileInputStream(Properties.getWebInfPath() +
> "/repositoryNodeTypes.cnd"),
> JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
>
> Thanks guys!
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
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 >---