Problem with Advanced Search customization

cancel
Showing results for 
Search instead for 
Did you mean: 
mbikl
Member II

Problem with Advanced Search customization

Hello,

I would like to customize Advanced Search to adding "My Search" option. I changed share-config-custom.xml (see below). But my customization doesn't work. I added a new item to search menu, but i get error "Form definition could not be found". 

I use the definition from cm:folder, but it doesn't work. I use community edition 7.3 in Docker desktop.

Pls, do you see where is a problem?

Thanks, Martin

 

  <config evaluator="model-type" condition="customContentModel">
      <forms>
         <form>
            <field-visibility>
               <show id="cm:name" />
               <show id="cm:title" force="true" />
               <show id="cm:description" force="true" />
            </field-visibility>
            <appearance>
               <field id="cm:name">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" >
                     <control-param name="maxLength">255</control-param>
                  </control>
               </field>
               <field id="cm:title">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
            </appearance>
         </form>
         <!-- Search form -->
         <form id="search">
            <field-visibility>
               <show id="cm:name" />
               <show id="cm:title" force="true" />
               <show id="cm:description" force="true" />
            </field-visibility>
         </form>
      </forms>
  </config>

  <config evaluator="string-compare" condition="AdvancedSearch" replace="true">
  	<advanced-search>
  		<forms>
  			<!-- Standard out-of-the-box types -->
  			<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>
  			
            <!-- Custom type -->
            <form labelId="custom" label="My Search" descriptionId="customContent" description="My search description">customContentModel</form>          
  		</forms>
  	</advanced-search>
  </config>
3 Replies
angelborroy
Alfresco Employee

Re: Problem with Advanced Search customization

This may sound silly, but why your 

customContentModel

doesn't have a prefix?

Hyland Developer Evangelist
mbikl
Member II

Re: Problem with Advanced Search customization

Hi,

I try to create new advanced search more than 10 day. I had a namespece prefix. If I use namespace prefix "myprefix:customContentModel" I get error "Namespace prefix myprefix is not mapped to a namespace URI". 

Wow.... What does is mean? Where is defined namespace URI?

Thank you for your advice.

Martin

sim2487
Active Member II

Re: Problem with Advanced Search customization

Hi mbikl,

The namespace prefix "myprefix:customContentModel" which you trying to add in your advsearch page custom form should be registered in your custom contentmodel also, then it'll not throwing this error.

Step1: create you custom content model with having myprefix  + customContentModel to registered.

<namespaces>
<namespace uri="http://cms.testproject.com/model/content/1.0" prefix="myprefix"/>
</namespaces>

Step2: Restart your ACS to deploy that custom content model.

Step3: Use this custom namespace prefix in your advsearch form. It should work. Smiley Happy

 

Thanks,

Simant