jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: help please: no matching property definition found
Date Mon, 31 Jul 2006 14:21:42 GMT
hi dan,

i ran the following test code on svn head:

            NamespaceRegistry nsReg = wsp.getNamespaceRegistry();
            nsReg.registerNamespace("cm", "http://www.pointalliance.com/cm");

            JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
                    session.getWorkspace().getNodeTypeManager();
            manager.registerNodeTypes(new FileInputStream("d:/temp/test.cnd"),
                    JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
            NodeType nt = manager.getNodeType("cm:keywordEntryNode");
            Node n = root.addNode("foo", "cm:keywordEntryNode");
            n.setProperty("cm:orderPosition", 99);

everything worked as expected.

btw: i had to comment a few lines in your cnd because of unresolved externals:

<test.cnd>
	[cm:languageLabelNode] > nt:base,mix:referenceable,mix:lockable
	-cm:language (string) = 'en' mandatory autocreated copy
	-cm:label (string) mandatory copy
	
	[cm:keywordEntryNode] > nt:base,mix:referenceable,mix:lockable
	-cm:entryValue (string) mandatory copy
	-cm:orderPosition (string) mandatory copy
	-cm:default (boolean) mandatory copy
	+* (cm:languageLabelNode) = cm:languageLabelNode copy
	
	//[cm:keywordNode] > cm:entityNode
	//+* (cm:keywordEntryNode) = cm:keywordEntryNode copy
	
	//[cm:keywordsNode] > nt:base
	//+* (cm:keywordNode) = cm:keywordNode copy
</test.cnd>

cheers
stefan

On 7/24/06, dan z <danz8086@hotmail.com> wrote:
> Hi all,
>
> I'm having problem with the following node type definition that is imported
> into the repository with the compact reader. The purpose is to define a
> keyword list collection that contains multilingual labels.
>
> [cm:languageLabelNode] > nt:base,mix:referenceable,mix:lockable
> -cm:language (string) = 'en' mandatory autocreated copy
> -cm:label (string) mandatory copy
>
> [cm:keywordEntryNode] > nt:base,mix:referenceable,mix:lockable
> -cm:entryValue (string) mandatory copy
> -cm:orderPosition (string) mandatory copy
> -cm:default (boolean) mandatory copy
> +* (cm:languageLabelNode) = cm:languageLabelNode
>   copy
>
> [cm:keywordNode] > cm:entityNode
> +* (cm:keywordEntryNode) = cm:keywordEntryNode
>   copy
>
> [cm:keywordsNode] > nt:base
> +* (cm:keywordNode) = cm:keywordNode
>   copy
>
> When creating new "keywordEntryNode" and setting the "orderPosition"
> property, I keep gettting error complaining that "no matching property
> definition found" for the "orderPosition" property of nodeType
> "cm:keywordEntryNode".
>
> Then I used the following code to list all declared property definitions,
> the result doesn't contain my property definition for "cm:orderPosition"
> either.
>
> PropertyDefinition[] pdf =
> node.getPrimaryNodeType().getDeclaredPropertyDefinitions();
>                 for (int i=0;i<pdf.length;i++){
>                         logger.debug("** pdf " + i + " - " + pdf[i].getName() );
>                         String[] ss = pdf[i].getValueConstraints();
>                         for(int j=0;j<ss.length;j++){
>                                 logger.debug(" --- " + ss[j]);
>                         }
>                 }
>
>
> Could anyone advise on what have I missed? Thanks in advance.
>
> D.
>
> _________________________________________________________________
> Play Q6 for your chance to WIN great prizes.
> http://q6trivia.imagine-live.com/enca/landing
>
>

Mime
View raw message