cancel
Showing results for 
Search instead for 
Did you mean: 

Comeplex Object definition in Alfresco Share

subbu_bv
Champ in-the-making
Champ in-the-making

Hi ,

    I am new to alfresco. I wanted to create a complex object like

  

Case

   - Case number

   - Patient (1..1)

              - Patient ID

              - Patient Age

   - Drug (1..n)

              - Drug Name

              - Drug dosage

Can anyone help me how to achieve this?

Regards,

Subbu

6 REPLIES 6

afaust
Legendary Innovator
Legendary Innovator

Alfresco does not have a concept for "complex objects". You would create this by simply modelling each consituent part / type, and then create (child) associations between them with the multiplicity you documented. A few years ago, the concept of "compound types" was on the roadmap, but it did not make the cut when Alfresco was prioritising its development effort.

krutik_jayswal
Elite Collaborator
Elite Collaborator

First thing which you should do is study the content model part of alfresco.

There are few things which you need to understand briefly which are as below.

  1. Type
  2. Aspects
  3. Property
  4. Association

Some good links are as below.

Content modeling | Alfresco Documentation 

Content Model Tutorials | Alfresco Documentation 

For your structure you need to create it as below.

  • Create Case,Patient and Drug as a type of document
  • Patient Type will have patient id and patient age as property.
  • Drug Type will have drug name as a property and a suggestion would be drug dosage should be part of Case type.
  • Case type will have an association with patient type and drug type.

Hi Axel Faust and Krutik Jayswal,

Thank you very much for the quick update. Will go through the documentation.

 

Regards,

Subbu

Hi Krutik Jayswal‌,

I have created a case type having association with patient type and drug type. I have created a Model from the model manager of the type case. When When I goto the CaseModel Layout Designer, I am not able to see the attributes from the associations. (I case see only case number not the patient name or the drug name)

How Should we do that ?

Regards,

Subbu

subbu_bv
Champ in-the-making
Champ in-the-making

here is the strucutre of the case 

<type name="chs:casev1">
      <title>Case Document</title>
      <parent>cm:content</parent>
      <properties>
            <property name="chs:caseNumber">
                  <title>Case Number</title>
                  <type>d:text</type>
         </property>
   </properties>
   <associations>
            <association name="chsSmiley TongueatientAssociation">
            <title>Patient Association</title>
            <source>
                     <mandatory>true</mandatory>
                      <many>false</many>
             </source>
            <target>
                        <class>chsSmiley Tongueatientv1</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
               </target>
         </association>
         <association name="chs:drugAssociation">
                  <title>Drugs Association</title>
                  <source>
                        <mandatory>true</mandatory>
                        <many>false</many>
                  </source>
                  <target>
                              <class>chs:drugv1</class>
                              <mandatory>true</mandatory>
                              <many>true</many>
                  </target>
            </association>
   </associations>
</type>

<type name="chsSmiley Tongueatientv1">
      <title>Patient Information</title>
      <parent>cm:content</parent>
        <properties>
                  <property name="chsSmiley TongueatientId">
                  <type>d:text</type>
                  <multiple>false</multiple>
         </property>

</type>

<type name="chs:drugv1">
            <title>Drug Information</title>
            <parent>cm:content</parent>
            <properties>
                     <property name="chs:drugName">
                     <type>d:text</type>
                     <multiple>false</multiple>
            </property>

</type>

subbu_bv
Champ in-the-making
Champ in-the-making

Hi All, 

        Any help/suggestion here please?

Regards,

Subbu