cancel
Showing results for 
Search instead for 
Did you mean: 

Metadata - Alfresco Community 4.0 (Need Help)

durvaljr
Champ in-the-making
Champ in-the-making
Good morning,

I need some help in relation to advanced search and metadata.

Need to set up the research with two new search fields.

For example, I have a medical records and need the Alfresco in the search field, find:

- The name of the patient
- The number of the document (each document has its specific number)


Can anyone help me? I need this information urgently.



Follows the data and version of my Alfresco.
- Alfresco Community 4.0


Thank you!!
4 REPLIES 4

rajeshavatani
Champ in-the-making
Champ in-the-making
<strong>Alfresco Explorer</strong>

To configure your custom property you need to add the following configuration in web-client-config-custom.xml.

<config evaluator="string-compare" condition="Advanced Search">
   <advanced-search>
      <content-types>
         <type name="my:contentType" />
      </content-types>
      <folder-types>
      </folder-types>
      <custom-properties>
         <meta-data type="my:contentType" property="my:documentNumber" />
       </custom-properties>
   </advanced-search>
</config>


<strong>Alfresco Share</strong>

In the share-config-custom.xml add the below form element

<form label="Patient Information" description="Patient Information Search">my:contentType</form>

Then add the following configuration to define the search Form for that type

<config evaluator="model-type" condition="my:contentType">
      <forms>
         <!– Search form –>
         <form id="search">
            <field-visibility>
               <show id="cm:name" />
               <show id="my:documentNumber" />              
            </field-visibility>           
         </form>
      </forms>
   </config>

Hope this helps.

Hi Rajesh,



I tried using this code and it did not work.
Could you explain step by step how to do?

I tried to do this another way as well and could not.

1 - The rules that I create in a repository are not saved, do not know why.

2 - I was able to put this code and it did not work too …


<code>
CustomModel.xml ::::::::: :::


<? Xml version = "1.0" encoding = "UTF-8"?>
<! - Custom Model ->
<! - Note: This model is pre-configured to load at startup of the Repository. So, all custom ->
<! - Types and aspects added here will automatically be registered ->
 
<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<! - Optional meta-data about the model ->
 
<description> Custom Model </ description>
<author> </ 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>
 
      <! - Introduction of new namespaces defined by this model ->
      <! - NOTE: The following namespace custom.model Should be changed to reflect your own namespace ->
 
     <namespaces>
      <namespace uri="custom.model" prefix="custom"/>
     </ Namespaces>
 
<aspects>
      <aspect name="nx:notafiscal">
         <title> Invoice </ title>
         <properties>
 
            <property name="nx:nomecliente">
   <title> Customer Name </ title>
   <type> d: text </ type>
            </ Property>
 
            <property name="nx:numero">
   <title> Number </ title>
   <type> d: int </ type>
            </ Property>
     
     <property name="nx:data">
   <title> Date </ title>
   <type> d: date </ type>
            </ Property>
         </ Properties>
      </ Aspect>
   </ Aspects>
   </ Model>
</ Code>




:::::::::::::::: Custom-model-context.xml; ::::::::::::::::::::::::

<code>

<? Xml version = '1 .0 'encoding =' UTF-8 '?>
<! DOCTYPE beans PUBLIC "- / / SPRING / / DTD BEAN / / EN '' http://www.springframework.org/dtd/spring-beans.dtd '>
 
<beans>
 
    <! - Registration of new models ->

    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
 
            <list>
                <value> alfresco / extension / customModel.xml </ value>
            </ List>
 
        </ Property>
 
    </ Bean>
        </ Beans>
</ Code>



:::::::::::::::::::::::::::::::::::: Web-client-config-custom.xml ::::: :::::::::::::::::
<alfresco-config>
 
   <! - Example of overriding the from email address ->
   <! -
 
   <config>
      <client>
         <from-email-address> suporte@munditech.com </ from-email-address>
         <search-max-results> 100 </ search-max-results>
      </ Client>
   </ Config>
 
   ->
 
   <! - Example of adding languages ​​to the list in the login page ->
   <! -
 
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="ca_ES"> Catalan </ language>
         <language locale="hr_HR"> Croatian </ language>
         <language locale="cs_CZ"> Czech </ language>
         <language locale="da_DK"> Danish </ language>
         <language locale="de_DE"> German </ language>
         <language locale="es_ES"> Spanish </ language>
         <language locale="el_GR"> Greek </ language>
         <language locale="fi_FI"> Finnish </ language>
         <language locale="fr_FR"> French </ language>
         <language locale="it_IT"> Italian </ language>
         <language locale="ja_JP"> Japanese </ language>
         <language locale="du_NL"> Dutch </ language>
         <language locale="pl_PL"> Polish </ language>
         <language locale="pt_PT"> English </ language>
         <language locale="pt_BR"> Portuguese (Brazilian) </ language>
         <language locale="ru_RU"> Russian </ language>
         <language locale="sv_SV"> Swedish </ language>
         <language locale="tr_TR"> Turkish </ language>
         <language locale="zh_CN"> Simplified Chinese </ language>
      </ Languages>
   </ Config>

   ->
   <! - Example of configuring advanced search ->
   <! -
 
   <config evaluator="string-compare" condition="Advanced Search">
     <advanced-search>
         <content-types>
         </ Content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </ Custom-properties>
      </ Advanced-search>
   </ Config>

   ->
   <! - Example of changing the sort direction for the view in the client ->
   <! -

   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction> ascending </ sort-direction>
            </ Topic>
         </ View-defaults>
      </ Views>
   </ Config>
  
