11-05-2020 07:01 PM
There are 3 types. They all have 5 properties in common, then each of them have their own set of properties.
I have created a base type, with an aspect of the 5 common properties.
Then 3 different aspects to cover specific properties of the 3 types.
In the share-config-custom.xml, I do not know any means to accomplish different forms for each of these types.
<config evaluator="string-compare" condition="AdvancedSearch"> ... ... <form labelId="search.form.label.my_custom_Type1" descriptionId="search.form.desc.my_custom_Type1">my_custom:Type1</form> <form labelId="search.form.label.my_custom_Type1" descriptionId="search.form.desc.my_custom_Type1">my_custom:Type2</form> ... </config>
In this I have given a form entry for each of the types.
Should I create separate search form for each of this type, to accomplish this?
I never have done this. I would like to confirm.
<config evaluator="model-type" condition="my_custom:Type1"> <forms> <form> ... </form> <form id="search"> ... </form> </forms> </config> <config evaluator="model-type" condition="my_custom:Type2"> <forms> <form> ... </form> <form id="search"> ... </form> </forms> </config>
11-05-2020 07:24 PM
<config evaluator="string-compare" condition="AdvancedSearch"> ... ... <form labelId="search.form.label.my_custom_Type1" descriptionId="search.form.desc.my_custom_Type1">my_custom:Type1</form> <form labelId="search.form.label.my_custom_Type1" descriptionId="search.form.desc.my_custom_Type1">my_custom:Type2</form> ... </config><config evaluator="model-type" condition="my_custom:Type1"> <forms> <form> ... </form> <form id="search"> ... </form> </forms> </config> <config evaluator="model-type" condition="my_custom:Type2"> <forms> <form> ... </form> <form id="search"> ... </form> </forms> </config>
That is correct, you have to include the properties defined in the aspect in each of the form (with id ='search').
<config evaluator="model-type" condition="my_custom:Type1"> <forms> <form id="search"> <field-visibility> <!-- properties from this type --> ...... .... <!-- common properties from the aspect --> <show id="my_custom:prop1" force="true"/> <show id="my_custom:prop2" force="true"/> <show id="my_custom:prop3" force="true"/> <show id="my_custom:prop4" force="true"/> </field-visibility> ....... ...... </form> </forms> </config> <config evaluator="model-type" condition="my_custom:Type2"> <forms> <form id="search"> <field-visibility> <!-- properties from this type --> ...... .... <!-- common properties from the aspect --> <show id="my_custom:prop1" force="true"/> <show id="my_custom:prop2" force="true"/> <show id="my_custom:prop3" force="true"/> <show id="my_custom:prop4" force="true"/> </field-visibility> ....... ...... </form> </forms> </config>
You can find some examples of configuring forms here:
Go through this documentation as well: https://docs.alfresco.com/5.2/references/forms-reference.html
Explore our Alfresco products with the links below. Use labels to filter content by product module.