cancel
Showing results for 
Search instead for 
Did you mean: 

I want to add an aspect to an item twice... or more

tico
Champ in-the-making
Champ in-the-making
Hello you all !!

I have to manage contract along associated documents. Thus I have created spaces for each contract project. Project are discussed with partners I have create a Custom Aspect:


<!– Partners Custom aspect –>
     <aspect name="custom:Partner">
        <title>Partenaire</title>
        <properties>

             <property name="custom:PartName">
                  <title>Nom</title>
                  <type>d:text</type>
             </property>

             <property name="custom:PartContact">
                  <title>Contact</title>
                  <type>d:text</type>
             </property>

             <property name="custom:ContactMail">
                  <title>Courrier électronique</title>
                  <type>d:text</type>
             </property>

             <property name="custom:ContactPh*ne">
                  <title>Téléph*ne</title>
                  <type>d:text</type>
             </property>

        </properties>
     </aspect>

Everything went smoothly… I am able to add my custom aspect to my spaces…

the problem is the following. Time to time, project are discussed with more than one partner. If I try to add a custom aspect already present in the space's properties, nothing happens.

Is there any way to have more than once a Custom Aspect available in the item's properties ?

Thanks & regards,

Eric.
8 REPLIES 8

kevinr
Star Contributor
Star Contributor
An aspect can only be added once to a node. However, you can have multi-value properties on the aspect itself - maybe that will do what you want?

Thanks,

Kevin

tico
Champ in-the-making
Champ in-the-making
Thanks Kevin for the quick reply.

Any idea where to find documentation on custom aspect definition and usage ?

Thanks & regards,

Eric.

rbelisle
Champ in-the-making
Champ in-the-making
You can find all of the information on creating and implementing new aspects here:

http://wiki.alfresco.com/wiki/Data_Dictionary_Guide

tico
Champ in-the-making
Champ in-the-making
Thanks, I'll have a look

tico
Champ in-the-making
Champ in-the-making
Hello you all,

multi-value properties are not an answer to my issue. What I'd like to have is an entity partner{name, email, tel}, and able to "associate" more than one partner to a content or a space. Any idea how to proceed ?

Many thanks & regards,

Eric.

gavinc
Champ in-the-making
Champ in-the-making
In that case you need to model your 'partner' entity as a type not an aspect.

Once you have done this you can then define an association to your type. You can add as many associations as you like. The data dictionary guide should also cover this: http://wiki.alfresco.com/wiki/Data_Dictionary_Guide

tico
Champ in-the-making
Champ in-the-making
Thanks Gavin,

I anderstood Custom content types and associations are only applicable to content (meaning for me files).

I tried to create a type inheriting from aspect… that didnt do the trick…

Please what are the possible value for the <parent> element in a content type ?

Please what are the possible value for association/target/class in associations of a content type ?

Thanks & Regards,

Eric.

tico
Champ in-the-making
Champ in-the-making
Sorry for my previous post, I was completly wrong…. I paid attention to various doc, and I found a very nice sample @ http://forge.alfresco.com/frs/?group_id=49&release_id=90.
Take a look at the voteWF sample.

Here is what I implemented:

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

     <author>Eric GRAMMATICO</author>
     <published>2007-03-28 10:00</published>
     <version>1.0</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="sc.model.content.1.0" prefix="sc"/>
        </namespaces>

    <aspects>
      <!– Definition of new Content Aspect: votable –>
      <aspect name="sc:partenaires">
        <title>Partenaires</title>

        <associations>
            <association name="sc:firstGroup">
                <title>First group</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>

            <association name="sc:secondGroup">
                <title>Second group</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>

        </associations>
      </aspect>
   </aspects>

</model>

And that replies to my needs…

From there I am able to associate two groups of partners to a space.

Now I'd like to extend the cmSmiley Tongueerson type. The goal is to import users from ldap with phone numbers and others properties. My questions:
If I extend cmSmiley Tongueerson from contentModel.xml, will I be able to map the new properties in the ldap-authentication-context.xml  ?
Next, I'd like to display new field properties in the users manager, what should be done ?

Thanks and regards.

Eric.
Thanks you all !!

Eric.