cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Search returns no results for custom properties

chrisokelly
Champ on-the-rise
Champ on-the-rise
Hi,

I have created a custom content model and deployed it. It works fine in Share and Explorer in the sense that I can apply the types and aspects to content and set the properties. I also use fme's gallery plus dashlet, which I have modified slightly to allow me to filter photo's by aspect or property. The Dashlet successfully finds the pictures it should, so I have to assume my properties are searchable. I am able to search with {namespace}:{property}:{value} in the search form and in the node browser and the advanced search form in the Alfresco browser also finds the content it should.

The one situation in which I cannot find the content I want is using the advanced search form, which I have modified to include the custom properties. This is a problem as we only plan to have the Share client for end user's, and I do not expect them to properly form search syntax, so they need to use the form.

as far as I can tell, from looking at the parameters passed to the search page, it may have something to do with inverted commas (") around the {namespace}_{property} section. The train of thought that leads me here is I can copy the query parameter, remove inverted commas around each instance of {namespace}_{property} (so that the end result looks like {namespace}_{property}:"",{namespace}_{property}:"",{namespace}_{property}:""…{namespace}_{property}:"an actual value",{namespace}_{property}:"",{namespace}_{property}:""…) and paste into the search bar to get the results I need.

Here's the contents of relevant configurations-


Share-config-custom.xml (truncated)
 <!– Search form –>
         <form id="search">
            <field-visibility>
               <show id="cm:name" />
               <show id="cm:title" force="true" />
               <show id="cm:description" force="true" />
               <show id="mimetype" />
               <show id="cm:modified" />
               <show id="cm:modifier" />
               <!– Custom content –>
               <!– my:companyname –>
               <show id="my:originatingSite" />
               <!– my:vehicle –>
               <show id="my:vehicleMake" />
               <show id="my:vehicleModel" />
               <show id="my:vehicleBody" />
               <!– my:publishable –>
               <show id="my:webPublishable" />
               <show id="my:printPublishable" />
               <!– my:photoLocation –>
               <show id="my:locationType" />
               <show id="my:locationFull" />
               <!– my:clientRelated –>
               <show id="my:clientName" />
               <!– my:competitorRelated –>
               <show id="my:competitorName" />
               <!– my:incidentRelated –>
               <show id="my:incidentType" />
               <!– my:noncomplianceRelated –>
               <show id="my:nonComplianceType" />
               <!– my:eventRelated –>
               <show id="my:event" />
            </field-visibility>
            <appearance>
               <field id="mimetype">
                  <control template="/org/alfresco/components/form/controls/mimetype.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>
               <!– Custom content –>
               <set id="companynameDocument" appearance="bordered-panel" label="companyname Document Properties" />
               <field id="my:originatingSite" label="Originating Site" set="companynameDocument">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,option1, option2, option3</control-param>
                  </control>
               </field>
               <set id="companynameVehicle" appearance="bordered-panel" label="Vehicle Properties" />
               <field id="my:vehicleMake" label="Vehicle Make" set="companynameVehicle">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,Ford,Mitsubishi,Nissan,Toyota,VW,Mazda</control-param>
                  </control>
               </field>
               <field id="my:vehicleModel" label="Vehicle Model" set="companynameVehicle">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
               <field id="my:vehicleBody" label="Vehicle Body" set="companynameVehicle">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,Single Cab - Cab/Chassis,Dual Cab - Cab/Chassis,Dual Cab - Tub/Style Side,Wagon,Extra Cab - Cab/Chassis,Single Cab - Tub/Style Side,Extra Cab - Tub/Style Side,Troop Carrier/Personnel Carrier,Van/Bus/People Mover</control-param>
                  </control>
               </field>
               <set id="companynamePublishable" appearance="bordered-panel" label="Publishable Properties" />
               <field id="my:webPublishable" label="Web Publishable" set="companynamePublishable">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,true|Is Web Publishable,false|Is not Web Publishable</control-param>
                  </control>
               </field>
               <field id="my:printPublishable" label="Print Publishable" set="companynamePublishable">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,true|Is Print Publishable,false|Is not Print Publishable</control-param>
                  </control>
               </field>
               <set id="companynamePhotoLocation" appearance="bordered-panel" label="Photo Location Properties" />
               <field id="my:locationType" label="Location Type" set="companynamePhotoLocation">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,Studio,Landscape,Office,Event,Client Site</control-param>
                  </control>
               </field>
               <field id="my:locationFull" label="Location" set="companynamePhotoLocation">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
               <set id="companynameClient" appearance="bordered-panel" label="companyname Client Properties" />
               <field id="my:clientName" label="Client Name" set="companynameclient">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
               <set id="companynameCompetitor" appearance="bordered-panel" label="companyname Competitor Properties" />
               <field id="my:competitorName" label="Competitor Name" set="companynameCompetitor">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
               <set id="companynameIncident" appearance="bordered-panel" label="Photo Incident Properties" />
               <field id="my:incidentType" label="Incident Type" set="companynameIncident">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,Rollover,Part Failure</control-param>
                  </control>
               </field>
               <set id="companynameNonCompliance" appearance="bordered-panel" label="Non Compliance Properties" />
               <field id="my:nonComplianceType" label="Non Compliance Type" set="companynameNonCompliance">
                  <control template="/org/alfresco/components/form/controls/selectone.ftl">
                     <control-param name="options">,Fitting,Material</control-param>
                  </control>
               </field>
<set id="companynameEvent" appearance="bordered-panel" label="companyname Event Properties" />
               <field id="my:event" label="Event" set="companynameEvent">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>
            </appearance>
         </form>
      </forms>
   </config>
</alfresco-config>

custom Model
<model name="my:companynameDocumentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
        <description>companyname Document Model</description>
        <author>Chris O'Kelly</author>
        <version>1.0</version>

        <imports>
                <!– Import Alfresco Dictionary Definitions –>
                <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
                <!– Import Alfresco Content Domain Model Definitions –>
                <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
        </imports>

        <namespaces>
                <!– Define a namespace for the new definitions –>
                <namespace uri="my.companyname.root" prefix="my"/>
        </namespaces>

        <!– Constraints Definitions go here –>
        <constraints>
                <constraint name="my:companynameSites" type="LIST">
                        <parameter name="allowedValues">
                                <list>
                                        <value>option1</value>
                                        <value>option2</value>
                                        <value>option3</value>
                                </list>
                        </parameter>
                </constraint>

                <constraint name="my:vehicleMakes" type="LIST">
                        <parameter name="allowedValues">
                                <list>
                                        <value>Ford</value>
                                        <value>Mitsubishi</value>
                                        <value>Nissan</value>
                                        <value>Toyota</value>
                                        <value>VW</value>
                                        <value>Mazda</value>
                                </list>
                        </parameter>
                </constraint>

                <constraint name="my:vehicleBodys" type="LIST">
                        <parameter name="allowedValues">
                                <list>
                                        <value>Single Cab - Cab/Chassis</value>
                                        <value>Dual Cab - Cab/Chassis</value>
                                        <value>Dual Cab - Tub/Style Side</value>
                                        <value>Wagon</value>
                                        <value>Extra Cab - Cab/Chassis</value>
                                        <value>Single Cab - Tub/Style Side</value>
                                        <value>Extra Cab - Tub/Style Side</value>
                                        <value>Troop Carrier/Personnel Carrier</value>
                                        <value>Van/Bus/People Mover</value>
                                </list>
                        </parameter>
                </constraint>
<constraint name="my:locationTypes" type="LIST">
                        <parameter name="allowedValues">
                                <list>
                                        <value>Studio</value>
                                        <value>Landscape</value>
                                        <value>Office</value>
                                        <value>Event</value>
                                        <value>Client Site</value>
                                </list>
                        </parameter>
                </constraint>

                <constraint name="my:incidentTypes" type="LIST">
                        <parameter name="allowedValues">
                                <list>
                                        <value>Rollover</value>
                                        <value>Part Failure</value>
                                </list>
                        </parameter>
                </constraint>

                <constraint name="my:nonComplianceTypes" type="LIST">
                        <parameter name="allowedValues">
                                <list>
                                        <value>Fitting</value>
                                        <value>Material</value>
                                </list>
                        </parameter>
                </constraint>
        </constraints>

        <!– Type Definitions go here –>
        <types>
                <type name="my:companyname">
                        <title>companyname Document Type</title>
                        <parent>cm:content</parent>
                        <properties>
                                <property name="my:originatingSite">
                                        <type>d:text</type>
                                        <constraints>
                                                <constraint ref="my:companynameSites"/>
                                        </constraints>
                                </property>
                        </properties>
                </type>

                <type name="my:companynameSecure">
                        <title>companyname Secure Document Type</title>
                        <parent>my:companyname</parent>
                </type>
        </types>
        <!– Aspect Definitions go here –>
        <aspects>
                <aspect name="my:fittingInstruction">
                        <title>Fitting Instruction</title>
                        <properties>
                                <property name="my:dateIssued">
                                        <type>d:date</type>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:vehicle">
                        <title>Vehicle</title>
                        <properties>
                                <property name="my:vehicleMake">
                                        <type>d:text</type>
                                        <constraints>
                                                <constraint ref="my:vehicleMakes"/>
                                        </constraints>
                                </property>
                                <property name="my:vehicleBody">
                                        <type>d:text</type>
                                        <constraints>
                                                <constraint ref="my:vehicleBodys"/>
                                        </constraints>
                                </property>
                                <property name="my:vehicleModel">
                                        <type>d:text</type>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:publishable">
                        <title>Publishable</title>
                        <properties>
                                <property name="my:webPublishable">
                                        <type>d:boolean</type>
                                        <default>false</default>
                                </property>
                                <property name="my:printPublishable">
                                        <type>d:boolean</type>
                                        <default>false</default>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:photoLocation">
                        <title>Photo Location</title>
                        <properties>
                                <property name="my:locationType">
                                        <type>d:text</type>
                                        <constraints>
                                                <constraint ref="my:locationTypes"/>
                                        </constraints>
                                </property>
                                <property name="my:locationFull">
                                        <type>d:text</type>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:clientRelated">
                        <title>Client Related</title>
                        <properties>
                                <property name="my:clientName">
                                        <type>d:text</type>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:competitorRelated">
                        <title>Competitor Related</title>
                        <properties>
                                <property name="my:competitorName">
                                                <type>d:text</type>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:incidentRelated">
                        <title>Incident Related</title>
                        <properties>
                                <property name="my:incidentType">
                                        <type>d:text</type>
                                        <constraints>
                                                <constraint ref="my:incidentTypes"/>
                                        </constraints>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:nonComplianceRelated">
                        <title>Non-Compliance Related</title>
                        <properties>
                                <property name="my:nonComplianceType">
                                        <type>d:text</type>
                                        <constraints>
                                                <constraint ref="my:nonComplianceTypes"/>
                                        </constraints>
                                </property>
                        </properties>
                </aspect>
                <aspect name="my:eventRelated">
                        <title>companyname Event Related</title>
                        <properties>
                                <property name="my:event">
                                        <type>d:text</type>
                                </property>
                        </properties>
                </aspect>
        </aspects>
</model>

Has anyone else experienced this or knows what I have done wrong here? Oh, at the time of the search there is no error in catalina or alfresco.log. we use alfresco 4.0.d community.

edit: obfuscating some company related data
4 REPLIES 4

bisana
Champ on-the-rise
Champ on-the-rise
Ya, I was having the same experience few times when I was experimenting with shares,
The problem was with "share-config-custom.xml" file which we create at "tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension/"
Please recheck the file contents

chrisokelly
Champ on-the-rise
Champ on-the-rise
Ya, I was having the same experience few times when I was experimenting with shares,
The problem was with "share-config-custom.xml" file which we create at "tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension/"
Please recheck the file contents

Hi Bisana,

This doesn't seem right to me, shouldn't share-config-custom.xml be in tomcat/shared/classes/alfresco/web-extension instead? I posted all of my share-config-custom in my original post, any thoughts as to specifically what is wrong with it? What was the problem you alluded to with yours?

bisana
Champ on-the-rise
Champ on-the-rise
See this, one share-config-custom.xml file is there by default, the other one we create


[alfresco@r12docs tomcat]$ find -name "share-config-custom.xml" -print
./webapps/share/WEB-INF/classes/alfresco/web-extension/share-config-custom.xml
./shared/classes/alfresco/web-extension/share-config-custom.xml
[alfresco@r12docs tomcat]$


You have posted the default one,  you need to create another in "tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension"
I did land up in lots of problems, 50% of time was XML tag problem.
The document from http://ecmarchitect.com/images/articles/alfresco-content/content-article-2ed.pdf was  very helpful, I advice you to go through it, very helpful to clear the doubts.
Thanks
Joseph John
Note:- If my postings is useful, please rate me using the , rate post incon on the Right hand side

chrisokelly
Champ on-the-rise
Champ on-the-rise
Hi Joseph,

That is actually the document I followed in order to apply my custom aspects to share. the only difference for me was that I placed the file in shared rather than under WEB-INF. I was originally told, in no uncertain terms, that one must not modify anything at all under the WEB-INF directory. Even the alfresco wiki says this http://wiki.alfresco.com/wiki/Repository_Configuration#Introduction. Everything else worked in the shared location (aspects can be applied by users, custom properties show up on items with custom aspects, can specialize to custom types, the fields for custom properties on the advanced search form), so I am not sure why this (advanced search) would not.
In our installation there was no web-extension folder under share/WEB-INF/classes/alfresco, nevertheless, creating this folder and copying our share-config-custom.xml into it, then restarting, has not made any change to the issue.

I must admit I am now quite confused about the WEB-INF directory. All through the forums and wiki's I see references not to touch it, it seems unlikely one would need to go against this advice for a simple issue like searching on custom properties.

I know the xml is valid (or at least, I know it validates successfully). Also the fact that all these other things are working from it suggests the xml is working. the params sent by the advanced search form seem to append "prop_" to the default properties and not my custom ones, so I am guessing this is part of the issue (Lothar Märkle's post on the same problem, https://forums.alfresco.com/en/viewtopic.php?f=48&t=44482, alerted me to this). As the article by Jeff Potts would have been tested I am sure his steps worked at some point - does this mean I have missed a step or does it mean his steps are not compatible with the latest version of Alfresco? If the latter, does that mean the latest version has a bug causing it not to include the "prop_" prefix (I haven't found any in the tracker but my inexperience makes me wary to add one in case it is not actually a bug)?


Issue solved - Lothar Märkle's post, https://forums.alfresco.com/en/viewtopic.php?f=48&t=44482 has resolved my issue - it is resolved by adding a custom form control template to add the prop_ prefix to the params for the custom properties to be searched.