cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new metadata

gutierrez_ge
Champ in-the-making
Champ in-the-making
Hi, does anyone know how can i add new meta-data to the content of a file?

I create a new model (well actually i copied it from the  documentation from wiki) and then it says something about adding this lines

   <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>

but it doesnt say on what XML file do i have to add it.
7 REPLIES 7

gutierrez_ge
Champ in-the-making
Champ in-the-making
i can see nobody is answering…

to keep it simple.. does anyone know how can i add new metadata information to the files being loaded? like name, content-type and that stuff.

Thanks,

alexander
Champ in-the-making
Champ in-the-making
May be this will help:
http://wiki.alfresco.com/wiki/Step-By-Step:_Creating_A_Custom_Model

Also, there are some example files supplied with distribution. Look in tomcat/shared/classes/alfresco/extension/. There should be exampleModel.xml and example-model-context.xml.sample

gutierrez_ge
Champ in-the-making
Champ in-the-making
i have done all of that… and nothing seems to work… i have a question

the new metadata that i will add, will i see them when i want to add a new content?

gutierrez_ge
Champ in-the-making
Champ in-the-making
still nothing,

lets see..

on web-client-config-custon.xml located on alfresco/extension (also this file is on alfresco/ and have the same snipplet, but i didnt added, it was already there, i just added the snipplet to try it out)

i have this

<config evaluator="aspect-name" condition="my:imageClassification">
<property-sheet>
<show-property name="my:width"/>
<show-property name="my:height"/>
<show-property name="my:resolution"
show-in-edit-mode="false"/>
</property-sheet>
</config>

on alfresco/extension i have exampleModel.xml that is the same code that the documentation explain

also i have a example-model-context.xml that have this snipplet

<bean id="extension.dictionaryBootstrap"
parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/exampleModel.xml</value>
</list>
</property>
</bean>
and on the web-client-config located on alfresco/

i have this

<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/exampleModel.xml</value>
</list>
</property>
</bean>

any comment?, Thanks

renato
Champ in-the-making
Champ in-the-making
looks like I am having the same problem.

I have followed all the instructions provided to activate the example provided with Alfresco 2.0.

Alfresco start with no errors and I am sure it loads the new example model.

If everything goes as expected, how (where in the UI) does one add the newly added aspect to a space/document? I tried run action:add aspect to item but can't find anything there.

Has anyone been able to get the example to work?

thanks

xmaniac
Champ in-the-making
Champ in-the-making
Same here. New content is loaded and Alfresco starts but I can't really find it anywhere. The complete code is very simple (I didn't want any aspect):

<?xml version="1.0" encoding="UTF-8"?>
<model name="internna:internnaModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>Extends the model to add URL support</description>
   <author>Jose Noheda</author>
   <published>2007-03-07</published>
   <version>0.1</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="internna.model" prefix="internna"/>
   </namespaces>

   <types>
      <type name="internna:urlDocument">
         <title>URLDocument</title>
         <parent>cm:content</parent>
         <properties>
            <property name="internna:URI">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </type>
   </types>
   
</model>

christophes
Champ in-the-making
Champ in-the-making
Hello,

To create new content type, you have to create or modify 3 files. Example :

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

<!– Definition of new Model –>

<!– The important part here is the name - Note: the use of the my: namespace
     which is defined further on in the document –>
<model name="compt:comptagemodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>     
   <description>Modele comptage</description>
   <author>Christophe</author>
   <version>0.1</version>

   <!– Imports are required to allow references to definitions in other models –>  
   <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 my.new.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="compt.comptage.model" prefix="compt"/>
   </namespaces>
  
   <types>
  
      <!– Definition of new Content Type: Standard Operating Procedure –>
      <type name="compt:eleve">
         <title>Comptage</title>
         <parent>cm:content</parent>
         <properties>
            <property name="compt:Nom">
               <type>d:text</type>
            </property>
            <property name="compt:Prenom">
               <type>d:text</type>
            </property>
            <property name="compt:NumNat">
               <type>d:long</type>
            </property>
            <property name="compt:DateNai">
               <type>d:date</type>
            </property>
         </properties>
      </type>
   
    </types>
  
</model>
Create (or modify) "example-model-context.xml"
<?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/comptageModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>
Modify "web-client-config-custom.xml" by adding following lines :
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="compt:eleve"/>
      </content-types>
   </config>

   <config evaluator="node-type" condition="compt:eleve">
      <property-sheet>
         <show-property name="compt:Nom" />
         <show-property name="compt:Prenom" />
         <show-property name="compt:NumNat" />
         <show-property name="compt:DateNai" />
      </property-sheet>
   </config>

   <!– Configuring of the advanced search –>
   <config evaluator="string-compare" condition="Advanced Search">
   <advanced-search>
      <content-types>
         <type name="compt:eleve" />
      </content-types>
      <custom-properties>
       <meta-data type="compt:eleve" property="compt:Nom" />
         <meta-data type="compt:eleve" property="compt:Prenom" />
         <meta-data type="compt:eleve" property="compt:NumNat" />
         <meta-data type="compt:eleve" property="compt:DateNai" />
      </custom-properties>
   </advanced-search>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <specialise-types>
         <type name="compt:eleve"/>
     </specialise-types>
   </config>

All this files must be in Alfresco\tomcat\shared\classes\alfresco\extension

I hope that will help you,

Christophe