cancel
Showing results for 
Search instead for 
Did you mean: 

Adding custom properties to system objects

schipmolder
Champ on-the-rise
Champ on-the-rise
Hi all,

Does anybody know if it's possible to add custom properties to system objects?
For example, if I'd like to add a property to a normal user, let's say a boolean 'receivedWelcomePack'?
Or to add properties to the existing st:site object (we're multi-tenant).

With repository objects we'd just add a custom model with a 'subclassed' object, e.g. my:file or my:folder, but I do not see how I can do this with objects that are created and managed by the system like users and sites.

Does anybody have any experience with this?

Thanks
1 ACCEPTED ANSWER

douglascrp
World-Class Innovator
World-Class Innovator
Hello.
So, based on the project I shared with you, you don´t actually use scpSmiley Tongueerson instead of cmSmiley Tongueerson.
If you check the xml model file carefully, you will see it's an aspect, and not a type.
In cases like this, you can write a behaviour to automaticaly attach the aspect to the person object, or you can create a folder rule and have it attaching the aspect for you.
By using aspects, you can add fields dinamicaly to any object.

View answer in original post

7 REPLIES 7

douglascrp
World-Class Innovator
World-Class Innovator
Hello.

You can find a good sample on how to do what you want on this project https://github.com/sujaypillai/someco-people

Thanks Douglas, I see how you define the scp model with the shirt size property for scpSmiley Tongueerson but what I don't understand is how this tells Alfresco to use scpSmiley Tongueerson instead of cmSmiley Tongueerson objects.
If Alfresco still uses cmSmiley Tongueerson types surely it won't know about the shirt size property or am I missing something here?

douglascrp
World-Class Innovator
World-Class Innovator
Hello.
So, based on the project I shared with you, you don´t actually use scpSmiley Tongueerson instead of cmSmiley Tongueerson.
If you check the xml model file carefully, you will see it's an aspect, and not a type.
In cases like this, you can write a behaviour to automaticaly attach the aspect to the person object, or you can create a folder rule and have it attaching the aspect for you.
By using aspects, you can add fields dinamicaly to any object.

Sorry for the late reply Douglas, the forum had been down for a while so i couldn't reply earlier.

I had not realised that these were aspects but that makes complete sense now, thanks a lot.

schipmolder _​ - When you say the forum was down, did you mean recently? We moved the forums a couple weeks ago, but this site shouldn't have had any issues! Can you let me know when you ran into trouble?

Hi Kirsten, Sorry, I meant during the migration that took a while.

I hadn't seen that the migration had completed until recently.

So, no it's not been down since the migration as far as I'm aware.

Whew. Just checking. Migration did take a good deal longer than we expected. Glad to see you in the new space!