cancel
Showing results for 
Search instead for 
Did you mean: 

advanced search bugs or error in config on alfresco 5.1

nturri1306
Champ in-the-making
Champ in-the-making
Hello i've the following problem with custom advanced search this is my configuration

on  Alfresco Community (Build: 201604) 5.1.f


model


<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="abc:finance">
    <author>nicola</author>
    <imports>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
    </imports>
    <namespaces>
        <namespace uri="http://www.mycompany.com/model/finance/1.0." prefix="abc"/>
    </namespaces>
    <data-types/>
    <constraints/>
    <types/>
    <aspects>
        <aspect name="abc:form1">
            <title>finance.form1</title>
            <properties>
                <property name="abc:campo2">
                    <title>campo2</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <tokenised>TRUE</tokenised>
                        <facetable>false</facetable>
                    </index>
                </property>
                <property name="abc:campo1">
                    <title>campo1</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <tokenised>TRUE</tokenised>
                        <facetable>false</facetable>
                    </index>
                </property>
            </properties>
            <associations/>
            <overrides/>
            <mandatory-aspects/>
        </aspect>
    </aspects>
</model>
<code>


share-config.xml

<code>
<config evaluator="string-compare" condition="AdvancedSearch">
      <advanced-search>
         <!– Forms for the advanced search type list –>
         <forms>
            <!–
               The 'form' config element contains the name of the model type
               of the form to display.

               The element supports the following optional attributes:
                  id = form id, the id of "search" will be assumed if not set
                  label = label text to display - defaults to model type if not set
                  labelId = I18N message id of label text to display
                  description = description text to display
                  descriptionId = I18N message id of description text to display
            –>
            <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>
            <form label="form1" id="search" description="ricerca form1 ">mioform</form>

         </forms>
      </advanced-search>
   </config>


share-config-custom.xml


  <config evaluator="model-type" condition="mioform">
         <forms>
            <!– Search form –>
            <form id="search">
               <field-visibility>
                  <show id="abc:campo1" force="true" />
                  <show id="abc:campo2" force="true" />

               </field-visibility>           
            </form>
         </forms>
   </config>



have the error when selected mioform on adavanced search

ERROR [scripts.forms.FormUIGet] [http-apr-7080-exec-7] org.alfresco.repo.forms.FormNotFoundException: 04160005 A form could not be found for item: [type]mioform

why ?

i see the tutorial https://wiki.alfresco.com/wiki/Share_Advanced_Search#Configuration


but I do not understand the error



tnx for help please.








9 REPLIES 9

steven_okennedy
Star Contributor
Star Contributor
Hi nturri1306,

The error you're getting is because the configuration you have in share-config-custom.xml is trying to look for a type named mioform to render a search form for.  The problem is that in your model, first of all you have not defined a type you've defined an aspect and secondly that aspect is not defined as mioform, it's defined as "abc:form1".

As far as as I can see, what you should have in your config element would be

<config evaluator="aspect" condition="abc:form1">
  <forms>
    <!– Search form –>
    <form id="search">
      <field-visibility>
        <show id="abc:campo1" force="true" />
         <show id="abc:campo2" force="true" />
      </field-visibility>           
    </form>
  </forms>
</config>


Note the "aspect" evaluator type instead of "model-type" which is used if you're defining forms for actual types as well as the updated condition.

Regards

Steven

I noticed that the problem is the parent of aspect only work with (cm:content type parent)




    
this config work



<config evaluator="model-type" condition="abc:form2">
         <forms>
            <!– Search form –>
            <form id="search">
               <field-visibility>
                  <show id="abc:campo3" force="true" />
                  <show id="abc:campo1" force="true" />
                       <show id="abc:campo2" force="true" />
               </field-visibility>           
            </form>
         </forms>
      </config>

…………….
  <form label="form1" id="search" description="ricerca form1 ">abc:form2</form>
…………………….



this not work




<config evaluator="model-type" condition="abc:form1">
         <forms>
            <!– Search form –>
            <form id="search">
               <field-visibility>
               
                  <show id="abc:campo1" force="true" />
                       <show id="abc:campo2" force="true" />
               </field-visibility>           
            </form>
         </forms>
      </config>

…………….
  <form label="form1" id="search" description="ricerca form1 ">abc:form1</form>
…………………….


the diffence is parent.



Hi nturri1306,

