cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with new content type/aspect

sweep
Champ in-the-making
Champ in-the-making
Hi all,
I'm trying to add 3 new meta when I add a document using the examples i found in the wiki.
I was not sure if I had to use an aspect or a type, so I added a custom type and the example aspect.
I registered the Model with the Repository. I added the aspect and the type to web_config_properties.xml at the very bottom of the file.

I received no error (the model is OK) but no new field appeared in the edit property view.

I tried then to add the content type to the select in the wizard (as exposed in the web client customization wiki) and the content type is correctly displayed in the select.

I have some question:
1) what do I have to use a content type or an aspect?
2) Is there an error in my files or my approach is completely wrong?

Thank you for help.

This is my examplemodel:

<?xml version='1.0' encoding='UTF-8'?>
<model name="my:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Alfresco Content Model</description>
   <author>Alfresco</author>
   <version>0.1</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"/>
      </imports>

    <namespaces>
      <!– Define a Namespace for my new definitions –>
      <namespace uri="my.new.model" prefix="my"/>
   </namespaces>

     
   <!– Type and Aspect definitions go here –>
   <types>
      <type name="my:iop">
         <title>IO Procedure</title>
         <parent>cm:content</parent>
         <properties>
            <property name="mySmiley TongueroductName">
               <type>d:text</type>
            </property>
            <property name="mySmiley TongueroductCode">
               <type>d:text</type>
            </property>
            <property name="mySmiley TongueroductBarcode">
               <type>d:text</type>
            </property>
       </properties>
      </type>
    </types>
    <aspects>
      <aspect name="my:imageClassification">
         <title>Image Classfication</title>
         <properties>
            <property name="my:width">
               <type>d:int</type>
            </property>
            <property name="my:height">
               <type>d:int</type>
            </property>
            <property name="my:resolution">
               <type>d:int</type>
            </property>
         </properties>
      </aspect>
      </aspects>
</model>

And this is what I added to the web-client-config-properties.xml file.

<config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>
  
   <config evaluator="node-type" condition="my:iop">
      <property-sheet>
         <show-property name="productName" />
          <show-property name="productCode" />
         <show-property name="productBarcode"/>
       </property-sheet>
   </config>



Marco
1 REPLY 1

gavinc
Champ in-the-making
Champ in-the-making
You're approach is correct.

The problem is that you have not used the namespace prefix when referencing the properties, your config should look like the following:

<config evaluator="node-type" condition="my:iop">
<property-sheet>
<show-property name="mySmiley TongueroductName" />
<show-property name="mySmiley TongueroductCode" />
<show-property name="mySmiley TongueroductBarcode"/>
</property-sheet>
</config>