cancel
Showing results for 
Search instead for 
Did you mean: 

How to show properties of the inherited custom content ?

acis
Champ in-the-making
Champ in-the-making
Hi all,

I've started to work with Alfresco since a few days and I try currently to create custom content and display their properties.

In my xml model, I've defined two custom types, one inherits from "cm:content" and the second inherits from my first custom type :


   <types>

      <type name="mym:MySupDoc">
         <title>My Super Doc</title>
         <parent>cm:content</parent>
         <properties>
            <property name="mym:MySupProp">
               <title>My Super Prop</title>
               <type>d:text</type>
            </property>
         <properties>
      </type>

      <type name="mym:MyDoc">
         <title>My Doc</title>
         <parent>mym:MySupDoc</parent>
         <properties>
            <property name="mym:MyProp">
               <title>My Prop</title>
               <type>d:text</type>
            </property>
         <properties>
      </type>

   </types>

In the web-client-config-custom.xml, I added the following code to see my two new types in the content wizard and show their properties in the view/edit properties window:


   <config evaluator="string-compare" condition="Content Wizards">
         <content-types>
            <type name="mym:MySupDoc"/>
            <type name="mym:MyDoc"/>
         </content-types>
   </config>
  
   <config evaluator="node-type" condition="mym:MySupDoc">
      <property-sheet>
         <show-property name="mym:MySupProp" />
      </property-sheet>
   </config>
  
   <config evaluator="node-type" condition="mym:MyDoc">
      <property-sheet>
         <show-property name="mym:MyProp" />
      </property-sheet>
   </config>

When I create a new content, I can choose between my two custom content and if I create a new "mym:MyDoc", I have only, as custom properties, "mym:MyProp". I don't see the custom property "mym:MySupProp" of the inherited custom type.

What should I do to see the custom properties of the inherited custom type?

(if I add <show-property name="mym:MySupProp" /> in the <config evaluator="node-type" condition="mym:MyDoc">, it works, but I don't think that redefine all of the custom properties of the inherited type is the right way).

thanks in advance.
6 REPLIES 6

acis
Champ in-the-making
Champ in-the-making
Nobody for a suggestion ?

chapeaurouge
Champ in-the-making
Champ in-the-making
I have the same thoughts.. Did you get any private answers, or found a solution?

Thanks.

chapeaurouge
Champ in-the-making
Champ in-the-making

acis
Champ in-the-making
Champ in-the-making
I didn't find any solution but I didn't search a lot on that point.

almer_bolatov
Champ in-the-making
Champ in-the-making
Hi, guys…
Any answers found?

iblanco
Confirmed Champ
Confirmed Champ
Redefining all the inherited properties IS the right way AFAIK.
The configuration is property page related, not content hierarchy related, so it makes sense defining specifically what properties to show for each kind. You might want a type to inherit from the parent but not show some of the properties of the parent, or treat them in a differente way. Is annoying but AFAIK that is how it works.