AnsweredAssumed Answered

Problems importing content

Question asked by hsjawanda on Nov 2, 2005
Latest reply on Nov 5, 2005 by davidc
Hi,

I have defined my own content model that is complementary to Alfresco's content model.  Most of the content model works fine.  However, it seems that a cm:folder -like type that I have defined (called cms:folder) can only contain cm:content, not my own version of cm:content (called cms:asset).

("cm" being the namespace for Alfresco's content model, "cms" being my own (yeah, not very imaginative, I know :) ))

This problem occurred when trying to bootstrap through ImporterBootstrap. I get an exception that basically says the entity contained within my cms:folder has to be of type cm:content.  Even when I try to derive my cms:asset from cm:content, I get the error message.  Temporarily, I've had to go back to using cm:content instead of cms:asset.

Could there be some hard-coded checking somewhere?  Any help would be highly appreciated.  Please do ask for clarification(s) if I've not been clear.  Thanks.

Here's my content model, wherein I've interspersed some comments for this post:



<model name="cms:contentmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

    <description>F1 CMS Content Model</description>
    <author>Alacre</author>
    <published>2005-10-05</published>
    <version>0.1</version>

    <imports>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
        <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
    </imports>

    <namespaces>
        <namespace uri="http://www.alacre.com/cms/content-model-1.0" prefix="cms"/>
    </namespaces>

    <types>
        <type name="cms:object">
            <title>Object</title>
            <parent>cm:cmobject</parent>
        </type>

        <type name="cms:container">
            <title>Container</title>
            <parent>cms:object</parent>
            <associations>
                <child-association name="cms:contains">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:cmobject</class> <!– This would've been cms:object –>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </target>
                    <duplicate>false</duplicate>
                </child-association>
            </associations>
        </type>

        <type name="cms:project">
            <title>Project</title>
            <parent>cms:container</parent>
        </type>

        <type name="cms:folder">
            <title>Folder</title>
            <parent>cms:container</parent>
        </type>

        <!–type name="cms:asset"> <!– My failed attempt to derive from cm:content. The derivation works, but not the import –>
            <title>Asset</title>
            <parent>cm:content</parent>
        </type–>
        <!– cms:asset is exactly analogous to cm:content, except that the auditable
             aspect has been made mandatory.
        <type name="cms:asset">  <!– The original definition –>
            <title>Asset</title>
            <parent>cms:object</parent>
            <properties>
                <property name="cm:contentUrl">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>true</tokenised>
                    </index>
                </property>
                <property name="cm:mimetype">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
                <property name="cm:encoding">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="cm:size">
                    <type>d:long</type>
                    <mandatory>false</mandatory>
                </property>
            </properties>
            <mandatory-aspects>
                <aspect>cm:versionable</aspect>
            </mandatory-aspects>
        </type>
        –>

    </types>

</model>


Outcomes