AnsweredAssumed Answered

One-to-many relation between type and aspect?

Question asked by arak on Jul 17, 2015
Hi everyone,

I have the next content model (also I attach an image of the model):



<?xml version="1.0" encoding="UTF-8"?>

<model name="sm:modelContent"
    xmlns="http://www.alfresco.org/model/dictionary/1.0">

    <description>Content Model</description>
    <author>Arak</author>
    <version>1.0</version>

    <imports>
        <import uri="http://www.alfresco.org/model/dictionary/1.0"
            prefix="d" />
        <import uri="http://www.alfresco.org/model/bpm/1.0"
            prefix="bpm" />
    </imports>

    <namespaces>
        <namespace uri="http://www.some.com/model/content/1.0" prefix="sm" />
    </namespaces>

    <!– Types –>

    <types>
        <type name="sm:contentParent">
            <parent>cm:content</parent>
        </type>

        <type name="sm:contentChildren1">
            <parent>sm:contentParent</parent>
        </type>

        <type name="sm:contentChildren2">
            <parent>sm:contentParent</parent>
        </type>

        <type name="sm:contentChildren3">
            <parent>sm:contentParent</parent>
        </type>
    </types>

    <!– Aspects –>

    <aspects>
   
      <!– An Aspect –>

       <aspect name="sm:otherOtherAspect">

          <properties>

          ….

        </properties>
       </aspect>

      <!– Other Aspect –>

      <aspect name="sm:otherAspect">

        <properties>

          ….

        </properties>
      </aspect>


      <!– An Other Aspect –>

        <aspect name="sm:anOtherAspect1">
          <properties>

           ….

          </properties>
        </aspect>

        <aspect name="sm:anOtherAspect2">
          <properties>

           ….

          </properties>
        </aspect>

        <aspect name="sm:anOtherAspect3">
          <properties>

           ….

          </properties>
        </aspect>

        … can exist N …

        <!– Other Other Aspect –>

        <aspect name="sm:anAspect1">
          <properties>

            ….

          </properties>
        </aspect>

        <aspect name="sm:anAspect2">
          <properties>

            ….

          </properties>
        </aspect>

        <aspect name="sm:anAspect3">
          <properties>

            ….

          </properties>
        </aspect>

        … can exist N …

    </aspects>

</model>



Depending of the type of content:

<ul>
<li>sm:contentChildren1 can have a 1 "anOtherAspect" and 0 "anAspect".</li>
<li>sm:contentChildren2 can have a N "anOtherAspect" and 0 "anAspect".</li>
<li>sm:contentChildren3 can have a N "anOtherAspect" and N "anAspect".</li>
</ul>

These relationships exist between types and aspects? (one-to-one or one-to-many) How can use it?, if not exist, I can simulate this relationship in any way?

I would like to work aspects based on a relationship and not creating them one by one (exaggerating the value of N, and creating a lot of aspects).

Greetings,
Pablo.

Attachments

Outcomes