Basil
Basil

Reputation: 855

Alfresco custom type not shown

I'm new to alfresco, I'm trying to create a custom content model as follows

<?xml version="1.0" encoding="UTF-8"?>
<model name="sw:translationmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">   
    <description>Translation Model</description>   
    <author>Basil</author>    
    <imports>        
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />        
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
    </imports>        
    <namespaces>        
        <namespace uri="http://smartway-me.com/model/data/1.0" prefix="sw" />            
    </namespaces>
    <types>
        <type name="sw:doc">                
            <parent>cm:content</parent>                
        </type>
        <type name="sw:translatableDoc">
            <parent>sw:doc</parent>
            <mandatory-aspects>                    
                <aspect>sw:translatable</aspect>                    
            </mandatory-aspects>                
        </type>            
        <type name="sw:translationDoc">                
            <title>Translation Document</title>
            <parent>sw:doc</parent>
            <properties>                    
                <property name="sw:author">                        
                    <type>d:text</type>                        
                </property>                    
                <property name="sw:language">                        
                    <type>d:text</type>                        
                </property>                    
                <property name="sw:translationTime">                        
                    <type>d:date</type>                       
                </property>                    
            </properties>
            <associations>
                <association name="sw:translationOf">    
                </association>
            </associations>
        </type>            
    </types>
    <aspects>        
        <aspect name="sw:translatable">            
            <title>Translatable Doc</title>            
            <associations>               
                <association name="sw:translations">                    
                    <source>                        
                        <mandatory>false</mandatory>                        
                        <many>true</many>                        
                    </source>                        
                    <target>                        
                        <class>sw:translationDoc</class>                        
                        <mandatory>false</mandatory>                        
                        <many>true</many>                        
                    </target>                        
                </association>                    
            </associations>                
        </aspect>        
    </aspects>          
</model>

and then I tried to add the types and aspects in the former model to the share-config-custom.xml, I used the dynamic approach to deploying the custom model, but the types in my model never appears in the create menu, What am I missing here?

here are the parts I modified in share-config-custom.xml

<aspects>
         <!-- Aspects that a user can see -->
         <visible>
            <aspect name="cm:generalclassifiable" />
            <aspect name="cm:complianceable" />
            <aspect name="cm:dublincore" />
            <aspect name="cm:effectivity" />
            <aspect name="cm:summarizable" />
            <aspect name="cm:versionable" />
            <aspect name="cm:templatable" />
            <aspect name="cm:emailed" />
            <aspect name="emailserver:aliasable" />
            <aspect name="cm:taggable" />
            <aspect name="app:inlineeditable" />
            <aspect name="gd:googleEditable" />
            <aspect name="cm:geographic" />
            <aspect name="exif:exif" />
            <aspect name="audio:audio" />
            <aspect name="cm:indexControl" />
            <aspect name="dp:restrictable" />
            <aspect name="sw:translateable">
         </visible>
         ....
<types>
         <type name="cm:content">
            <subtype name="sw:doc" />
            <subtype name="sw:translatableDoc" />
            <subtype name="sw:translationDoc"/>
         </type>

         <type name="cm:folder">
         </type>

         <type name="trx:transferTarget">
            <subtype name="trx:fileTransferTarget" />
         </type>

         <type name="sw:translationDoc">

      </types>

Upvotes: 1

Views: 720

Answers (1)

mitpatoliya
mitpatoliya

Reputation: 2037

You have to add following entry in share-config-custom.xml in order see your custom content type in content creation menu.

<config evaluator="string-compare" condition="DocumentLibrary">

<types>
         <type name="cm:content">
            <subtype name="sw:doc" />
            <subtype name="sw:translatableDoc" />
            <subtype name="sw:translationDoc"/>
         </type>

         <type name="cm:folder">
         </type>

         <type name="trx:transferTarget">
            <subtype name="trx:fileTransferTarget" />
         </type>

         <type name="sw:translationDoc">

      </types>

<create-content>
         <content id="plain-text" label="create-content.text" type="pagelink" index="10" icon="text">
            <param name="page">create-content?destination={nodeRef}&amp;itemId=sw:translatableDoc&amp;mimeType=text/plain</param>
         </content>
</create-content>

</config>

Checkout this entry

<content id="plain-text" label="create-content.text" type="pagelink" index="10" icon="text">
            <param name="page">create-content?destination={nodeRef}&amp;itemId=sw:translatableDoc&amp;mimeType=text/plain</param>
         </content>

You need to specify your custom content type here.

Upvotes: 2

Related Questions