当前位置: 动力学知识库 > 问答 > 编程问答 >

Alfresco: How do I view which associations a item has been made a part of?

问题描述:

I have two custom types: sc:foo and sc:bar.

sc:foo has an association with sc:bar:

<type name="sc:bar">

<title>Bar</title>

<parent>cm:content</parent>

</type>

<type name="sc:foo">

<title>Foo</title>

<parent>cm:content</parent>

<associations>

<association name="sc:someAssociation">

<title>Some Association</title>

<source>

<mandatory>false</mandatory>

<many>false</many>

</source>

<target>

<class>sc:bar</class>

<mandatory>false</mandatory>

<many>true</many>

</target>

</association>

</associations>

</type>

In web-client-config-custom.xml I have the following so that when looking at an sc:foo, I can see which sc:bar's it is assocated with.

<config evaluator="node-type" condition="sc:foo">

<property-sheet>

<show-association name="sc:someAssociation" />

</property-sheet>

</config>

Is there a way for me to look at a sc:bar and see which associations it has been made a part of?

I am using Alfresco Explorer 3.3 Enterprise.

网友答案:

Although NodeService API allows yout to get source nodes from any assoc, the JSF client of Alfresco is not capable of showing them, and since the JSF client is no longer being enhanced this feature will not be added ALFCOM-588.

So, either you implement yourself this feature or also you can follow @vegemite4me advice and keep two associations, in which case you should also implement onDeleteAssociation and onCreateAssociation policies to keep them in sync.

网友答案:

Would two way binding fix your problem ? Not saying that is a nice way.

<type name="sc:bar">
    <title>Bar</title>
    <parent>cm:content</parent>
      <associations>
        <association name="sc:someAssociation">
            <title>Some Association</title>
            <source>
                <mandatory>false</mandatory>
                <many>false</many>
            </source>
            <target>
                <class>sc:foo</class>
                <mandatory>false</mandatory>
                <many>true</many>
            </target>
        </association>
    </associations>
</type>

Or you can create new custom panel in document details and show all bars that are associated to foo file, so this information would not be a part of standard form that you are working with.

分享给朋友:
您可能感兴趣的文章:
随机阅读: