cancel
Showing results for 
Search instead for 
Did you mean: 

Custom aspects, what am I doing wrong?

ejholmgren
Champ in-the-making
Champ in-the-making
I have the following files in /opt/Alfresco/tomcat/shared/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>

    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
    </bean>

</beans>

customModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>Custom Model</description>
   <author>Eric</author>
   <version>1.0</version>

   <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="custom.model" prefix="custom"/>
   </namespaces>

   <aspects>
      <aspect name="custom:customAspect">
         <title>Custom Aspect</title>
         <properties>
            <property name="custom:custom_aspect_id">
               <title>custom_aspect_id</title>
               <type>d:int</type>
            </property>
         </properties>
      </aspect>
   </aspects>

</model>

web-client-custom-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<alfresco-config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="custom:customAspect" display-label="Custom Aspect" display_label_id="custom_aspect" />
      </aspects>
   </config>

   <config evaluator="aspect-name" condition="custom:customAspect">
      <property-sheet>
         <separator name="sepCust1" display-label="Custom Aspect" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:custom_aspect_id" />
      </property-sheet>
   </config>

</alfresco-config>

When I restart tomcat, my new aspect does not appear in the Action Wizard. No errors in the tomcat or alfresco logs either though. What am I doing wrong?
1 REPLY 1

libman
Champ in-the-making
Champ in-the-making
If you do not get any errors, it looks good to me. What you can do is check if Alfresco reads the .xml files at startup. So add some characters outside tags to see if Alfresco gives an error. If it does not, that means that there is another file around there (maybe in a .jar).