You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package org.gcube.portal.usersaccount ;
import org.gcube.portal.notifications.thread.NewUserAccountNotificationThread ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
import com.liferay.portal.ModelListenerException ;
import com.liferay.portal.model.BaseModelListener ;
import com.liferay.portal.model.User ;
/**
*
* @author Massimiliano Assante, CNR-ISTI
*
* Model Listeners are used to listen for events on models and do something in response.
* They’ re similar in concept to custom action hooks, which perform actions in response to portal events (user login, for example).
* Model listeners implement the ModelListener interface.
*
* @see https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/creating-model-listeners
*/
public class MyCreateUserAccountListener extends BaseModelListener < User > {
private static final Logger _log = LoggerFactory . getLogger ( MyCreateUserAccountListener . class ) ;
final String SUBJECT = "New user account notification" ;
@Override
public void onAfterCreate ( User user ) throws ModelListenerException {
_log . info ( "onAfterCreate NewUserAccount listener for: " + user . getScreenName ( ) + " / " + user . getFullName ( ) ) ;
Thread emailManagersThread = new Thread ( new NewUserAccountNotificationThread ( user . getScreenName ( ) , user . getFullName ( ) , user . getEmailAddress ( ) ) ) ;
emailManagersThread . start ( ) ;
Thread WorkspaceAccountCreationThread = new Thread ( new WorkspaceCreateAccountThread ( user . getScreenName ( ) , user . getFullName ( ) , user . getEmailAddress ( ) ) ) ;
WorkspaceAccountCreationThread . start ( ) ;
}
}