I cannot manage to appear a property that belongs to an aspect in advance search
My custom type is `myDocument`, and my custom aspects are `my:abstractPable` and `my:incomingP`
<!-- customModel.xml -->
<type name="myDocument">
<title>p document</title>
<parent>cm:content</parent>
<mandatory-aspects>
<aspect>my:abstractPable</aspect>
<aspect>cm:classifiable</aspect>
</mandatory-aspects>
</type>
<aspect name="my:abstractPable">
<title>Abstract P able</title>
<properties>
<property name="myNumber">
<type>d:int</type>
<mandatory>true</mandatory>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
<facetable>true</facetable>
</index>
</property>
....
<aspect name="my:incomingP">
<title>Incoming P doc</title>
<parent>my:abstractPable</parent>
<properties>
<property name="myriginP">
<type>d:text</type>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
...
I have configured AdvancedSearch:
<!-- share-config-custom.xml -->
<config evaluator="string-compare" condition="AdvancedSearch">
<advanced-search>
<forms>
<form labelId="type.my_pDocument" descriptionId="type.my_pDocument">myDocument</form>
...
How should i configure the search form in order to appear `myriginP` property?
Solved! Go to Solution.
I wrote about this at Alfresco Share – Customize advanced search for aspect properties | Programming and So
Probably easier alternative is to include force="true" in your field-visibility tag.
I wrote about this at Alfresco Share – Customize advanced search for aspect properties | Programming and So
Probably easier alternative is to include force="true" in your field-visibility tag.
the force="true" works.
I am also setting some appearance configurations, but they does not seem to be used?
E.g. i am setting the daterange.ftl control template in a date field, and the form show the standard edit date template. Any ideas? thank you again.
No clue at this side. Can you provide the XML fragment for Advanced Search and Search Form Definition?
it is something like:
<config replace="true" evaluator="string-compare" condition="AdvancedSearch">
<advanced-search>
<forms>
<form id="custom-search" labelId="advsearch.label.custom" descriptionId="advsearch.description.custom">cm:content</form>
</forms>
</advanced-search>
</config>
<config evaluator="model-type" condition="cm:content">
<forms>
<form id="custom-search">
<field-visibility>
<show id="cm:name" force="true" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<show id="my:aDate" force="true" />
...
<appearance>
<field id="my:aDate" label-id="prop.my_aDate">
<control template="/org/alfresco/components/form/controls/daterange.ftl"/>
</field>
...
</appearance>
</field-visibility>
</form>
</forms>
</config>
so not cool: just noticed that appearance is wrongly inside field-visibility. this was the mistake.. sorry to bother you again!
I was going to point that, and I think it would be nice if you actually shared here what exactly you changed, as this may be used as a reference for someone finding this thread in the future.
I followed the 'Alternative workaround' of @ Angel Borroy post:
Alfresco Share – Customize advanced search for aspect properties | Programming and So
In our custom module (share and repo), where our custom model is defined,
at \my-amp-share\src\main\resources\META-INF\share-config-custom.xml
we override the AdvancedSearch
<config replace="true" evaluator="string-compare" condition="AdvancedSearch">
<advanced-search>
<forms>
<form id="custom-search" labelId="advsearch.label.custom" descriptionId="advsearch.description.custom">cm:content</form>
</forms>
</advanced-search>
</config>
<config evaluator="model-type" condition="cm:content">
<forms>
<form id="custom-search">
<field-visibility>
<show id="cm:name" force="true" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<show id="my:aDate" force="true" />
...</field-visibility><field id="my:aDate" label-id="prop.my_aDate">
<appearance>
<control template="/org/alfresco/components/form/controls/daterange.ftl"/>
</field>
...
</appearance>
</form>
</forms>
</config>
at \my-amp-share\src\main\amp\config\alfresco\module\my-amp-share\messages\customModel.properties we define the labels, e.g.:
prop.my_aDate=a Date
(the resourceBundles should be referenced in the my-amp-share\src\main\amp\config\alfresco\web-extension\content-model-context.xml)
at \my-amp-core\src\main\amp\config\alfresco\module\my-amp-core\model\customModel.xml
the custom aspects are defined.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.