cancel
Showing results for 
Search instead for 
Did you mean: 

I can't get behaviour to work, I really don't know why[SOLVED]

dariodariodario
Champ in-the-making
Champ in-the-making
I tried to have my beahviour work… with no success. I googled it a lot and I think I have been precise about everything… So please help me!

My content model is:


    <namespaces>
        <namespace uri="http://www.mycompany/model/rendition/1.0" prefix="rendition"/>
    </namespaces>

    <types>

        <type name="rendition:rendition">
            <title>Rendition Type</title>
            <parent>mycompany:rendition</parent>
            <mandatory-aspects>
                <aspect>rendition:contentAndTemplate</aspect>
                <aspect>system:identifier</aspect>
            </mandatory-aspects>
        </type>



and then I try to bind the behaviour using this:



        this.policyComponent.bindClassBehaviour(NodeServicePolicies.OnCreateNodePolicy.QNAME,
                QName.createQName(""http://www.mycompany/model/rendition/1.0"", "rendition"),
                this.onCreateNode);


I get the following error:


Caused by: java.lang.IllegalArgumentException: Class http://www.mycompany/model/rendition/1.0}rendition:rendition has not been defined in the data dictionary



I tried various combinations like rendition instead of rendition:rendition… with no success. The content model fully works (it was already working before).

I really don't know what's wrong.

<strong>UPDATE:</strong>

The above code and mapping are allright. The problem was that we were loading the content model dynamically after startup. Putting a
depends-on="bootstrapbean"
in the context file that loads the policy manager will ensure that it is loaded after the content model.

3 REPLIES 3

mrogers
Star Contributor
Star Contributor
The correct call is QName.createQName("http://www.mycompany/model/rendition/1.0", "rendition")


That doesn't work either. We really don't know why!

abarisone
Star Contributor
Star Contributor
Hi,
you're actually defining a new content type but it must have a known parent, as cm:content.
Is mycompany:rendition defined?
Could you provide the wholw custom model file?
I would suggest you to use a mnemonic namespace as your company name or project name.


Regards,
Andrea