cancel
Showing results for 
Search instead for 
Did you mean: 

Constaints on association? Override cm:contains association?

jey
Champ in-the-making
Champ in-the-making
Hi,

Here is my problem:
I have define two sub-type of folder: client and project.
And I want a "client" space to contain ONLY "project" spaces…

Is it possible ? I really need this constraint, I want to prevent it containing anything else.

I am wondering if I can override the definition of the child-association cm:contains of a folder in my own type definition.

A folder is define like this:
<type name="cm:folder">
         <title>Folder</title>
         <parent>cm:cmobject</parent>
         <archive>true</archive>
         <associations>
            <child-association name="cm:contains">
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>sys:base</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
               <duplicate>false</duplicate>
            </child-association>
         </associations>
      </type>

And I would like my "client" folder to contain "project" in stead of sys:base which is the parent cm:cmobject, which is the parent of folder, content, …

For example:
WARNING this is only what i EXPECT… this code doesn't work Smiley Very Happy
<type name="customSmiley TonguerojectSpace">
         <title>ProjectSpace</title>
         <parent>cm:folder</parent>
         <properties>
            <property name="customSmiley Frustratedolution">
               <type>d:text</type>
               <constraints>
                  <constraint type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>Alfresco</value>
                           <value>Documentum</value>
                        </list>
                     </parameter>
                     <parameter name="caseSensitive">
                        <value>true</value>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
         </properties>
         <associations>
            <association name="customSmiley TongueM">
               <target>
                  <class>cmSmiley Tongueerson</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
         </associations>
      </type>
    
     </type>
      <type name="custom:clientSpace">
      <title>ClientsSpace</title>
      <parent>cm:folder</parent>
      <associations>
         <child-association name="cm:contains">
            <source>
              <mandatory>false</mandatory>
              <many>true</many>
            </source>
            <target>
              <class>customSmiley TonguerojectSpace</class>
              <mandatory>false</mandatory>
              <many>true</many>
            </target>
            <duplicate>false</duplicate>
         </child-association>

       </associations>
   </type>

Is it possible to do something like this ?
Any idea of the direction I should look ???

For the moment I have set up a rule calling a custom action, on the addition of content to a client, which delete the added content if is type not "project" …
But this solution brings many trouble with webdav, cifs, and even web interface beacause it can't edit the property of a file that doesn't exist after the addition 😞

All suggestion are welcom :-).

Thanks!

PS: sorry for indentation, it is correct in edition mod but it doesn't work in viewing… 😞
2 REPLIES 2

derek
Star Contributor
Star Contributor
Hi,

I'm afraid that we don't have the notion of overriding associations.  The other problem is, as you have discovered, that clients like CIFS, FTP and WebDAV don't have the ability to choose a type of folder or file to create.

We do, however, have a specialization action.  Instead of deleting instances that aren't of the correct type within your projects folder, just change their type to be your specific subtype.

Regards

jey
Champ in-the-making
Champ in-the-making
Thanks for your reply …

I have already think about your proposition of specialization, but indeed I don't want only to specialize content, but I want to also apply a template …

And if a user copy/paste an existing folder through webdav, if I build an action that apply the needed template (implementation of my custom type), what does the existing files and sub-folders become ???

Well this is a design problem … So I won't bore you with this ! Smiley Very Happy

But this could have been a solution … I will look forward an other solution…