AnsweredAssumed Answered

Aspect Inheritance

Question asked by ashwini on Jun 3, 2011
Latest reply on Jun 4, 2011 by jpotts
Hello ,

I am working on content model and want to use aspect inheritance.

Below is my code  where I have inherited aspect dm:customer123 from aspect dm:customer and inherited only single property.

<?xml version="1.0" encoding="UTF-8"?>
<model name="dm:demoModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– File goes in shared/classes/alfresco/extension –>

    <!– Meta-data about the model –>
    <description>Demo Model</description>
    <author>Paul Hampton</author>
    <version>1.0</version>

    <!– Imports are required to allow references to definitions in other models –>
    <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 Alfresco Content Domain Model Definitions –>
        <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
        <import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" />
    </imports>

    <!– Sites Namespace –>
    <namespaces>
        <namespace uri="http://www.alfresco.org/model/demomodel/1.0" prefix="dm" />
    </namespaces>
    <types>
         <type name="dm:contract">
            <title>Contract</title>
            <parent>cm:content</parent>
            <properties>
                <property name="dm:contractid">
                    <title>Contract Number</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
         <type name="dm:sop">
            <title>Standard Operating Procedure</title>
            <parent>cm:content</parent>
            <properties>
                <property name="dm:sopid">
                    <title>SOP Number</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
         <type name="dm:report">
            <title>Report</title>
            <parent>cm:content</parent>
            <properties>
                <property name="dm:reportid">
                    <title>Report Number</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
         <type name="dm:casefile">
            <title>Case File</title>
            <parent>cm:content</parent>
            <properties>
                <property name="dm:caseid">
                    <title>Case Number</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
         <type name="dm:issuelog">
            <title>Issue Log</title>
            <parent>cm:content</parent>
            <properties>
                <property name="dm:issueid">
                    <title>Issue Number</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
         <type name="dm:proposal">
            <title>Proposal</title>
            <parent>cm:content</parent>
            <properties>
                <property name="dm:proposalid">
                    <title>Proposal Number</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
         <type name="dm:meetingnotes">
            <title>Meeting Notes</title>
            <parent>cm:content</parent>
            <properties>
                <property name="dm:meetingid">
                    <title>Meeting Number</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>
    </types>
  
   
    <aspects>
        <aspect name="dm:customer">
            <title>Customer Details</title>
            <properties>
                <property name="dm:customername">
                    <title>Customer Name</title>
                    <type>d:text</type>
                </property>
               <property name="dm:customerid">
                    <title>Customer ID</title>
                    <type>d:text</type>
                </property>
                <property name="dm:customercontact">
                    <title>Customer Contact</title>
                    <type>d:text</type>
                </property> 
            </properties>
        </aspect>

<!–
**********************
–>

<aspect name="dm:customer123">
      <title>Customer Details 123</title>
      <parent>dm:customer</parent>
      <overrides>
            <property name="dm:customername">
               <!– <mandatory>true</mandatory> –>
            </property>

      </overrides>
            
</aspect>


<!–
**********************
–>

     </aspects>

</model>


<!–
d:text - Text field
d:boolean - Checkbox
d:noderef - Space Selector
d:category - Category Selector
d:datetime - Date Time range selectors
d:date - Date range selectors
d:int - Text field
d:long - Text field
d:double - Text field
d:float - Text field
–>



It execute without error but when applied inherited aspect(dm:customer123) to the content ..it displayed all the properties (dm:customername,dm:customerid,dm:customercontract )from the parent aspect where it suppose to display only single property(dm:customername).


has anyone faced such a problem … ??

is there any way to solve this problem ??


Thanks in advance !!
Regards ,

Ashwini

Outcomes