cancel
Showing results for 
Search instead for 
Did you mean: 

Extending Alfresco Person type using custom aspects?

chrisb
Champ in-the-making
Champ in-the-making
I would like to extend the standard Alfresco Person type used for user accounts to store extra data attributes. The extra attributes stored would be determined by the business role of the user in the system.

I was thinking about approaching this by defining a custom aspect for each role. The aspect would contain the role specific data, and be applied to an alfresco user account.

When creating a new user in Alfresco, (which uses the built in Person type?), I would like to have the option to choose a role for the user and populate the role data as part of the user creation process.

I would like to add this behaviour in such a way that I avoid changing the built in Alfresco types. I suspect any customisation of built in types will cause issues with upgrades to the core Alfresco at a later stage.

I did find the following post which seems to suggest that I may have to modify some of the built in web client user creation JSP's and wizards:

http://forums.alfresco.com/viewtopic.php?t=6246&start=0&postdays=0&postorder=asc

Can anyone confirm whether this is the case?

Any advice / experience on doing this type of change would be greatly received.

Thanks for reading.
6 REPLIES 6

andy
Champ on-the-rise
Champ on-the-rise
Hi

Unfortunately this is not very well supported at the moment, and is on the list of things to improve.

You would have wire up your own version of the PersonService.

Andy

chrisb
Champ in-the-making
Champ in-the-making
Thanks Andy,

I'm actually pursuing another approach using the latest version of the Javascript API to try and create a vanilla cmSmiley Tongueerson instance using the Node creation part of the Javascript API.

I then plan to use a custom extendedPerson type that is linked to the cmSmiley Tongueerson instance via the cmSmiley Tongueerson username. I can then store extra attributes for the extendedPerson using custom aspects applied to extendedPerson.

I am not sure though if I need to extend the Javascript API to do exactly what I want (currently using some of the expanded API available in the 2.1.0 trunk).

Chris

kevinr
Star Contributor
Star Contributor
I don't think you'll be able to use even the current HEAD trunk JavaScript API to create useful people - as well as creating a cmSmiley Tongueerson node, the repository API creates objects in the userStore which the JavaScript API is currently unable to do - it will require a specific extension to the API to create users. Please raise a JIRA item for it, or contribute it back if you decide to do it yourself Smiley Happy

Thanks,

Kevin

chrisb
Champ in-the-making
Champ in-the-making
Thanks Kevin, I was afraid that might be the case  Smiley Sad

I've got some example Java code for creating new users using the Java API from support. I guess as an interim measure I'll have to try "rolling my own" Javascript API extensions backed by the Java code for creating new users.

Bottom line is I need some way of programmatically creating new users, allocating them to non default home spaces, and then creating a custom content type that references the newly created user. Oh, and I need it working in the next few days….

I think I may be straying into miracle territory here by the sounds of things - good job I like a challenge  :wink:

I'll try and put something on JIRA as soon as I get a chance.

Chris

reeva
Champ in-the-making
Champ in-the-making
Hi Chris
              I am actually having the same problem related to creation of user using alfresco api .I presume earlier you have this problem and believe you have solved it also .
could kindly share me the codes and procedure to solve this problem .
it would be really helpfull for me if you kindly reply me .

With Regards
reevz

rivarola
Champ on-the-rise
Champ on-the-rise
Hello,

I added an improvement request in JIRA on this subjet : http://issues.alfresco.com/browse/AWC-1665

You can vote for it if you want.