Search in sources :

Example 1 with UsersDialog

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;
}
Also used : ServletRequest(javax.servlet.ServletRequest) ServletResponse(javax.servlet.ServletResponse) FacesContext(javax.faces.context.FacesContext) ServletContext(javax.servlet.ServletContext) AlfrescoRuntimeException(org.alfresco.error.AlfrescoRuntimeException) NavigationHandler(javax.faces.application.NavigationHandler) UsersDialog(org.alfresco.web.bean.users.UsersDialog) AlfrescoRuntimeException(org.alfresco.error.AlfrescoRuntimeException)

Aggregations

NavigationHandler (javax.faces.application.NavigationHandler)1 FacesContext (javax.faces.context.FacesContext)1 ServletContext (javax.servlet.ServletContext)1 ServletRequest (javax.servlet.ServletRequest)1 ServletResponse (javax.servlet.ServletResponse)1 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)1 UsersDialog (org.alfresco.web.bean.users.UsersDialog)1