Alfresco share advanced search

1.4k views Asked by At

I have some problem. I am create custom model ed:edocumentswith one aspect ed:zagdep it has one property ed:documentRegnum. I am customize Advanced Search Form and add RegNum field, but it does not search nothing with this field. What it can be? Why search does not work?

My model code ed-model.xml (tomcat\shared\classes\alfresco\extension)

<?xml version="1.0" encoding="UTF-8"?>
<model name="ed:edocuments" xmlns="http://www.alfresco.org/model/dictionary/1.0">
      <!-- Imports are required to allow references to definitions in other models -->
   <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>
   <!-- Introduction of new namespaces defined by this model -->
   <namespaces>
      <namespace uri="http://www.alfresco.com/model/edocuments/1.0" prefix="ed"/>
   </namespaces>
    <aspects>
      <!-- Definition of new Content Aspect: Electronic Document -->
      <aspect name="ed:zagdep">
         <title>Zag Dep</title>
         <properties>
            <property name="ed:documentRegnum">
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
   </aspects>
</model>

My model contex file ed-model-contex.xml (tomcat\shared\classes\alfresco\extension)

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
    <!-- Registration of new models -->
    <bean id="extension.ed.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/ed-model.xml</value>
            </list>
        </property>
    </bean>
</beans>

My share-config-custom.xml(tomcat\shared\classes\alfresco\web-extension)

<alfresco-config>
   <!-- Document Library config section -->
   <config evaluator="string-compare" condition="DocumentLibrary">
      <aspects>
         <!-- Aspects that a user can see -->
         <visible>
            <aspect name="cm:generalclassifiable" />
            <aspect name="cm:complianceable" />
            <aspect name="cm:dublincore" />
            <aspect name="cm:effectivity" />
            <aspect name="cm:summarizable" />
            <aspect name="cm:versionable" />
            <aspect name="cm:templatable" />
            <aspect name="cm:emailed" />
            <aspect name="emailserver:aliasable" />
            <aspect name="cm:taggable" />
            <aspect name="app:inlineeditable" />
            <aspect name="kb:referencable" />
            <aspect name="ed:zagdep" />
         </visible>
         <!-- Aspects that a user can add. Same as "visible" if left empty -->
         <addable>
         </addable>
         <!-- Aspects that a user can remove. Same as "visible" if left empty -->
         <removeable>
         </removeable>
      </aspects>
   </config>

   <!-- cm:content type (existing nodes) -->
   <config  evaluator="node-type" condition="cm:content">
      <forms>
         <!-- Default form configuration used on the document details and edit metadata pages -->
         <form>         
            <field-visibility>              
               <show id="ed:documentRegnum" />               
            </field-visibility>
         </form>
         <!-- Document Library pop-up Edit Metadata form -->
         <form id="doclib-simple-metadata">
            <field-visibility>               
               <show id="ed:documentRegnum" />                
            </field-visibility>
            <edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
         </form>
         <!-- Document Library Inline Edit form -->
         <form id="doclib-inline-edit">
            <field-visibility>    
               <show id="ed:documentRegnum" />               
            </field-visibility>
         </form>
      </forms>
   </config>
    <!-- Advanced search -->
    <config replace="true" evaluator="string-compare" condition="AdvancedSearch">
        <advanced-search>
            <!-- Forms for the advanced search type list -->
            <forms>
                <form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content</form>
                <form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form> 
            </forms>
        </advanced-search>
    </config>   
    <config evaluator="model-type" condition="cm:content">
    <forms>
        <!-- Search form -->
        <form id="search">
            <field-visibility>
                <show id="cm:name" />
                <show id="cm:title" force="true" />
                <show id="cm:description" force="true" />               
                <!-- ed:edocuments -->  
                <show id="ed:documentRegnum" />                
            </field-visibility>
            <appearance>
                <!-- ed:edocuments -->
                <field id="ed:documentRegnum" label-id="prop.ed_documentRegnum">
                    <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                </field>                
            </appearance>
        </form>
    </forms>
</config>
</alfresco-config>
1

There are 1 answers

0
Krutik Jayswal On BEST ANSWER

You just have to add : force="true" on aspect based property.See below code.

<show id="ed:documentRegnum" force="true" />