AnsweredAssumed Answered

Advanced search with custom optional aspects

Question asked by antonio_sanchez_garaboa on Nov 3, 2017

I have a custom aspect with a property like:

<aspect name="cofc:process">
   <title>Process</title>
   <properties>
      <property name="cofc:process">
         <title>Process</title>
         <description>Name of the process</description>
         <type>d:text</type>
         <mandatory>true</mandatory>
         <index enabled="true">
            <tokenised>TRUE</tokenised>
            <facetable>false</facetable>
         </index>
         <constraints>
            <constraint name="cofc:LIST_3f87a64c-c3f8-4939-888f-9f64b985392e" type="LIST">
               <parameter name="allowedValues">
                  <list>
                     <value>Join the association</value>
                     <value>Edit profile</value>
                     <value>Leave the association</value>
                  </list>
               </parameter>
               <parameter name="caseSensitive">
                  <value>true</value>
               </parameter>
               <parameter name="sorted">
                  <value>false</value>
               </parameter>
            </constraint>
         </constraints>
      </property>
   </properties>
   <associations/>
   <overrides/>
   <mandatory-aspects/>
</aspect>

When a user uploads a document to Alfresco, if this document belongs to a specific process, the user asigns the aspect and chose the process.

I have changed the share-config-custom.xml in order to include de custom property as a filter like:

<field-visibility>
   <show id="cofc:process" force="true" />
</field-visibility>
<appearance>
   <field id="cofc:process">
      <control template="/org/alfresco/components/form/controls/selectone.ftl" />
   </field>
</appearance>

 

With this configuration, in the advanced search form it is mandatory to select an element in the "process" field.
What should I do to make this field optional?

 

I mean, I need a advanced search form where the user can search all document relationed with a process but also can search all the documents that are not related to any process.

Outcomes