cancel
Showing results for 
Search instead for 
Did you mean: 

How can we get users shortcuts/favorites

fouada
Confirmed Champ
Confirmed Champ

Hi All,

Is there any way to export or get user personilizations such as shortcuts and favorites site they have chosen.
As we are moving user from one LDAP to another , so all user will be created as new therefore there is need of taking backup of personilizations made by every user.Thanks,

Fouad

1 ACCEPTED ANSWER

kaynezhang
World-Class Innovator
World-Class Innovator

I have tested in my environment(CE 5.2)  it works.

View answer in original post

6 REPLIES 6

afaust
Legendary Innovator
Legendary Innovator

In case the users will have the same user name / uid in the new LDAP as they had in the other, there actually is a way to move the users without them being created as new and which allows retaining the user preferences without an export-import step. If you have more than one LDAP configuration set up in Alfresco and active in the authentication chain, Alfresco will auto-migrate users previously synchronized from a system later in the chain to a system earlier in the chain IF the user identity matches. Once all users have been synchronized from the new system there should only be some users left that may not exist in the new system or where a rename actually occured. Only these might need manual migration - or can potentially be deleted.

Apart from that: user preferences are stored as a JSON document below the cmSmiley Tongueerson node of a user. So you can technically download the content of the preference document for each user and later restore preferences from that. There is no dedicated export function for this - normal download URLs should work if substituted with the JSON document ID fragments.

fouada
Confirmed Champ
Confirmed Champ

HI Axel,

Thanks for Your response,

Could you please explain that from where should i download the content of the preference document for each user.

Using below URL I am getting user details in json format but not getting favorites selected by them.

localhost:8080/alfresco/service/api/people/username

There is one option given in documentation of alfresco

Get a list of favorites | Alfresco Documentation

It is not much clear , can  you please help me to understand how to and where to  use it.

Thanks,

Fouad

afaust
Legendary Innovator
Legendary Innovator

The preferences of a user can be accessed via http://localhost:8080/alfresco/s/index/uri/api/people/<userId>/preferences - but this operation is restricted to only allowing the user himself to access the preferences. Not even the admin user can download other users preferences this way.

Fortunately, preference values are just node properties and can be downloaded via http://localhost:8080/alfresco/s/api/node/workspace/SpacesStore/dc103838-645f-43c1-8a2a-bc187e13c343... where the NodeRef is the reference to the cmSmiley Tongueerson node (in this case the user abeecher in my local system). You'd only have to query all cmSmiley Tongueerson nodes and construct a download URL for each user.

Please note that some users may not have any preferences, e.g. if they have never logged in at all or not set any favorites, folder sort orders...

kaynezhang
World-Class Innovator
World-Class Innovator

HI Axel,

I think preferences for a particular user can be accessed through http://localhost:8080/alfresco/s/api/people/{username}/preferences with current user or admin account.

It will return a json string of user preferences.

afaust
Legendary Innovator
Legendary Innovator

The reason I mentioned this as "not working" is because I tested just that yesterday on 5.1.g and it didn't work. Maybe there is an issue with that in my version, but as far as I recall the PreferenceService security is indeed set very tight. The other approach should always work regardless of permission issues.

kaynezhang
World-Class Innovator
World-Class Innovator

I have tested in my environment(CE 5.2)  it works.