cancel
Showing results for 
Search instead for 
Did you mean: 

Custom content model not available in Share

willisdl
Champ in-the-making
Champ in-the-making
I've created a custom content model for Alfresco Community 4.2.c, but for some reason I can't make it available in Alfresco Share.  I followed the steps in Jeff Potts <a href="http://ecmarchitect.com/images/articles/alfresco-content/content-article-2ed.pdf">article</a> and created a model (NGA_pub.xml), context file (NGA_pub-model-context.xml), and a share-config-custom.xml and placed them all the the alfresco/extension folder in the tomcat installation.  But when I try to create new content or upload content, the new type does not appear at all.  Also, I cannot create generic content and then change the type to the custom type (the custom type does not appear in the menu again).  Am I missing a step somewhere?  Thanks.

Dave

Here's my code:

NGA_pub.xml

<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>
<model name="publication:publicationdatamodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Publication Content</description>
   <author></author>
   <version>1.0</version>

   <!– 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="publication.data.model" prefix="publication"/>
   </namespaces>
  
   <types>
  
      <!– Definition of new Content Type –>

     <type name="publication:publication">
         <title>Publication</title>
         <parent>cm:content</parent>
         <properties>
            <property name="publication:pub_number">
               <type>d:text</type>
            </property>
         <property name="publication:pub_title">
               <type>d:text</type>
            </property>
         <property name="publication:pub_type">
               <type>d:text</type>
            </property>
         <property name="publication:file_path">
               <type>d:text</type>
            </property>
         <property name="publication:seq_file_path">
               <type>d:text</type>
            </property>
         </properties>
      </type>

    </types>

  
</model>


Here's my NGA_pub-model-context.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
    <!– Registration of new models –>   
    <bean id="NGA_pub.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/NGA_pub.xml</value>
            </list>
        </property>
    </bean>       
</beans>


And here's my share-config-custom.xml:

<alfresco-config>
   <!– Document Library config section –>
   <config evaluator="string-compare" condition="DocumentLibrary">
      <types>
         <type name="cm:content">
            <subtype name="publication:publication" />
         </type>
         <type name="publication:publication" />
      </types>
   </config>
</alfresco-config>
6 REPLIES 6

abarisone
Star Contributor
Star Contributor
Hi,
when you use the Alfresco Web Client, you should expose your custom fields by modifying the web-client-config-custom.xml file.
Similarly in you have to do the same in Share.
Take a look here http://forums.alfresco.com/forum/end-user-discussions/alfresco-share/share-custom-content-model-0512...

Regards,
Andrea

willisdl
Champ in-the-making
Champ in-the-making
Andrea,
I created the share-config-custom.xml file for Share - I thought the web-client-config-custom.xml was only for Explorer?  Do I need both?

Dave

You're right, you need only share-config-custom for Share.
It was just an example since the concepts behind are almost the same.

Regards,
Andrea

ecarbenay
Star Contributor
Star Contributor
Hi Dave,

did you place your file share-config-custom.xml in the following location : [ALFRESCO]\tomcat\shared\classes\alfresco\web-extension ?

willisdl
Champ in-the-making
Champ in-the-making
Emmanuel,
I did place it in the \alfresco\web-extension folder, but it doesn't seem to have any effect whether it's there or in the alfresco\extension location.

Dave

kaynezhang
World-Class Innovator
World-Class Innovator
1. Your namespace uri should be like this

   <namespaces>

      <namespace uri="http://www.yourcompanyurl.com/model/content/1.0 prefix="publication"/>

   </namespaces>

2.if you are using tomcat7 ,make sure  [ALFRESCO]\tomcat\shared\classes is in your classpath.