Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

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

Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

Hi everyone, I have completed this tutorial on how to create a model and assign doctype to a document to have custom properties.

 Tutorial: creating and using models in Alfresco Share | Alfresco Documentation

I am able to search with the search box but to find the document you have to type something like dc:writer:"WriterName", too complicated for normal user

What I am trying to do is adding an advanced searching form.

In Admin Tools i go to the search manager, i click create new filter.

A Dialog box Opens, I add filterName and filterID then i go on the combobox   filter property and my dc:writer doesn't exist.

How can i make that property to appear??

Thanks

Matteo

1 Solution

Accepted Solutions
kalpesh_c2
Senior Member

Re: Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

Hi,

It seems that you have created your content model using dynamic approach (Model Manager).

To make your custom property available in Filters, select 'List of Values - Whole Match' or 'List of Values - Partial Match' for indexing of your property while creating new property.

In your particular case, you can edit your 'dc:writer' property via Model Manager and try selecting 'List of Values - Whole Match' for indexing, you will find your property in the combo box of 'Create Filter' dialog.

Please let me know if you have any further query.

Thanks

Kalpesh

ContCentric

View solution in original post

6 Replies
kalpesh_c2
Senior Member

Re: Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

Hi,

It seems that you have created your content model using dynamic approach (Model Manager).

To make your custom property available in Filters, select 'List of Values - Whole Match' or 'List of Values - Partial Match' for indexing of your property while creating new property.

In your particular case, you can edit your 'dc:writer' property via Model Manager and try selecting 'List of Values - Whole Match' for indexing, you will find your property in the combo box of 'Create Filter' dialog.

Please let me know if you have any further query.

Thanks

Kalpesh

ContCentric

douglascrp
Advanced II

Re: Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

If what you want is to configure the advanced-search page to show your custom type in the select list, then you will go with the XML editing, as the Model Manager does not allow you to create the form configuration for search (at least, it wasn't when I tried).

In order to have the advanced-search working, folow this tutorial Working With Custom Content Types in Alfresco | ECMArchitect | Alfresco Developer Tutorials 

matteodefanti
Member II

Re: Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

Hi Kalpesh,

thanks for your answer, they now appear in the filter manager.

So now they are indexed as List of Values, what I would like to do would be now to create a dashlet that search based on those fields

Advanced search anyway not shows custom properties, the unique way till now for search is typing "dc:writer:"Matteo""

Is there a way to get an advanced search for custom properties?

Should I have to write with code?

kalpesh_c2
Senior Member

Re: Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

Hi, 

You will need to do the following configuration in share-config-custom.xml file.

<config replace='true' evaluator='string-compare' condition='AdvancedSearch'>
       <advanced-search>
          <forms>
            <!-- Custom form entry -->
             <form labelID='custom' descriptionID='customContent'>custom:customContentModel</form>
             <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>

and

<config evaluator="model-type" condition="cm:content">
      <forms>
          <form id="custom">
             <field-visibility>
                <show id="<your:Property>" force="true" />
             </field-visibility>
       <appearance>
          <field id="<your:Property>">
             <control template="/org/alfresco/components/form/controls/textfield.ftl" />
          </field>
       </appearance>
    </form>
    </forms>
</config>

Thanks,

Kalpesh

ContCentric

fabiobenedetti
Member II

Re: Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

Hi Kalpesh, i need the same advanced search form than matteo and after some google search i found this post.

I tried to edit the share-config-custom.xml file according to your advice, but the form does't appear in advanced search.

According to the Tutorial: creating and using models in Alfresco Share | Alfresco Documentation, i created Document model within whitepaper type and weable aspect and wirte this code to search by writer in files with document model applied:          

<config replace='true' evaluator='string-compare' condition='AdvancedSearch'>
       <advanced-search>
          <forms>
            <!-- Custom form entry -->
             <form labelID='custom' descriptionID='customContent'>custom:Document</form>
             <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>

and

<config evaluator="model-type" condition="cm:content">
      <forms>
          <form id="custom">
             <field-visibility>
                <show id="<dc:writer>" force="true" />
             </field-visibility>
       <appearance>
          <field id="<dc:writer>">
             <control template="/org/alfresco/components/form/controls/textfield.ftl" />
          </field>
       </appearance>
    </form>
    </forms>
</config>

Can you explain me how to create a search form for model "Document" as created in the tutorial ?

Many many thanks in advance.





douglascrp
Advanced II

Re: Alfresco Share - How to create an advanced search for a custom property, it doesn't appear in the filter

Jump to solution

The right way to achieve what you want is described in details in the following link: Working With Custom Content Types in Alfresco | ECMArchitect | Alfresco Developer Tutorials https://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html#configur...

You need to set the form id as this

<form id="search">