AnsweredAssumed Answered

Creating new data types - data model

Question asked by jamen on Apr 5, 2006
Hi,

I have posted this entry before under a different topic, but figured I should have posted it under something new…

I'm currently in the process of creating a new content model with new aspects and data types. In our specification we have the need to use a List object of sorts. I was just wondering whether anyone could help me with creating a custom data type for use with a new content type.

I have checked the wiki and it doesn't go beyond using existing data types (eg. String, date, boolean, etc). There is a type based on 'd:any'/java.lang.Object. However I am not sure whether I should use this to implement a 'List' type based on a java class that implements the List or Enumeration interface.

Alternatively would I extend the existing model (dictionaryModel) and create a new type based on a List? With this in mind, I assume I would have a model file (xml) like the one below? The main part I need verification on is actually the <data-types> section I added below. I haven't seen any examples of people customising their data types in a model file before. I have only seen custom models much like what is in the wiki already.

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

<!– Definition of Model –>

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

<description>Lateral Minds Document Model</description>
<author>Jamen</author>
<version>1.0</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"/>
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>

<namespaces>
<namespace uri="example.samplemodel" prefix="sm"/>
</namespaces>

<data-types>
DATA TYPES go here
</data-types>

<types>
SOME TYPES GO HERE
</types>

<aspects>
SOME ASPECTS GO HERE
</aspects>
</model>

Thanks in advanced

Jamen

Outcomes