You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Marcel Dullaart <ma...@gmail.com> on 2007/01/15 16:30:43 UTC

CND Notation: multiple properties that reference another node

Hi,

Recently I asked a question regarding referencing another node, which was
nicely answered.
Now I need to allow multiple references to a node and I'd also like to
restrict the node type that these properties refer to.
I used the following, but that seems to fail:

[epo:Tender]
> epo:Standard
- epo:expiryDate (DATE)
- epo:location
- epo:download (REFERENCE) multiple < 'epo:Resource'

With the following stack:
javax.jcr.nodetype.ConstraintViolationException: no matching property
definition found for {http://www.epo.org/epoline/ns}download
    at
org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef
(EffectiveNodeType.java:775)
    at org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(
NodeImpl.java:926)
    at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java
:457)
    at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java
:407)
    at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2120)
    at
org.epoline.portal.applications.sample.jcr.util.RegisterCNDTest.testAddTender
(RegisterCNDTest.java:409)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:478)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:344)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)

If I remove the multiple attribute:
[epo:Tender]
> epo:Standard
- epo:expiryDate (DATE)
- epo:location
- epo:download (REFERENCE) < 'epo:Resource'

the test case succeeds.
Is it not necessary to add the multiple attribute?

Thanks in advance,
Marcel Dullaart

RE: Configuration variables

Posted by "Pruitt, Steve" <SP...@exstream.com>.
Is there any other way?  I would like to not incorporate another
framework for one bit of small functionality.


-S

You could try the Spring-JCR integration.
Spring has a Module for this. The Doc to go with it (= separate PDF),
clearly explains how to set these.
(in casu: as a property of teh repo bean :-)

Wolf

On 15 Jan 2007, at 22:01, Pruitt, Steve wrote:

I can't seem to locate where to set the rep.home, wsp.name, wsp.home
variables.  I put a <Resource> tag in my application's context.xml and
set the repHomeDir, but it didn't seem to take.  I end up with a default
repository in the bin directory.  I have seen anything to suggest
setting the two workspace variables.


-S


Re: Configuration variables

Posted by Wolf Benz <eu...@gmail.com>.
You could try the Spring-JCR integration.
Spring has a Module for this. The Doc to go with it (= separate PDF),  
clearly explains how to set these.
(in casu: as a property of teh repo bean :-)

Wolf

On 15 Jan 2007, at 22:01, Pruitt, Steve wrote:

I can't seem to locate where to set the rep.home, wsp.name, wsp.home
variables.  I put a <Resource> tag in my application's context.xml and
set the repHomeDir, but it didn't seem to take.  I end up with a default
repository in the bin directory.  I have seen anything to suggest
setting the two workspace variables.


-S


Re: Configuration variables

Posted by Tobias Bocanegra <to...@day.com>.
the nightly snapshot builds can be found on the jackabbit zone [0]. the war
file is in the target directory of the webapp module [1].
regards, toby

[0] http://jackrabbit.zones.apache.org/
[1] http://jackrabbit.zones.apache.org/continuum/servlet/browse?file=1/jackrabbit-webapp/target/jackrabbit-webapp-1.2-SNAPSHOT.war

On 1/17/07, Boden, David <da...@lehman.com> wrote:
>
> >> the current jackrabbit snapshot (1.2.1) contains a
> easy-to-deply-and-configure war file.
>
> Is this snapshot .war available on a Maven repository somewhere, or
> available for download somewhere? Or have I got the wrong end of the
> stick and do I need to build a version for myself?
>
> I've obviously checked the "Downloads" Jackrabbit page for this
> information, I can't see any information on snapshot or milestone
> builds.
>
> Many Thanks,
> Dave
>
> -----Original Message-----
> From: tobias.strasser@gmail.com [mailto:tobias.strasser@gmail.com] On
> Behalf Of Tobias Bocanegra
> Sent: Wednesday, January 17, 2007 7:43 AM
> To: users@jackrabbit.apache.org
> Subject: Re: Configuration variables
>
> hi steve,
> the 'repHomeDir' is set during repository creation and so is the
> repository config xml. the repHomeDir becomes the 'rep'home' variable.
> the 'wsp.name' the name of the respective workspace and 'the wsp.home'
> is usually something like '${rep.home}/workspaces/${wsp.name}'. this is
> configurable in the repository.xml. so no need for spring at all.
> regards, toby
>
> btw: the current jackrabbit snapshot (1.2.1) contains a
> easy-to-deply-and-configure war file. where the repository config and
> the jndi/rmi bind parameters are stored externally. see
> https://issues.apache.org/jira/browse/JCR-697 for details.
>
>
> On 1/15/07, Pruitt, Steve <SP...@exstream.com> wrote:
> > I can't seem to locate where to set the rep.home, wsp.name, wsp.home
> > variables.  I put a <Resource> tag in my application's context.xml and
>
> > set the repHomeDir, but it didn't seem to take.  I end up with a
> > default repository in the bin directory.  I have seen anything to
> > suggest setting the two workspace variables.
> >
> >
> > -S
> >
>
>
> --
> -----------------------------------------< 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 >---
>
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.
>
>
>
>


