cancel
Showing results for 
Search instead for 
Did you mean: 

Wheres the new Content Type ?

paulkeogh
Champ in-the-making
Champ in-the-making
Following the data dictionary guide, I added the following model;

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

   <description>Mobile Content Model</description>
   <author>Paul Keogh</author>
   <published>2005-09-26</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="http://www.alfresco.org/model/mobilecontent/1.0" prefix="mc"/>
   </namespaces>

   <types>
      <type name="mc:ringtone">
         <title>Ringtone</title>
         <parent>cm:cmobject</parent>
         <properties>
            <property name="mc:ringtoneType">
               <type>d:text</type>
            </property>
         </properties>
      </type>
   </types>

       ….

This was loaded up correctly (I think - how do I verify that?)

I then attempted to edit web-client-config.xml by adding;

   <!–  Mobile content additions –>
  
   <config evaluator="node-type" condition="ringtone">
      <property-sheet>
         <show-property name="name" displayLabel="File Name" />
         <show-property name="mimetype" displayLabel="Content Type" converter="org.alfresco.faces.MimeTypeConverter" />
         <show-property name="title" displayLabel="Title" />
         <show-property name="description" displayLabel="Description" />
         <show-property name="size" displayLabel="Size" converter="org.alfresco.faces.ByteSizeConverter" />
         <show-property name="creator" displayLabel="Author" />
      </property-sheet>
   </config>

I cannot find an explanation of the relationship between this piece of XML and the XML in my new content model. Any pointers ?

Also, when I add a new Content Type, where exactly in the web client should I see it ?
2 REPLIES 2

davidc
Star Contributor
Star Contributor
The two pieces of xml are related by the type / aspect name.  The web-client-config.xml definition should be modified slightly:

condition="ringtone" should be condition="mc:ringtone"

You can also add:

<show-property name="mc:ringtoneType" displayLabel="Type"/>

if you want to show the extra property defined in your type.

Unfortunately, you're not going to see your new type in the UI as the current builds do not provide a way of constructing a custom content type via the UI. This will be available soon.  However, the current builds do allow you to see custom aspects by following the web client configuration that's referred to in the data dictionary guide.

Btw, if there's an error in your model definition, the server will not start as it will report the issue in the model file.  In the future, we'll provide admin (and maybe user) tools for viewing & manipulating model definitions.

Also, in your model, you should choose a namespace uri that doesn't start with http://www.alfresco.org as this could conflict with a future model of ours.

paulkeogh
Champ in-the-making
Champ in-the-making
The two pieces of xml are related by the type / aspect name.  The web-client-config.xml definition should be modified slightly:

condition="ringtone" should be condition="mc:ringtone"

OK. So the namespace is needed as a prefix. I noticed that the content
definition is simply condition="content" - does this mean the cm namespace is a default ?

You can also add:

<show-property name="mc:ringtoneType" displayLabel="Type"/>

if you want to show the extra property defined in your type.

Unfortunately, you're not going to see your new type in the UI as the current builds do not provide a way of constructing a custom content type via the UI. This will be available soon.  However, the current builds do allow you to see custom aspects by following the web client configuration that's referred to in the data dictionary guide.

OK, I don't need UI construction. I do need to be able to upload a file and tag it as a ringtone - how do I get a new entry into the dropdown listbox of types ?

Also, in your model, you should choose a namespace uri that doesn't start with http://www.alfresco.org as this could conflict with a future model of ours.

Yes, will do. Thanks for your answers.