SlingshotUserFactory cannot be resolved

cancel
Showing results for 
Search instead for 
Did you mean: 
workingpistachi
Member II

SlingshotUserFactory cannot be resolved

I am following Jeff Potts example of adding an aspect to the person object and following his tutorial https://ecmarchitect.com/archives/2012/02/27/1555.

However, looks like in Alfresco 5.0 onwards, the java classes are stored in jar files and these classes are not visible in Eclipse. Which jar file should I include to be able to import org.alfresco.web.site.SlingshotUserFactory?

3 Replies
afaust
Master

Re: SlingshotUserFactory cannot be resolved

Ideally, you should not (have to) use this old approach to extend user profile data. Using Surf Extension Modules and customisations to web script controllers / templates, you can enhance the profile page for view / edit mode without having to touch the SlingshotUserFactory. You'd only have to customise the userprofile.get and userprofile.post web scripts to load your additional profile properties, render the display / form markup, and then handle the form submission for storing the user submitted data. At least that is the way I recently went about it for one of my more "legacy" customers who is still on Alfresco 5.1.

But to the actual question: If you are using Maven, you can add the org.alfresco:share:classes:jar as a dependency in your project and should get the SlingshotUserFactory from that.

workingpistachi
Member II

Re: SlingshotUserFactory cannot be resolved

Thanks for your reply Axel.

We are trying to display a 'Password Expired' message when the password expires in AD (Alfresco is synchronized to AD). In order to achieve that, we are following the below steps:

1. Create an aspect on the person object.

2. Read the pwdLastSet property from AD

3. Store the pwdLastSet value to the aspect

4. Amend share to read the aspect value and display relevant message on login screen.

We were following the JeffPotts tutorial to add an aspect.

Could you please provide more details or example of using Surf Extension Modules and customisations to web script controllers for the person object.

afaust
Master

Re: SlingshotUserFactory cannot be resolved

See Surf Extension modules in the documentation which includes links to specific examples provided in previous blog posts.