-- 
-----------------------------------------< 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: Configuration variables

Posted by "Boden, David" <da...@lehman.com>.
>> the current jackrabbit snapshot (1.2.1) contains a
easy-to-deply-and-configure war file.

Is this snapshot .war available on a Maven repository somewhere, or
available for download somewhere? Or have I got the wrong end of the
stick and do I need to build a version for myself?

I've obviously checked the "Downloads" Jackrabbit page for this
information, I can't see any information on snapshot or milestone
builds.

Many Thanks,
Dave

-----Original Message-----
From: tobias.strasser@gmail.com [mailto:tobias.strasser@gmail.com] On
Behalf Of Tobias Bocanegra
Sent: Wednesday, January 17, 2007 7:43 AM
To: users@jackrabbit.apache.org
Subject: Re: Configuration variables

hi steve,
the 'repHomeDir' is set during repository creation and so is the
repository config xml. the repHomeDir becomes the 'rep'home' variable.
the 'wsp.name' the name of the respective workspace and 'the wsp.home'
is usually something like '${rep.home}/workspaces/${wsp.name}'. this is
configurable in the repository.xml. so no need for spring at all.
regards, toby

btw: the current jackrabbit snapshot (1.2.1) contains a
easy-to-deply-and-configure war file. where the repository config and
the jndi/rmi bind parameters are stored externally. see
https://issues.apache.org/jira/browse/JCR-697 for details.


On 1/15/07, Pruitt, Steve <SP...@exstream.com> wrote:
> I can't seem to locate where to set the rep.home, wsp.name, wsp.home 
> variables.  I put a <Resource> tag in my application's context.xml and

> set the repHomeDir, but it didn't seem to take.  I end up with a 
> default repository in the bin directory.  I have seen anything to 
> suggest setting the two workspace variables.
>
>
> -S
>


--
-----------------------------------------< 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 >---


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.




Re: Configuration variables

Posted by Tobias Bocanegra <to...@day.com>.
hi steve,
the 'repHomeDir' is set during repository creation and so is the
repository config xml. the repHomeDir becomes the 'rep'home' variable.
the 'wsp.name' the name of the respective workspace and 'the wsp.home'
is usually something like '${rep.home}/workspaces/${wsp.name}'. this
is configurable in the repository.xml. so no need for spring at all.
regards, toby

btw: the current jackrabbit snapshot (1.2.1) contains a
easy-to-deply-and-configure war file. where the repository config and
the jndi/rmi bind parameters are stored externally. see
https://issues.apache.org/jira/browse/JCR-697 for details.


On 1/15/07, Pruitt, Steve <SP...@exstream.com> wrote:
> I can't seem to locate where to set the rep.home, wsp.name, wsp.home
> variables.  I put a <Resource> tag in my application's context.xml and
> set the repHomeDir, but it didn't seem to take.  I end up with a default
> repository in the bin directory.  I have seen anything to suggest
> setting the two workspace variables.
>
>
> -S
>


-- 
-----------------------------------------< 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 >---

Configuration variables

Posted by "Pruitt, Steve" <SP...@exstream.com>.
I can't seem to locate where to set the rep.home, wsp.name, wsp.home
variables.  I put a <Resource> tag in my application's context.xml and
set the repHomeDir, but it didn't seem to take.  I end up with a default
repository in the bin directory.  I have seen anything to suggest
setting the two workspace variables.


-S

Re: CND Notation: multiple properties that reference another node

Posted by Marcel Dullaart <ma...@gmail.com>.
Thank you for the quick and valid reply, it helped quite a lot.
I thought setting multiple properties worked in the same manner as setting
multiple same named child nodes.
But thinking that over, it can't because it is quite hard to distinguish
between properties when you need to remove one or the other.

Thanks again,
Marcel