I think you have a misunderstanding here in what you're interpreting. From the screenshot, you have set up 1 type abc:form2 and 1 aspect abc:form1.  abc:form2 inherits from cm:content as would be normal for a basic custom content type.  abc:form1 doesn't inherit from any other aspect, which again is reasonably normal unless you want access to some other properties/associations that are already defined in an existing aspect.  And that's all fine, but it's nothing to do with why your forms don't show

The problem with the form configuration is the use of the evaluator "model-type" in both instances.  This evaluator will look <em>only</em> for types, which is why it works for abc:form2.  It will never find the aspect abc:form1 because abc:form1 is not a type.  If you want to have a form specifically targeted at an aspect, you need to use the evaluator "aspect", e.g.

<config evaluator="aspect" condition="abc:form1">



The code as you have it

<config evaluator="model-type" condition="abc:form1">
         <forms>
            <!– Search form –>
            <form id="search">
               <field-visibility>

                  <show id="abc:campo1" force="true" />
                       <show id="abc:campo2" force="true" />
               </field-visibility>           
            </form>
         </forms>
      </config>

…………….
  <form label="form1" id="search" description="ricerca form1 ">abc:form1</form>
…………………….


will never work, as you point out but the issue is not to do with the parent, rather its the fact that you're treating two different classes of object (types and aspects) the same way when they need to be handled differently - i.e use the model-type evaluator when you want a form for a TYPE and use the aspect evaluator when you want a form for an ASPECT.

Regards

Steven


i need <config evaluator="aspect"


I will let you know

tnx

ERROR [scripts.forms.FormUIGet] [http-apr-7080-exec-5]
org.alfresco.repo.forms.FormNotFoundException: 04190001 A form could not be found for item: [type]abc:form1

always errore i change connfig to

share-config.xml


  
   <config evaluator="string-compare" condition="AdvancedSearch">
      <advanced-search>
         <!– Forms for the advanced search type list –>
         <forms>
            <!–
               The 'form' config element contains the name of the model type
               of the form to display.
              
               The element supports the following optional attributes:
                  id = form id, the id of "search" will be assumed if not set
                  label = label text to display - defaults to model type if not set
                  labelId = I18N message id of label text to display
                  description = description text to display
                  descriptionId = I18N message id of description text to display
            –>
            <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>
            <form label="form2" id="search2" description="ricerca form2">abc:form2</form>
            <form label="form1" id="search1" description="ricerca form1">abc:form1</form>
           
         
         </forms>
      </advanced-search>
   </config>



share-config-custom.xml


   <config evaluator="model-type" condition="abc:form2">
         <forms>
            <!– Search form –>
            <form id="search2">
               <field-visibility>

                  <show id="abc:campo3" force="true" />
            
               </field-visibility>           
            </form>
         </forms>
      </config>
     
     
          <config evaluator="aspect" condition="abc:form1">
               <forms>
                  <!– Search form –>
                  <form id="search1">
                     <field-visibility>
                     
                        <show id="abc:campo1" force="true" />
                             <show id="abc:campo2" force="true" />

                     </field-visibility>           
                  </form>
               </forms>
      </config>



i think is alfresco bugs dont support aspect on search?

Hi

I had a closer look at the code behind this, and it looks as though the search screen is hardcoded only to allow the display of forms related to types, not aspects, which is unfortunate but looks like it's by design rather than a bug.  Apologies for that, I had thought I had seen this done previously.  You can change to work on aspects if you like (http://www.zaizi.com/blog/alfresco-share-advanced-search-form-aspects-search) but it won't do it out of the box.

Regards

Steven

Good Morning steven.okennedy _

I tried a lot to configure my advanced search using the link that you provide. But I always get the same error. Alfresco can't render a non type form. Could you get sucess using this solution? You make any example that work? Maybe I have some error.

I really really appreciate you help in this case.

Best Regards,

Vladimir.

vurquia
Champ in-the-making
Champ in-the-making

The error on UI is: Form definition could not be found

and logs: ERROR [scripts.forms.FormUIGet] [http-apr-8080-exec-4] org.alfresco.repo.forms.FormNotFoundException: 09250001 A form could not be found for item: [type]hip:docMetaData

vurquia
Champ in-the-making
Champ in-the-making

I read more carefully and see a lot of changes to do Smiley Sad Please don't consider my question before. This solution require a very large time and experience developing in alfresco.

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.