How do I associate one piece of content with anoth

2019-08-03 23:21发布

问题:

I have two folders, one full of images and another full of text files.

How do I add a property to the text file that allows the user to pick an item from the image folder? (I know how to add basic properties like numbers and dates using aspects.)

I already tried these, but Share renders them as read-only boxes.

            <property name="my:propQName">
                <title>QName Property</title>
                <type>d:qname</type>
            </property>

            <property name="my:propNodeRef">
                <title>Node Reference Property </title>
                <type>d:noderef</type>
            </property>

            <property name="my:propPath">
                <title>Path Property </title>
                <type>d:path</type>
            </property>

回答1:

You need to create an association:

      <associations>
        <association name="my:relatedImage">
           <source>
              <mandatory>true</mandatory>
              <many>false</many>
           </source>
           <target>
              <class>my:imageType</class>
              <mandatory>true</mandatory>
              <many>false</many>
           </target>
        </association>
     </associations>

This will render by default as a picker. You can always configure the picker as usual in share-config-custom.xml.


EDIT: official documentation on associations



标签: alfresco