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>
<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
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.