cancel
Showing results for 
Search instead for 
Did you mean: 

How to create inner object in alfresco custom modelling? Like Car has Engine

mageshvg
Champ on-the-rise
Champ on-the-rise

<types>        
        <type name="VG:EngineType">
            <title>Engine</title>
            <description>Car Engine Model</description>
            <parent>cm:content</parent>
            <properties>
                <property name="VG:ModelNo">
                    <title>Model Number</title>
                    <description>Model No of Engine</description>
                    <type>d:text</type>
                    <mandatory>true</mandatory>                  
                </property>

             <property name="VG:ModelName">
                    <title>Model Name</title>
                    <description>Model Name of Engine</description>
                    <type>d:text</type>
                    <mandatory>true</mandatory>                  
                </property>                            
            </properties>          
        </type>

      <type name="VG:Car">
            <title>Car</title>
            <description>Car Model</description>
            <parent>cm:content</parent>
            <properties>
                <property name="VG:Engine">
                    <title>Engine</title>
                    <description>Type of Engine Car Having</description>
                    <type>VG:EngineType</type> // I know Here Data type Need to specify. But How to Achieve the same?
                    <mandatory>true</mandatory>                  
                </property>                        
            </properties>        
        </type>       
    </types>

In My case I need to have a type which has list of another type

EX:

Manager has List of subordinates...

Thanks For your Valuable Comments....

5 REPLIES 5

hardik1512
Star Contributor
Star Contributor

I guess what you are looking for is an Association.

Here is a helpful link. You can find more details on alfresco docs.

Adding an association | Alfresco Documentation 

Thanks for you reply Hardik...

If we use Association then how can we retrieve all the associated documents in a CMIS Query?

afaust
Legendary Innovator
Legendary Innovator

Within a CMIS query you cannot retrieve associated documents. You would have to issue a second CMIS operation to fetch the relationships of a particular search result to get its related documents.

mageshvg
Champ on-the-rise
Champ on-the-rise

Thanks Axel...

If that is the case.. Take for example a Product will have Many Images.

If Product is a type which is associated ProductImage Type with many true.

if i retrieve product in first operation using CMIS Query.. i won't get any relationship(Association here) details in that.

Then on which condition i will make second operation to get those associated documents...

Thanks in Advance for your valuable answer... Smiley Happy

afaust
Legendary Innovator
Legendary Innovator

The operation to retrieve the associations for a specific CMIS object is quite simple. You may be confusing it with doing another search/query, but it is a separate operation (getObjectRelationships). The "condition" (parameter) would the ID of the object from which you want to get the relationships.

.