AnsweredAssumed Answered

Custom aspect and advanced search

Question asked by agz on Dec 23, 2014
Hi all,
I've developed a custom aspect defining some custom properties.
Now I would have the Advanced Search form for this properties.
Notice that, in custom model I defined only an aspect and not a type of document.

I modified share-config-custom.xml for advanced search form and i see all properties in form, but when I search a document I have no results, 0 documents retreived.

This is my model:

<?xml version="1.0" encoding="UTF-8"?>

<model name="ff:ffModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>FF Document Model</description>
   <author></author>
   <version>1.0</version>

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <namespaces>
      <namespace uri="ff.model" prefix="ff"/>
   </namespaces>
<aspects>
           <aspect name="ff:document">
                        <title>FF document</title>
                        <properties>
                                <property name="ff:owner">
                                        <title>Owner</title>
                                        <type>d:text</type>
                                </property>
                                <property name="ff:prefix">
                                        <title>Prefix</title>
                                        <type>d:text</type>
                                </property>                              
                        <mandatory-aspects>
                                 <aspect>cm:versionable</aspect>
                        </mandatory-aspects>
                </aspect>

</aspects>
</model>


and this is my added section to share-config-custom.xml

<config evaluator="string-compare" condition="AdvancedSearch">
        <advanced-search>
            <!– Forms for the advanced search type list –>
            <forms>
                <form id="FFSearch" label="Document FF" description="FF search">cm:content</form>
            </forms>
        </advanced-search>
    </config>

    <config evaluator="model-type" condition="cm:content">
        <forms>
            <!– Search form –>
            <form id="FFSearch">
                <field-visibility>
                    <show id="cm:name" force="true" />
                    <show id="ff:owner" force="true"/>
                    <show id="ff:prefix" force="true"/>
                </field-visibility>
                <appearance>
                    <field id="ff:owner" label="Owner">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                    </field>

                    <field id="ff:prefix" label="Prefix">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                    </field>
                </appearance>
            </form>
        </forms>
    </config>


The form is correct, visible, active, but if I search a document for prefix=10 (and I have a document with this value) I have no results.
What is wrong?
I'm working in Alfresco 4.2.e.

Please ask me if you need extra informations.
Thanks in advance.

Outcomes