AnsweredAssumed Answered

DocumentLibrary: Custom Content Type and Aspect

Question asked by lamba on Mar 4, 2010
Latest reply on Mar 4, 2010 by lamba
Hello everybody,

I try the following example http: // / wp / wabson / 201 sco-share / to add an aspect personalized in Share:

I created the following files:

kb-model.xml in share\WEB-INF\classes\alfresco\extension

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

    <!– Definition of new Model –>

    <!– The important part here is the name - Note: the use of the my: namespace
         which is defined further on in the document –>
    <model name="kb:knowledgebase" xmlns="">

       <!– Optional meta-data about the model –>
       <description>Knowledge Base Model</description>
       <author>Will Abson</author>

       <!– Imports are required to allow references to definitions in other models –>
            <!– Import Alfresco Dictionary Definitions –>
          <import uri="" prefix="d"/>
          <!– Import Alfresco Content Domain Model Definitions –>
          <import uri="" prefix="cm"/>

       <!– Introduction of new namespaces defined by this model –>
       <!– NOTE: The following namespace should be changed to reflect your own namespace –>
          <namespace uri="" prefix="kb"/>


          <!– Definition of new Content Aspect: Knowledge Base Document –>
          <aspect name="kb:referencable">
             <title>Knowledge Base Referencable</title>
                <property name="kb:documentRef">



kb-model-context.xml in share\WEB-INF\classes\alfresco\extension

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' ''>


        <!– Registration of new models –>
        <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
            <property name="models">


custom-slingshot-application-context.xml in share\WEB-INF\classes\alfresco\web-extension

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' ''>


       <!– Override WebScript Messages - add slingshot application messages –>
       <bean id="webscripts.resources" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
          <property name="resourceBundles">


share-config-custom.xml in share\WEB-INF\classes\alfresco\web-extension

    <config evaluator="aspect" condition="kb:referencable">
                 <!– inherited from cm:content –>
                 <show id="cm:name" />
                 <show id="cm:title" force="true" />
                 <show id="cm:description" force="true" />
                 <show id="mimetype" />
                 <show id="cm:author" force="true" />
                 <show id="size" for-mode="view" />
                 <show id="cm:creator" for-mode="view" />
                 <show id="cm:created" for-mode="view" />
                 <show id="cm:modifier" for-mode="view" />
                 <show id="cm:modified" for-mode="view" />
                 <!–  aspect orb:referencable –>            
                 <show id="kb:documentRef" />
                 <field id="kb:documentRef" label-id="label.kb_documentRef" />
    </alfresco-config> in share\WEB-INF\classes\alfresco\messages

    # Custom knowledge base messages
    label.kb_documentRef=KB Reference
    kb_referencable=Knowledge Base Referencable

And I added the aspect in the aspects.get.config.xml file so that it appears in the window of dialogue " Manage Aspect ". I added:

    <aspect name="{}referencable" />

The problem is, when I try to apply the aspect to a document, it return me the error message " Could not update aspect ".

For those who have already success this, is these steps that I try to add my custom aspect are correct?
What is that I missed anything?

Thank you.