cancel
Showing results for 
Search instead for 
Did you mean: 

Add and search content by a custom property HELP

manuel
Champ in-the-making
Champ in-the-making
First, sorry for my english.

Hello, I have added a new property to the model of content in the file WEB-INF\classes\alfresco\model\contentModel.xml


     <type name="cm:content">
         <title>Content</title>
         <parent>cm:cmobject</parent>
         <properties>
            <property name="cm:content">
               <type>d:content</type>
               <mandatory>false</mandatory>
               <!— Index content in the background –>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>false</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
       <property name="cm:dni">
      <title>DNI</title>
      <type>d:text</type>
      <protected>true</protected>
       </property>
         </properties>
      </type>

The new property is dni.

Also I have added the property in the file WEB-INF\classes\alfresco\web-client-config-properties.xml in order that it show in the webclient.


   <config evaluator="node-type" condition="content">
      <property-sheet>
      <show-property name="dni" showInEditMode="false" />
         <show-property name="name" showInEditMode="false" />
         <show-property name="mimetype" displayLabelId="mimetype" converter="org.alfresco.faces.MimeTypeConverter" showInEditMode="false" />
         <show-property name="title" showInEditMode="false" />
         <show-property name="description" showInEditMode="false" />
         <show-property name="size" displayLabelId="size" converter="org.alfresco.faces.ByteSizeConverter" showInEditMode="false" />
      </property-sheet>
   </config>

I want search for this property and add and create a new content with this property.

Help me please
Thanks
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
You have done everything you need to do to show the property. When you create any new content it should have the new property you have defined and it should show when you look at the contents details due to the configuration change you made.

To search on the property look for the following in web-client-config.xml…


<config evaluator="string-compare" condition="Advanced Search">

In that section there is a section called "custom-properties", add your property in there.

However, I would strongly suggest using the configuration override approach rather than changing our files (it will help when you come to upgrade). Have a look at the following wiki articles for more information:

http://wiki.alfresco.com/wiki/Web_Client_Configuration_Guide
http://wiki.alfresco.com/wiki/Web_Client_Customisation_Guide
http://wiki.alfresco.com/wiki/Web_Client_Model_Configuration_Guide
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide
http://wiki.alfresco.com/wiki/Advanced_Search_Custom_Attributes

manuel
Champ in-the-making
Champ in-the-making
thank you very much

manuel
Champ in-the-making
Champ in-the-making
A question.

When I add or create a new content, it does not show the new property to give it a value. How I can do in order that it shows the new property?

gavinc
Champ in-the-making
Champ in-the-making
Presuming you are using 1.3 follow the steps in http://wiki.alfresco.com/wiki/Web_Client_Model_Configuration_Guide and when you create the content a property page will show.