Call a webscript within an Evaluator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2012 09:53 AM
I need to call a custom web script from my evaluator (java).
I'm having some problems with authentication (calling a URL directly from Java). I tried with /alfresco/service, /alfresco/wcservice and /share/proxy/alfresco.
Have someone done this before or have an idea on how to do it?
Many thanks
R
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2012 11:45 AM
Then call:
Connector connector = context.getServiceRegistry().getConnectorService().getConnector("alfresco", userName, ServletUtil.getSession());
Response res = connector.call("<some-url>");
I'm assuming that you want to make a request to a WebScript on the repository?
Regards,
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 07:22 AM
I tried your suggestion (and also extending ServiceBasedEvaluator which basically calls the same) but I'm getting:
Web Script Status 500 - Internal Error
09050456 Access Denied. You do not have the appropriate permissions to perform this operation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 08:16 AM
What WebScript are you calling and does the user you've logged in with have the authority to call the WebScript. Has the user actually been through an authentication step before the evaluator is called?
Regards,
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 08:24 AM
This is the flow:
The user login to share –> when he navigates the document library a custom evaluator is fired –> this evaluator calls a custom webscript (this webscript only check if a user belongs to a particular group).
What am I missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 08:36 AM
Regards,
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 09:08 AM
Can you please anticipate me how to get it working?
Many thanks,
Rocco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 09:20 AM
/api/people/<user-name>?groups=true
This seems to be working fine. You can try it out by calling http://<share-server>:<share-port>/share/proxy/alfresco/api/people/<user-name>?groups=true (you need to have logged into Share before of course) to see how the membership information is returned. Why not try with that one rather than writing your own?
Regards,
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 09:36 AM

I tried but is not working either. The thing is that inside the evaluator I'm manually calling a java URL pointing to this webscript but I get the same 401 error for authentication.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2012 09:39 AM
Regards,
Dave
