cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] Pop-up menu

rookie
Champ in-the-making
Champ in-the-making
Good morning everyone!

I am new on Alfresco!
I added some new fields in the properties of a document, such as reference of the doc or type of documents. To do so, I edited the files web-client-config-custom.xml and contentModel.xml. I can see them when I add a file, everything works correctly!

My problem is the following one : for the type of documents, I want to create a pop-up menu with a list of default values ("Excel", "Word", "JPEG", etc) to give to possibility to the user to choose one when he adds a new document. I'm sure that this is possible but I do not know how to do it.

Someone could advise me on that detail?

Thanks a lot!
3 REPLIES 3

tonyc
Champ in-the-making
Champ in-the-making
If you are using alfresco explorer, there is already this option available to you.  The mimetype property lets you set what kind of file it is,  when uploading a file you should see a "Content Type:" drop down box which has just about every option you would want.  If there was a type that is not in the default mimetypes you can extend that as well… http://wiki.alfresco.com/wiki/Adding_a_Mime_Type

If you didn't want to use the default mimetype property for these purposes, I would say that you would want to have a look at http://wiki.alfresco.com/wiki/Constraints and create a list of constraints for your custom type property values.

rookie
Champ in-the-making
Champ in-the-making
Thanks for your help tonyc.

Actually, I had a look at the list of contraints and added some into the file contentModel.xml. I did it as followed :

      <type name="cm:content">
         <title>Content</title>
         <parent>cm:cmobject</parent>
         <archive>true</archive>
         <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>
         <!— Added fields –>
         <property name="cm:deliveryDate">
               <type>d:date</type>
            </property>
         <property name="cm:docType">
               <type>d:text</type>
            <constraints>
                 <constraint type="LIST">
                    <parameter name="allowedValues">
                  <list>
                     <value>My first value haha</value>
                     <value>My second value hehe</value>
                  </list>
               </parameter>
                 </constraint>
              </constraints>
            </property>
         </properties>
       <mandatory-aspects>
                  <aspect>cm:versionable</aspect>
         </mandatory-aspects>
      </type>

Not so easy to guess when you're a newbie to Alfresco :s.
Hope this will help someone someday!
I put this post as solved!

Rookie

tonyc
Champ in-the-making
Champ in-the-making
I'm glad I could help,  let me make another suggestion… It is generally not a good idea to modify the contentModel.xml directly.   Instead you should consider writing your own content model.  Have a look at http://wiki.alfresco.com/wiki/Step-By-Step:_Creating_A_Custom_Model