cancel
Showing results for 
Search instead for 
Did you mean: 

Get user from FSR prepare callback

wchen1
Champ in-the-making
Champ in-the-making
We have created code for prepare callback hook for fsr deployment to create some metadata file for our application. However we have new requirement that needs to get loggged in user id, user name, and current live snapshot id, and new snapshot id to be deployed in prepare callback function. I found serviceRegistry seems to be right one to retrieve those data, but prepare callback can not access it. Do you know how to retrieve these repository data from fsr prepare callback hook?

We are using enterprise 3.1 version.

Thanks!
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
The user is not available since deployment authenticates with a proxy account which is configured through the web project configuration.

You can get both snapshot IDs with some code on your behalf, I don't have the code in front of me but that is possible.

wchen1
Champ in-the-making
Champ in-the-making
Thanks for quick response. This confirms my assumption that I can not get user data from deployment callback. How about doing this in web client side? Is there any hook on deploy button in Alfresco web client side? So when user clicks deploy button to deploy to live FSR, I can put logic there to get user data.

Thanks!

mrogers
Star Contributor
Star Contributor
I think your best bet would be to decorate the deployment service with something that hooks in your code then delegates back to the real deployment service.    

In addition you should probably also contact Alfresco support with your requirements since this is something that I've thought might be useful but has never made the priority list.