Form

Category selector

To run a search, you need to define the type of object you are looking for (documents, folders, etc.): a component category.

A category selector is available for this purpose. To hide it, the FakeCategorySelectorPresenter class is used to define the category without the user having to select it.

Example: Defining the category for a virtual folder search

<property name="categorySelectorPresenter">
        <bean class="com.flower.docs.gui.client.search.criteria.item.FakeCategorySelectorPresenter">
            <property name="value">
                <value type="com.flower.docs.domain.component.Category">VIRTUAL_FOLDER</value>
            </property>
        </bean>
</property>

Keyword search

The keyword search is configured by adding the following property:

<property name="keywordCriteriaPresenter">
	<bean class="com.flower.docs.gui.client.search.criteria.KeywordCriteriaPresenter" />
</property>

To disable the keyword search, add the following property to the KeywordCriteriaPresenter class bean:

<property name="enabled" value="false" />

By default, the keyword search will search all component tags. You can change this behaviour and specify which tags should be searched by keyword:

<property name="fields">
    <list>
    	<value>Matricule</value>
    	<value>Contractor</value>
    </list>
</property>

Advanced search

The keyword search is configured by adding the following property:

<property name="advancedCriteriaPresenter">
    <bean class="com.flower.docs.gui.client.search.criteria.advanced.AdvancedCriteriaPresenter" />
</property>

To disable the keyword search, add the following property:

<property name="enabled" value="false" />

By default, the advanced search allows you to filter on one or more component classes. To avoid displaying the class selector, add the following property:

<property name="displayClassSelector" value="false" />

To open the advanced search and hide the button for collapsing it, add the following property:

<property name="forceOpen" value="true" />

The default action label is Search, which can be overridden by adding the property:

<property name="searchButtonTitle">
	<list>
		<bean class="com.flower.docs.domain.i18n.I18NLabel">
			<property name="language" value="EN"/>
			<property name="value" value="Verify"/>
		</bean>
		<bean class="com.flower.docs.domain.i18n.I18NLabel">
			<property name="language" value="FR"/>
			<property name="value" value="Vérifier"/>
		</bean>
	</list>
</property>


When using a search criterion on a CONDITIONAL tag, if the tag on which it depends is not filled in, all the values of the CONDITIONAL tag are displayed.

Free criteria

By default, all tag classes defined as searchable can be added as search criteria. To restrict the scope of your searches, you can:

  • Prevent users from adding a free criterion using the + button: add the following property to the AdvancedCriteriaPresenter bean:

    <property name="addEmptyCriterion" value="false" />
  • Hide a tag from the list of available criteria: add its identifier value to the unsearchableCriteria property

    <property name="unsearchableCriteria">
    	<list>
    		<value>ServiceName</value>
    		<value>Assignee</value>
    	</list>
    </property>
  • Force tags that can be used as criteria in a search form: add the value of its identifier to the searchableCriteria property. When this property is set, the unsearchableCriteria property is not used.

    <property name="searchableCriteria">
    	<list>
    		<value>Nature</value>
    	</list>
    </property>

Fixed criteria

The advanced search can be configured to display, by default, fixed criteria that the user only has to fill in before running the search. For string criteria, it is possible to define a description, using the description property, which will be presented to the user.

To define a fixed criterion:

<bean id="FirstnameCriterionPresenter" class="com.flower.docs.gui.client.search.criterion.SimpleCriterionPresenter">
    <property name="model">
        <bean class="com.flower.docs.domain.search.Criterion">
            <property name="name" value="Firstname" />
            <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">CONTAINS</value>
            </property>
        </bean>
    </property>
	<property name="description">
		<list>
			<bean class="com.flower.docs.domain.i18n.I18NLabel">
				<property name="language" value="EN"/>
				<property name="value" value="Collaborator firstname"/>
			</bean>
			<bean class="com.flower.docs.domain.i18n.I18NLabel">
				<property name="language" value="FR"/>
				<property name="value" value="Prénom du collaborateur"/>
			</bean>
		</list>
	</property></bean>

To assign these criteria to an advanced search:

<property name="fixedCriterionPresenters">
	<list>
		<ref bean="FirstnameCriterionPresenter" />
	</list>
</property>

A field display can be customised with a com.flower.docs.gui.client.search.criterion.FilterCriterionPresenter class bean using various properties:

  • displayOperatorSelector: hides the operator selector
  • forceMonovalued: forces the user to choose only one value for a normally multivalued criterion
  • mandatory: makes the field mandatory for searching

Example:

