Can we have separate search form for different custom types?

cancel
Showing results for 
Search instead for 
Did you mean: 
sepgs2004
Established Member

Can we have separate search form for different custom types?

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>

 

Gnanasekaran Sakthivel
1 Reply
abhinavmishra14
Advanced

Re: Can we have separate search form for different custom 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>
<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: 

https://github.com/Alfresco/share/blob/develop/share/src/main/resources/alfresco/share-form-config.x...

Go through this documentation as well: https://docs.alfresco.com/5.2/references/forms-reference.html

 

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)