cancel
Showing results for 
Search instead for 
Did you mean: 

add mandatory metadata

asoph
Champ in-the-making
Champ in-the-making
Hello

I'm new on Alfresco and I have a pretty hard time to find my marks in it (even if it seems that pretty cool stuffs can be done).

I would like to add mandatory metadata when a document is uploaded. What is the best (and easiest) way to do it?
I think a possible alternative could be to create a new content type and attach mandatory properties to it. But that solution doesn't seem very easy…

How can I solve this problem???

Thank you very much for helping me!!

Anne-Sophie
2 REPLIES 2

fchevance
Champ in-the-making
Champ in-the-making
Hello,

you're right, there are 2 things you have to do:

1 - extend the data model and define some custom mandatory properties

(see http://wiki.alfresco.com/wiki/Data_Dictionary_Guide)

Example exampleModel.xml :



<type name="my:custom_type">
<title>EP Modi Concrete Document</title>
<parent>cm:content</parent>
<properties>
    <property name="my:property1">
       <title>Custom property 1</title>
       <type>d:text</type>
       <mandatory>true</mandatory>
       <multiple>false</multiple>
    </property>
</type>



2 - configure the web client to see the result
(see http://wiki.alfresco.com/wiki/Web_Client_Configuration_Guide)

Example web-client-config-custom.xml :



<config evaluator="string-compare" condition="Content Wizards">
  <!– The list of custom content types to show in the content wizards –>
  <content-types>
    <type name="my:custom_type" />
  </content-types>

  <!– Controls the message regarding property editing after the content is created –>
  <other-properties user-choice-visible="true" user-choice-default="true" />
</config>

<config evaluator="node-type" condition="my:custom_type">
  <property-sheet>
    <show-property name="name" show-in-edit-mode="true" />
    <show-property name="mimetype" display-label-id="content_type" component-generator="MimeTypeSelectorGenerator" />
    <show-property name="title" show-in-edit-mode="true" />
    <show-property name="description" show-in-edit-mode="true" />
    <show-property name="size" display-label-id="size" converter="org.alfresco.faces.ByteSizeConverter" show-in-edit-mode="false" />
    <show-property name="my:custom_type" />
  </property-sheet>
</config>


Hope this helps.

Fred

asoph
Champ in-the-making
Champ in-the-making
Thank you!!! I was looking for an easier way but I guess that's the solution.
I'm going to try and hopefully that will work  Smiley Very Happy