AnsweredAssumed Answered

Advanced search with custom type not working when has more than one field on search parameter

Question asked by fabiogomes.ti on Mar 2, 2016
Latest reply on Mar 3, 2016 by fabiogomes.ti
Hi guys,

I think this is a bug on Alfresco 5.0.d community (Default instalation), i have created a custom type with some custom properties, when i put then at advanced search i have no result.

Analysing the URL passed to the search, i have noted that if i pass only one property to search, it returns results, so the advanced search was using the AND Operator to find the documents on the repo.

Someone thas has face this problem and solve it?

Sorry by my english.

My model and type


<?xml version="1.0" encoding="UTF-8"?> <model name="aut:autenticaModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Modelo de tipologia documental customizada da Autêntica</description>
   <author>Fábio Gomes [Data Gestão]</author>
   <version>1.0</version>
   <imports>
        <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>
   <namespaces>
      <namespace uri="ecm.autentica.com.br" prefix="aut"/>
   </namespaces>
    <types>
      <type name="aut:contrato">
         <title>Contrato</title>
         <parent>cm:content</parent>
         <properties>
            <property name="aut:tituloFinal">
               <title>Título Final</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:autor">
               <title>Autor</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:tradutor">
               <title>Tradutor</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:ilustrador">
               <title>Ilustrador</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:capista">
               <title>Capista</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:editoraInternacional">
               <title>Editora Internacional</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:agenteLiterário">
               <title>Agente Literário</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:dataAssinaturaContrato">
               <title>Data de Assinatura do Contrato</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:prazoDoContrato">
               <title>Prazo do contrato</title>
               <type>d:date</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:status">
               <title>Status</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
               <constraints>
                  <constraint type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>Ativo</value>
                           <value>Encerrado</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
            <property name="aut:dataRenovacaoContrato">
               <title>Data de Renovação Contrato</title>
               <type>d:date</type>
               <mandatory>false</mandatory>
            </property>
            <property name="aut:numeroContrato">
               <title>Numero do Contrato</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
         </properties>
      </type>
     
   </types>
</model>


My share-config

<config replace="true" evaluator="string-compare" condition="AdvancedSearch">
      <advanced-search>
         <!– Forms for advanced search type list –>
         <forms>
         <form labelId="Contrato" id="gdi_searchAutentica" description="Pesquisar nos contratos da Autêntica">cm:content</form>
         <form labelId="search.form.label.cm_content" id="search" descriptionId="search.form.desc.cm_content">cm:content</form>
           <form labelId="search.form.label.cm_folder" id="search" descriptionId="search.form.desc.cm_folder">cm:folder</form>
         </forms>
      </advanced-search>
   </config>  

   <config evaluator="node-type" condition="aut:contrato">
      <forms>
         <!– Default form configuration for the cm:content type –>
         <form>
            <field-visibility>
               <!– Custom properties –>
               <show id="aut:tituloFinal" />
               <show id="aut:autor" />
               <show id="aut:tradutor" />
               <show id="aut:ilustrador" />
               <show id="aut:capista" />
               <show id="aut:editoraInternacional" />
               <show id="aut:dataAssinaturaContrato" />
            <show id="aut:prazoDoContrato" />
            <show id="aut:status" />
            <show id="aut:dataRenovacaoContrato" />
            <show id="aut:numeroContrato" />
         </field-visibility>
         </form>
         <!– Document Library pop-up Edit Metadata form –>
         <form id="doclib-simple-metadata">
            <field-visibility>
               <show id="aut:tituloFinal" />
               <show id="aut:autor" />
               <show id="aut:tradutor" />
               <show id="aut:ilustrador" />
               <show id="aut:capista" />
               <show id="aut:editoraInternacional" />
               <show id="aut:dataAssinaturaContrato" />
            <show id="aut:prazoDoContrato" />
            <show id="aut:status" />
            <show id="aut:dataRenovacaoContrato" />
            <show id="aut:numeroContrato" />
            </field-visibility>
         </form>
      </forms>
   </config>
   <!– cm:content type (creating nodes) –>
   <config evaluator="model-type" condition="aut:contrato">
      <forms>
         <!– Default Create Content form –>
         <form>
            <field-visibility>
               <show id="aut:tituloFinal" />
               <show id="aut:autor" />
               <show id="aut:tradutor" />
               <show id="aut:ilustrador" />
               <show id="aut:capista" />
               <show id="aut:editoraInternacional" />
               <show id="aut:dataAssinaturaContrato" />
            <show id="aut:prazoDoContrato" />
            <show id="aut:status" />
            <show id="aut:dataRenovacaoContrato" />
            <show id="aut:numeroContrato" />
            </field-visibility>         
         </form>
      </forms>
   </config>
   <config evaluator="model-type" condition="cm:content">
      <forms>
         <!– Search form –>
         <form id="gdi_searchAutentica">
            <field-visibility>
               <show id="aut:tituloFinal" force="true" />
           
               <show id="aut:autor" force="true" />
               <show id="aut:tradutor" force="true" />
               <show id="aut:ilustrador" force="true"  />
               <show id="aut:capista" force="true" />
               <show id="aut:editoraInternacional" force="true" />
               <show id="aut:dataAssinaturaContrato" force="true" />
            <show id="aut:prazoDoContrato" force="true" />
            <show id="aut:status" force="true" />
            <show id="aut:dataRenovacaoContrato" force="true" />
            <show id="aut:numeroContrato" force="true" />
           
            </field-visibility>           
         </form>
      </forms>
   </config>

Outcomes