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

cancel
Showing results for 
Search instead for 
Did you mean: 
mageshvg
Active Member

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

<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
hardik1512
Established Member II

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

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 

mageshvg
Active Member

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

Thanks for you reply Hardik...

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

afaust
Master

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

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
Active Member

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

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
Master

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

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.

.