<bean id="ValidationStatusCriterionPresenter" class="com.flower.docs.gui.client.search.criterion.FilterCriterionPresenter">
	<property name="description">
		<list>
			<bean class="com.flower.docs.domain.i18n.I18NLabel">
				<property name="language" value="EN"/>
				<property name="value" value="Enter a value"/>
			</bean>
			<bean class="com.flower.docs.domain.i18n.I18NLabel">
				<property name="language" value="FR"/>
				<property name="value" value="Saisissez une valeur"/>
			</bean>
		</list>
	</property>
	<property name="displayOperatorSelector" value="false" />
	<property name="forceMonovalued" value="true" />
	<property name="mandatory" value="true" />
	<property name="model">
		<bean class="com.flower.docs.domain.search.Criterion">
			<property name="name" value="ValidationStatus" />
			<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">STARTS_WITH</value>
			</property>
		</bean>
	</property>
</bean>

To assign these criteria to an advanced search:

<property name="fixedCriterionPresenters">
	<list>
		<ref bean="ValidationStatusCriterionPresenter" />
	</list>
</property>

Multiple criteria:

By default, all these criteria are defined as unique, i.e. each tag in the list of criteria can only be used once. However, it is possible to define that a tag can correspond to several criteria, thanks to the nonUniqueCriteria property:

<property name="nonUniqueCriteria">
	<list>
		<value>name</value>
		<value>TIAmount</value>
		<value>creationDate</value>
	</list>
</property>

This feature can be disabled by adding the activateUniqueCriteria property

<property name="activateUniqueCriteria" value="false" />

Class selector

The selection of the component class during a search can be customized using a com.flower.docs.gui.client.search.criteria.clazz.ComponentClassCriterionSelectorPresenter class bean.

This class criterion can be customized in the same way as the filter criteria listed above:

  • displayOperatorSelector: hides the operator selector
  • forceMonovalued: forces the user to choose only one value for a normally multivalued criterion
  • mandatory: makes the field mandatory for searching

Example:

<bean id="classIdCriterionPresenter" class="com.flower.docs.gui.client.search.criteria.clazz.ComponentClassCriterionSelectorPresenter">
	<property name="displayOperatorSelector" value="false" />
	<property name="forceMonovalued" value="true" />
	<property name="mandatory" value="true" />
	<property name="model">
		<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>
		</bean>
	</property>
</bean>

The com.flower.docs.gui.client.search.criteria.clazz.CreatableTaskClassCriterionSelectorPresenter class selector will only display jobs that do not have mandatory or technical attachments, and where the user has creation rights.

To assign this class criterion to an advanced search, set the classCriterionPresenter property and display the class criterion:

<property name="advancedCriteriaPresenter">
		<bean class="com.flower.docs.gui.client.search.criteria.advanced.AdvancedCriteriaPresenter">
			<property name="enabled" value="true" />
			<property name="displayClassSelector" value="true" />
			<property name="showSearchButton" value="true" />
			<property name="classCriterionPresenter" ref="classIdCriterionPresenter" />
		</bean>
</property>

Filters

When an aggregation is defined for the hidden request of the search form, results are displayed in a tree structure. When a bucket is selected, the search is run using the criteria corresponding to the bucket.

Technical data

Technical information positioned by FlowerDocs can also be used as a search criterion or filter:

  • name: component title
  • id: component identifier
  • classid: component class identifier
  • owner: login of the user who created the component
  • creationDate: component creation date
  • lastUpdateDate: date the component was last modified
  • workflow: workflow identifier, applies only to TASK components
  • assigned: login of the user to whom the task is assigned, applies only to TASK components
  • content: file content, only concerns DOCUMENT components


To be able to search this data, you need to define a .com.flower.docs.gui.client.search.SearchableFieldCatalog type dataCriteriaCatalog bean.

Validation

To decide whether or not the search button should be disabled, the enableIfInvalid property can be set. This property accepts the following values:

  • true: the search form may be invalid
  • false: the form must be valid to activate the action


Example

<bean id="RechercheAgent" class="com.flower.docs.gui.client.search.ComponentSearchPresenter" scope="prototype">
	<property name="title">
		<list>
			<bean class="com.flower.docs.domain.i18n.I18NLabel">
				<property name="language" value="EN"/>
				<property name="value" value="Agent folder search"/>
			</bean>
			<bean class="com.flower.docs.domain.i18n.I18NLabel">
				<property name="language" value="FR"/>
				<property name="value" value="Rechercher des dossiers agents"/>
			</bean>
		</list>
	</property>  
	<property name="enableIfInvalid" value="true" />
</bean>