Alfresco shares an advanced search

I have some problems. I am creating a custom model ed:edocuments

with one aspect ed:zagdep

, it has one property ed:documentRegnum

. I customize the advanced search form and add the RegNum field, but it doesn't look for anything in that field. What could it be? Why is the search not working?

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 contex file model 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>

      

+3


source to share


1 answer


You just need to add: force="true"

to the aspect based property. See below code.



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

      

+3


source







All Articles