cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Search custom content model not working

dmurphy
Champ in-the-making
Champ in-the-making
Hey there,
I've looked through the forums to find how to get custom content models to be able to simple search, and none so far have worked. I've come in to this job after someone else has set up alfresco, with very little knowledge of web development.

Version: Alfresco Explore community 4.2.0

I've tried what is shown at the bottom of this link:
http://wiki.alfresco.com/wiki/Web_Client_Customisation_FAQ#Adding_Properties_to_Simple_Search
As well as:
http://de.slideshare.net/alfresco/alfresco-search-internals
from slide 19. Both of these were found via searching through the forums.

anyways here's the code:
Model:

<?xml version="1.0" encoding="UTF-8"?>
<model name="iabook:catalogue" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Student Document Information</description>
<author>Declan Murphy</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="http://www.infoaxon.com/book/models/catalogue/1.0" prefix="iabook"/>
</namespaces>
<constraints>
<constraint name="iabook:filetypess" type="LIST">
<parameter name="allowedValues">
<list>
<value>Transcript</value>
<value>Waiver of Academic Regulations</value>
<value>Study Plans</value>
<value>Grade Changes</value>
<value>Medical Notes</value>
<value>Transfer Credit Forms</value>
<value>Readmission Recommendation Forms</value>
<value>Letter of Permission</value>
<value>Request to View Examination Script</value>
<value>Supplementary Examination</value>
<value>Emails</value>
<value>Other</value>
</list>
</parameter>
<parameter name="caseSensitive">
<value>false</value>
</parameter>
</constraint>
</constraints>
<types>
<type name="iabook:Product">
<title>Student Document</title>
<parent>cm:content</parent>
<properties>

<property name="iabook:id">
<title>Student ID</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>

<property name="iabook:filedate">
<title>Date of File</title>
<type>d:date</type>
<mandatory>true</mandatory>
</property>

<property name="iabook:filetype">
<title>Type of File</title>
<type>d:text</type>
<mandatory>true</mandatory>
<constraints>
<constraint ref="iabook:filetypess" />
</constraints>
</property>

</properties>
</type>
</types>
</model>


web-client-config-custom.xml:



<alfresco-config>
<config evaluator="string-compare" condition="Views">
<views>
<view-defaults>
<browse>
<!– allowable values: list|details|icons –>
<view>details</view>
<page-size>
<list>20</list>
<details>20</details>
<icons>20</icons>
</page-size>
</browse>
</view-defaults>
</views>
</config>

<config evaluator="string-compare" condition="Languages">
<languages>
<language locale="de_DE">German</language>
<language locale="es_ES">Spanish</language>
<language locale="fr_FR">French</language>
<language locale="it_IT">Italian</language>
</languages>
</config>

<config>
   <client>
      <simple-search-additional-attributes>
         <qname>{http://www.infoaxon.com/book/models/catalogue/1.0}id</qname>
         <qname>{http://www.infoaxon.com/book/models/catalogue/1.0}filedate</qname>
         <qname>{http://www.infoaxon.com/book/models/catalogue/1.0}filetype</qname>
      </simple-search-additional-attributes>
   </client>
</config>

<config>
<client>
<shelf-visible>false</shelf-visible>
</client>
</config>
<config evaluator="string-compare" condition="Sidebar">
<sidebar>
<default-plugin>shelf</default-plugin>
</sidebar>
</config>
<!– Custom Content Type Settings –>
<config evaluator="string-compare" condition="Content Wizards">
<content-types>
<type name="iabook:Product"/>
</content-types>
</config>
<config evaluator="node-type" condition="iabook:Product">
<property-sheet>
<show-property name="name" />
<show-property name="mimetype" display-label-id="content_type" component-generator="MimeTypeSelectorGenerator" />
<show-property name="encoding" display-label-id="encoding" ignore-if-missing="false" component-generator="CharsetSelectorGenerator" />
<show-property name="size" display-label-id="size" converter="org.alfresco.faces.ByteSizeConverter" show-in-editmode="false" />
<show-property name="title" display-label-id="title" ignoreif-missing="false" />
<show-property name="description" display-labelid="description" ignore-if-missing="false" component-generator="MultilingualTextAreaGenerator" />
<show-property name="iabook:id" />
<show-property name="iabook:filedate" />
<show-property name="iabook:filetype" />
</property-sheet>
</config>

<config evaluator="string-compare" condition="Advanced Search" replace="true">
   <advanced-search>
      <content-types>
         <type name="iabook:Product"/>
      </content-types>
   <custom-properties>
      <meta-data type="iabook:Product" property="iabook:id"/>
      <meta-data type="iabook:Product" property="iabook:filedate"/>
      <meta-data type="iabook:Product" property="iabook:filetype"/>
   </custom-properties>
   </advanced-search>
</config>


</alfresco-config>
 


search.get.config.xml: I don't think this is in the right place, since a forum post indicated to place it in a path that doesn't seem to exist on the server.


<search>
   <default-query-template>%(cm:name cm:title cm:description ia:whatEvent ia:descriptionEvent lnk:title lnk:description iabook:id iabook:filedate iabook:filetype TEXT TAG)</default-query-template>
</search>


Edit: Accidentally put in old version of search.get.config
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
Are you checking Alfresco share? Because above changes will add your custom properties to Alfresco explorer.
For adding it to Alfresco Share you need to do entry in share-config-custom.xml

dmurphy
Champ in-the-making
Champ in-the-making
Sorry Should have mentioned, yes we are using explore, not share.