cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Type - Properties Cardinality

woody
Champ in-the-making
Champ in-the-making
Is there a way to add, in a custom type definition, a properties that can be repeted N times.

For example, in my case I've to insert the possibility to add more then 1 phone number, composed as 2 properties (prefix and number). How can I define that in my customModel.xml ?

Here my code

   <type name="my:worker">
         <title>Worker</title>
         <parent>cm:content</parent>
         <properties>
             […]
            <property name="my:prefix">
                  <type>d:text</type>
            </property>
            <property name="my:number">
               <type>d:text</type>
            </property>
            […]

How can I repeat the 2 properties prefix and number N times? And how it is rendered within Share form Engine?

Sorry for the easy question, but I cannot find a solution to that…
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
At the moment the simple and stupid way to model it would be to have two named properties
e.g.  prefix1, number1, prefix2, number2.

Or alternativly you could model the number/prefix thing as its own type and associate my:worker with N number/prefix nodes.

Or you could add a new data type for a number/prefix thing.

woody
Champ in-the-making
Champ in-the-making
At the moment the simple and stupid way to model it would be to have two named properties
e.g.  prefix1, number1, prefix2, number2.

Or alternativly you could model the number/prefix thing as its own type and associate my:worker with N number/prefix nodes.

Or you could add a new data type for a number/prefix thing.


Option 1 is what I've now. The problems with this solution are:
- No dynamic cardinality.
- All fields are rendered by form engine.

Option 2 seems quite complex for the usability. Users must add the phone number as a new content and associate that with the "Worker" content, using the picker (association.ftl control).

I don't understand the option number 3. is not the same as option 2? Adding a data type for that means using an association. Right?

No other solutions?

Seems a big limitation to alfresco content model…

woody
Champ in-the-making
Champ in-the-making
The problem rise again.

Now my client want to add to the "Commercial Entity" Custom Type a dynamic number of contacts, composed by "Name" and "Phone".

It's the same problem as before. What's the better way to manage that in Alfresco+Share? I really don't understand that…