->
   <! - Example of adding a custom icon to the Create Space dialog ->
   <! -
 
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </ Icons>
   </ Config>
 
   ->
   <! - The config below shows how to Incorporate the example model ->
   <! - Into the web client, for this to work you will need to ->
   <! - Rename example-model-context.xml.sample to example-model-context.xml ->
   <! -

<config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </ Content-types>
   </ Config>
 
   <config evaluator="node-type" condition="my:sop">
      <property-sheet>
         <Show-property name = "mimetype" display-label-id = "content_type"
                        component-generator = "MimeTypeSelectorGenerator" />
 
         <Show-property name = "size" display-label-id = "size"
                        convert = "org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode = "false" />
         <show-property name="mySmiley TongueublishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="mySmiley TonguerocessSteps" />
      </ Property-sheet>
   </ Config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </ Property-sheet>
   </ Config>

   <config evaluator="aspect-name" condition="cm:storeSelector">
<property-sheet>
<show-property name="cm:storeName" component-generator="StoreSelectorGenerator" />
</ Property-sheet>
   </ Config>
 
  <config evaluator="aspect-name" condition="nx:notafiscal">
    <property-sheet>
      <separator name="sep01" display-label="Nota Fiscal" component-generator="HeaderSeparatorGenerator"/>
      <show-property name="nx:nomecliente" />
      <show-property name="nx:numero" />
      <show-property name="nx:data" />
    </ Property-sheet>
  </ Config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="cm:storeSelector"/>
      </ Aspects>
     <aspects>
       <aspect name="nx:notafiscal" />
     </ Aspects>
   </ Config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </ Aspects>
   </ Config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </ Content-types>
 
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </ Custom-properties>
      </ Advanced-search>
   </ Config>
</ Alfresco-config>


</ Code>


I used to try to create these XML looks and a rule in a repository, deploying field invoice and other 3 search fields you can search for documents through other data.

But like I said, it did not work.

You know what I'm doing wrong?

I do not know what else to do for work.


-
version of alfresco in use = 4.2 comunnity
by using alfresco explorer
and also trying to use the share.

Here are the files
After you deploy these files and restart the server and login and follow these steps
1. Using Run Action wizard add the 'Invoice' aspect from the dropdown list to any content of type cm:content.
2. Edit the content properties, you will find the Customer Name and Number custom properties.
3. After adding the customer name and number, go to Advance Search and you will find these two custom properties.
4. Search the content based on these custom properties.


<strong>customModel.xml</strong>


<?xml version="1.0" encoding="UTF-8"?>

<!– Custom Model –>

<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!–       types and aspects added here will automatically be registered –>

<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Custom Model</description>
   <author></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>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="custom.model" prefix="custom"/>
   </namespaces>

   <aspects>
      <aspect name="custom:nsmileynotafiscal">
         <title>Invoice</title>
         <properties>

            <property name="custom:nsmileynomecliente">
            <title>Customer Name</title>
            <type>d:text</type>
            </property>

            <property name="custom:nsmileynumero">
            <title>Number</title>
            <type>d:int</type>
            </property>
    
         <property name="custom:nsmileydata">
            <title>Date</title>
            <type>d:date</type>
            </property>

         </properties>
      </aspect>
   </aspects>
     
</model>


<strong>custom-model-context.xml</strong>


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

    <!– Registration of new models –>   
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>


<strong>web-client-config-custom.xml</strong>


<alfresco-config>
<config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="custom:nsmileynotafiscal"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="cm:content" />
         </content-types>
         <custom-properties>
            <meta-data aspect="custom:nsmileynotafiscal" property="custom:nsmileynomecliente"/>
         <meta-data aspect="custom:nsmileynotafiscal" property="custom:nsmileynumero"/>
         </custom-properties>
      </advanced-search>
   </config>

   <config evaluator="aspect-name" condition="custom:nsmileynotafiscal">
      <property-sheet>
         <show-property name="custom:nsmileynomecliente"/>
         <show-property name="custom:nsmileynumero"/>
         <show-property name="nsmileydata"/>
      </property-sheet>
   </config>
</alfresco-config>

Hi,

I've placed your files via share on "Repository - Data Dictionary - Models".
I'm only able to make customModel active, both custom-model-context and web-client-config-custom are unable to be marked active.
Should all 3 files be in the same directory?

Thanks a lot