Error when saving document of custom type in Alfresco Share

Posted by ht0ma on Stack Overflow See other posts from Stack Overflow or by ht0ma
Published on 2013-07-01T17:03:53Z Indexed on 2013/07/01 17:05 UTC
Read the original article Hit count: 233

Filed under:
|
|

I got this exception when trying to save a new document of custom type: org.alfresco.service.cmr.repository.MalformedNodeRefException: 06010026 Invalid node ref - does not contain forward slash: {node.nodeRef}

Here is how the definition of the custom type looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Definition of new Model -->
<model name="ht:channelmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
 <!-- Imports are required to allow references to definitions in other models
-->
 <imports>
 <!-- Import Alfresco Dictionary Definitions -->
 <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
 <!-- Import Alfresco Content Domain Model Definitions -->
 <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
 </imports>
 <!-- Introduction of new namespaces defined by this model -->
 <namespaces>
 <namespace uri="http://www.someco.com/model/content/1.0" prefix="ht" />
 </namespaces>

 <types>
 <!-- Here comes my type -->
    <type name="ht:doc">
        <title>Custom Document</title>
        <parent>cm:content</parent>
        <mandatory-aspects>
            <aspect>cm:generalclassifiable</aspect>
        </mandatory-aspects>
    </type>
 </types>

 <aspects>
    <aspect name="ht:channel">
        <title>Content Channel</title>
        <properties>
            <property name="ht:isWeb">
                <type>d:boolean</type>
            </property>
        </properties>
    </aspect>
 </aspects>
</model>

and here is how I set the forms for displaying the creation of a new document of my custom type (inside share-config-custom.xml)

<alfresco-config>               
   <config evaluator="string-compare" condition="DocumentLibrary">
        <create-content>
            <content id="plain-text" mimetype="text/plain" label="Prompt" itemid="ht:doc" />
        </create-content>
        <aspects>
            <visible>
                <aspect name="ht:channel" />
            </visible>
            <addable>
            </addable>
            <removeable>
            </removeable>
        </aspects>

        <types>
            <type name="cm:content">
                <subtype name="ht:doc" />
            </type>
        </types>
    </config>

     <config evaluator="model-type" condition="ht:doc">
      <forms>
         <form>
            <field-visibility>
               <show id="cm:title" force="true" />
               <show id="ht:isWeb" force="true" />
            </field-visibility>
            <appearance>
               <field id="cm:title">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
            </appearance>
         </form>        
      </forms>
   </config>    
</alfresco-config>

Is is something wrong with the formatting or am I missing some fields in the type definition?

Thanks

© Stack Overflow or respective owner

Related posts about alfresco

Related posts about alfresco-share