Hidden request

In the previous section, you saw how to define the form and search criteria. You will now see how to configure the results display.


To do this, you are going to use a hidden request because the user cannot interact with it.


This XML block should be placed in the ComponentSearchPresenter bean, at the same level as the advancedCriteriaPresenter property.

This hidden search is defined using the hiddenRequest property:


<property name="hiddenRequest">
	<bean class="com.flower.docs.domain.search.SearchRequest">
		<!-- Ajoutez ici les différentes parties décrites dans la suite -->
	</bean>
</property>

Columns to be displayed

Place the SelectClause property in the SearchRequest bean. Set this property as below to display the table columns:


XML code: Definition of columns to be displayed

<property name="selectClause">
	<bean class="com.flower.docs.domain.search.SelectClause">
		<property name="fields">
			<list>		
				<!-- Colonnes à afficher -->
				<value>name</value>
				<value>NomClient</value>
				<value>RefClient</value>
			</list>
		</property>
	</bean>
</property>


Filter

Place the filterClauses property after the selectClause property. Set the filterClauses property as below to search client folders:

  • The STRING type is used to specify that the search criterion will be a character string,
  • The EQUALS_TO operator will be responsible for client folder feedback,
  • the customer files to be searched will be of the ClientFile type,


XML code: Filter definition

<property name="filterClauses">
	<list>
		<bean class="com.flower.docs.domain.search.AndClause">
			<property name="criteria">
				<list>
					<bean class="com.flower.docs.domain.search.Criterion">
						<property name="name" value="classid" />
						<property name="type">
							<value type="com.flower.docs.domain.search.Types">STRING</value>
						</property>
						<property name="operator">
							<value type="com.flower.docs.domain.search.Operators">EQUALS_TO</value>
						</property>
						<property name="values">
							<list>
								<value>DossierClient</value>								
							</list>
						</property>
					</bean>
				</list>
			</property>
		</bean>
	</list>
</property>

Sorting

FlowerDocs allows results to be sorted according to techniques and tags.


In this case, you will sort the result according to the creationDate property, which is the date on which the customer files were created.


Use the orderClauses property to define the sorting of customer files from most recent to oldest:


XML code: Definition of customer file sorting

<property name="orderClauses">
	<list>
		<bean class="com.flower.docs.domain.search.OrderClause">
			<property name="name" value="creationDate" />
			<property name="ascending" value="false" />
		</bean>
	</list>
</property>


The number of results returned by the search. This property allows you to set a default number of results to be displayed per result page:


<property name="max" value="25" />