use of org.alfresco.web.bean.users.UsersDialog in project acs-community-packaging by Alfresco.
the class UserProfileDialogCommand method execute.
/**
* @see org.alfresco.web.app.servlet.command.Command#execute(org.alfresco.service.ServiceRegistry, java.util.Map)
*/
public Object execute(ServiceRegistry serviceRegistry, Map<String, Object> properties) {
ServletContext sc = (ServletContext) properties.get(PROP_SERVLETCONTEXT);
ServletRequest req = (ServletRequest) properties.get(PROP_REQUEST);
ServletResponse res = (ServletResponse) properties.get(PROP_RESPONSE);
FacesContext fc = FacesHelper.getFacesContext(req, res, sc, "/jsp/close.jsp");
UsersDialog dialog = (UsersDialog) FacesHelper.getManagedBean(fc, UsersDialog.BEAN_NAME);
// setup dialog context from url args in properties map
String personId = (String) properties.get(PROP_PERSONID);
ParameterCheck.mandatoryString(PROP_PERSONID, personId);
dialog.setupUserAction(personId);
NavigationHandler navigationHandler = fc.getApplication().getNavigationHandler();
navigationHandler.handleNavigation(fc, null, "dialog:userProfile");
String viewId = fc.getViewRoot().getViewId();
try {
sc.getRequestDispatcher(BaseServlet.FACES_SERVLET + viewId).forward(req, res);
} catch (Exception e) {
throw new AlfrescoRuntimeException("Unable to forward to viewId: " + viewId, e);
}
return null;
}
Aggregations