On 1/15/07, Shaun Barriball <sb...@yahoo.co.uk> wrote:
>
> Marcel,
> I expect this is due to the setProperty() implementation you're using.
> With multiple properties you must use one of the following:
>
> Property       setProperty(java.lang.String name, Value[] values)
>
> Property       setProperty(java.lang.String name, Value[] values, int
> type)
>
>
> To create the Value[] you'll need to use do the following for each target
> node:
>
> getSession().getValueFactory().createValue(targetNode);
>
> The exception you're seeing is the general exception thrown if there is a
> mismatch in the value type you're using.
> Regards,
> Shaun.
>
> -----Original Message-----
> From: Marcel Dullaart [mailto:marcel.dullaart@gmail.com]
> Sent: 15 January 2007 15:31
> To: users@jackrabbit.apache.org
> Subject: CND Notation: multiple properties that reference another node
>
> Hi,
>
> Recently I asked a question regarding referencing another node, which was
> nicely answered.
> Now I need to allow multiple references to a node and I'd also like to
> restrict the node type that these properties refer to.
> I used the following, but that seems to fail:
>
> [epo:Tender]
> > epo:Standard
> - epo:expiryDate (DATE)
> - epo:location
> - epo:download (REFERENCE) multiple < 'epo:Resource'
>
> With the following stack:
> javax.jcr.nodetype.ConstraintViolationException: no matching property
> definition found for {http://www.epo.org/epoline/ns}download
>     at
>
> org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyD
> ef
> (EffectiveNodeType.java:775)
>     at org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition
> (
> NodeImpl.java:926)
>     at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(
> NodeImpl.java
> :457)
>     at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(
> NodeImpl.java
> :407)
>     at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2120)
>     at
>
> org.epoline.portal.applications.sample.jcr.util.RegisterCNDTest.testAddTende
> r
> (RegisterCNDTest.java:409)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at junit.framework.TestCase.runTest(TestCase.java:154)
>     at junit.framework.TestCase.runBare(TestCase.java:127)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:118)
>     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     at junit.framework.TestSuite.run(TestSuite.java:203)
>     at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>     at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.extensions.TestSetup.run(TestSetup.java:23)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:478)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:344)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
>
> If I remove the multiple attribute:
> [epo:Tender]
> > epo:Standard
> - epo:expiryDate (DATE)
> - epo:location
> - epo:download (REFERENCE) < 'epo:Resource'
>
> the test case succeeds.
> Is it not necessary to add the multiple attribute?
>
> Thanks in advance,
> Marcel Dullaart
>
>
>
> ___________________________________________________________
> The all-new Yahoo! Mail goes wherever you go - free your email address
> from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
>

RE: CND Notation: multiple properties that reference another node

Posted by Shaun Barriball <sb...@yahoo.co.uk>.
Marcel,
I expect this is due to the setProperty() implementation you're using.
With multiple properties you must use one of the following:

 Property 	setProperty(java.lang.String name, Value[] values)

 Property 	setProperty(java.lang.String name, Value[] values, int type)

 
To create the Value[] you'll need to use do the following for each target
node:

getSession().getValueFactory().createValue(targetNode);

The exception you're seeing is the general exception thrown if there is a
mismatch in the value type you're using. 
Regards,
Shaun.

-----Original Message-----
From: Marcel Dullaart [mailto:marcel.dullaart@gmail.com] 
Sent: 15 January 2007 15:31
To: users@jackrabbit.apache.org
Subject: CND Notation: multiple properties that reference another node

Hi,

Recently I asked a question regarding referencing another node, which was
nicely answered.
Now I need to allow multiple references to a node and I'd also like to
restrict the node type that these properties refer to.
I used the following, but that seems to fail:

[epo:Tender]
> epo:Standard
- epo:expiryDate (DATE)
- epo:location
- epo:download (REFERENCE) multiple < 'epo:Resource'

With the following stack:
javax.jcr.nodetype.ConstraintViolationException: no matching property
definition found for {http://www.epo.org/epoline/ns}download
    at
org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyD
ef
(EffectiveNodeType.java:775)
    at org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(
NodeImpl.java:926)
    at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java
:457)
    at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java
:407)
    at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2120)
    at
org.epoline.portal.applications.sample.jcr.util.RegisterCNDTest.testAddTende
r
(RegisterCNDTest.java:409)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:478)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:344)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)

If I remove the multiple attribute:
[epo:Tender]
> epo:Standard
- epo:expiryDate (DATE)
- epo:location
- epo:download (REFERENCE) < 'epo:Resource'

the test case succeeds.
Is it not necessary to add the multiple attribute?

Thanks in advance,
Marcel Dullaart


		
___________________________________________________________ 
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html