cancel
Showing results for 
Search instead for 
Did you mean: 

Search cm:content on aspect property

ebogaard
Champ on-the-rise
Champ on-the-rise
By creating a custom aspect with a property and extending the AdvancedSearch-form, I was expecting to be able to search on the data in this property. But I don't get any results.

What I can do:
1. Add the aspect to a cm:content node
2. Fill in the appropriate data (property type = d:date)
3. See in the Share interface that it's saved.
4. Be able to find content when using 'ASPECT:"abc:defMetaData"' as a search command.
5. Add the field as a facetable option with search manager
6. See the facet populated with filled in dates (when I search on some other field that the custom property)

What doesn't work:
7. Searching a date range in which the document should be found. No results are found.
8. Actually use the facets to filter the results. After I click an option: no results are found.

My Questions:
A. After doing some research, it seems that 'by default' Advanced Search doesn't include properties from aspects. Is that correct?
B. Is it possible to make Advanced Search search on aspects, when those are related to cm:content? If so, how?

If you need the model and share-config-custom.xml to be able to answer, let me know.
I hope someone can, at least, make clear if it's possible to use properties from custom aspects in advanced search, or if it's necessary to create a custom content type with the propertie(s). (I already made sure that I can actually search on all properties of a custom content type, so if that's the only way to go, be it so).

This is with Alfresco 5.0c
3 REPLIES 3

douglascrp
World-Class Innovator
World-Class Innovator
Yes, you can find documents by their aspects' properties values.
It's just a matter of configuring the advanced search for for the type that has the aspects attatched.

Please, share your share-config-custom.xml and maybe we can help you.

ebogaard
Champ on-the-rise
Champ on-the-rise
Okay, good to hear it should be possible. Here are the relevant parts:


   <config evaluator="string-compare" condition="DocumentLibrary">

      <aspects>
         <!– Aspects that a user can see –>
         <visible>
            <aspect name="abc:abcMetaData" />
         </visible>

         <!– Aspects that a user can add. Same as "visible" if left empty –>
         <addable>
         </addable>

         <!– Aspects that a user can remove. Same as "visible" if left empty –>
         <removeable>
         </removeable>
      </aspects>

   </config>

   <!– cm:content type (existing nodes) –>
   <config evaluator="node-type" condition="cm:content">
      <forms>
         <!– Default form configuabcion used on the document details and edit metadata pages –>
         <form>
            <field-visibility>
               <!– Title verbergen –>
               <hide id="cm:title" />
               <!– Custom Metadata toevoegen –>
               <show id="abc:dateDocument" />
            </field-visibility>
            <appearance>
               <field id="abc:dateDocument" label-id="label.abc_dateDocument" />
            </appearance>
         </form>

         <!– Document Library pop-up Edit Metadata form –>
         <form id="doclib-simple-metadata">
            <field-visibility>
               <!– Title verbergen –>
               <hide id="cm:title" />
               <!– Custom Metadata toevoegen –>
               <show id="abc:dateDocument" />
            </field-visibility>
            <edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
            <appearance>
               <field id="abc:dateDocument" label-id="label.abc_dateDocument" />
            </appearance>
         </form>

      </forms>
   </config>

   <!– cm:content type (creating nodes) –>
   <config evaluator="model-type" condition="cm:content" replace="true">
      <forms>
         <!– Default Create Content form –>
<!–
         <form>
            <field-visibility>
               <show id="cm:name" />
               <show id="cm:content" force="true" />
               <show id="cm:title" force="true" />
               <show id="cm:description" force="true" />
               <show id="mimetype" />
               <show id="app:editInline" force="true" />
            </field-visibility>
            <appearance>
               <field id="cm:name">
                 <control>
                    <control-param name="maxLength">255</control-param>
                 </control>
               </field>
               <field id="cm:title">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
               <field id="cm:content" label-id="">
                  <control>
                     <control-param name="editorAppearance">explorer</control-param>
                  </control>
               </field>
               <field id="mimetype">
                  <control template="/org/alfresco/components/form/controls/hidden.ftl">
                     <control-param name="contextProperty">mimeType</control-param>
                  </control>
               </field>
               <field id="app:editInline">
                  <control template="/org/alfresco/components/form/controls/hidden.ftl">
                     <control-param name="contextProperty">editInline</control-param>
                  </control>
               </field>
            </appearance>
         </form>
–>
         <!– Search form –>
         <form id="search">
            <field-visibility>
               <show id="cm:name" />
<!– Titel verbergen –>
               <hide id="cm:title" />
               <show id="cm:description" force="true" />
               <show id="mimetype" />
               <show id="abc:dateDocument" />
               <show id="cm:modified" />
               <show id="cm:modifier" />
            </field-visibility>
            <appearance>
               <field id="mimetype">
                  <control template="/org/alfresco/components/form/controls/mimetype.ftl" />
               </field>
               <field id="abc:dateDocument" label-id="label.abc_dateDocument">
                  <control template="/org/alfresco/components/form/controls/daterange.ftl" />
               </field>
               <field id="cm:modifier">
                  <control>
                     <control-param name="forceEditable">true</control-param>
                  </control>
               </field>
               <field id="cm:modified">
                  <control template="/org/alfresco/components/form/controls/daterange.ftl" />
               </field>
            </appearance>
         </form>
      </forms>
   </config>

ebogaard
Champ on-the-rise
Champ on-the-rise
No more responses?
Is the share-custom-config.xml too scary? 😉