cancel
Showing results for 
Search instead for 
Did you mean: 

custom content not available

marco_tecnoteca
Champ in-the-making
Champ in-the-making
Hi everybody,
I've created a custom content and when tomcat starts all is fine.
But, when I launch the "create content wizard" my custom type is not shown, so I'm not able to use it.
What am I missing?

These are my config files:

1) …classes/alfresco/extension/web-client-config-custom.xml

<config evaluator="string-compare" condition="Content Wizards">
        <content-types>
                <type name="aa:bb" />
        </content-types>
   </config>

   <config evaluator="node-type" condition="aa:bb">
        <property-sheet>
                <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
                <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />
                <show-association name="custom:PRFiles"/>
        </property-sheet>
   </config>

2) …classes/alfresco/extension/customModel.xml

<types>
        <type name="aa:bb">
                <title>My Content</title>
                <parent>cm:content</parent>
                <associations>
                        <association name="custom:PRFiles">
                                <title>Associated files</title>
                                <target>
                                        <class>cm:content</class>
                                        <mandatory>false</mandatory>
                                        <many>true</many>
                                </target>
                        </association>
                </associations>
                <mandatory-aspects>
                        <aspect>cm:versionable</aspect>
                </mandatory-aspects>
        </type>
</types>

3) …classes/alfresco/extension/custom-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="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
    </bean>

</beans>

Ps: I've tried to insert some wrong XML code inside the "web-client-config-custom.xml" file and tomcat didn't startup, as expected.
This means tomcat is currently parsing my files!

Thanks,
Marco
6 REPLIES 6

ebell
Champ in-the-making
Champ in-the-making
Make sure you add your custom types correctly….
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="bl:doc"/>
      </content-types>
   </config>
   <config evaluator="string-compare" condition="Action Wizards">
   <!–The list of aspects to show in the add/remove features action –>
   <!–and the hasaspect condition–>
   <aspects>
      <aspect name="bl:expireable"/>
      <aspect name="bl:nameable"/>
      <aspect name="bl:approvable"/>
   </aspects>
   <!–The list of types shown in the issubtype condition –>
   <subtypes>
       <type name="bl:doc" />
   </subtypes>
   <!–The list of content and/or folder types shown in the specialisetype action –>
   <specialise-types>
          <type name="bl:doc" />
   </specialise-types>
   </config>
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
                              <type name="bl:doc" />
         </content-types>
         <custom-properties>
            <meta-data aspect="bl:nameable" property="bl:fname" display-label-id="firstname"/>
            <meta-data aspect="bl:nameable" property="bl:lname" display-label-id="lastname"/>
            <meta-data aspect="bl:expireable" property="bl:expired" display-label-id="expired"/>
            <meta-data aspect="bl:expireable" property="bl:expirationdate" display-label-id="expirationdate" />
         </custom-properties>
      </advanced-search>
   </config>

mabayona
Champ on-the-rise
Champ on-the-rise
You have to add your custom type in the web-client-config-custom.xml:

   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="aa:bb" />
      </content-types>
   </config>

This is enough for the wizard to show your type. If this does not work, your problem is that the custom model is not properly created or is not being read.

The header of yout customModel.xml shoul be something like this:

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

   <!– Optional meta-data about the model –>  
   <description>Custom Model</description>
   <author>xxx</author>
   <version>1.0</version>

   <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"/>
     <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="custom.model" prefix="aa"/>
   </namespaces>

marco_tecnoteca
Champ in-the-making
Champ in-the-making
There's no way.
I've used the code mabayoba posted, nothing changed.
Tomcat starts but no custom content!

I've also tried to use the "example-model-context.xml" as explained in the "web-client-config-custom.xml"; no changes as well.

Thanks for your support,
Marco

mabayona
Champ on-the-rise
Champ on-the-rise
Can you post your complete model to see how it looks?

It would be helpful also to know about your environment (alfresco version, tomcat, DDBB, O.S:, …).

For your comfort just to mention that there are thousands of Alfresco installations (including mine) with fully working Custom Models.

marco_tecnoteca
Champ in-the-making
Champ in-the-making
Hi, in the end I solved my problem.
I found a way to debug my model and fix the errors.

Solution

First move to WEB-INF/lib directory, then execute:

java -cp .:../classes:alfresco-repository.jar:alfresco-core.jar:log4j-1.2.8.jar:commons-logging-1.0.4.jar:ehcache-1.3.0-patched.jar:jibx-run.jar:xpp3-1.1.3_8.jar:spring-2.0.2.jar org.alfresco.repo.dictionary.TestModel  alfresco/extension/nameOfYourModule.xml

Thank you all for the support,
Marco

nys
Champ in-the-making
Champ in-the-making
Hi,

I am also facing the same problem.My custom content type is not available while create/add a new content.
Could you please explain in detail how you solved the problem.

Thanks
nys