Search in sources :

Example 1 with UMUserResourceOfferingViewBean

use of com.sun.identity.console.user.UMUserResourceOfferingViewBean in project OpenAM by OpenRock.

the class SMDiscoveryServiceViewBean method handleUserOperationRequest.

private void handleUserOperationRequest(String realm, String univId, RequestContext rc) {
    HttpServletRequest req = rc.getRequest();
    SMDiscoveryServiceModel model = (SMDiscoveryServiceModel) getModel();
    try {
        AMIdentity amid = IdUtils.getIdentity(model.getUserSSOToken(), univId);
        if (amid.getType().getName().equalsIgnoreCase("user")) {
            UMUserResourceOfferingViewBean vb = (UMUserResourceOfferingViewBean) getViewBean(UMUserResourceOfferingViewBean.class);
            vb.unlockPageTrail();
            vb.setPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID, univId);
            vb.setPageSessionAttribute(EntityEditViewBean.ENTITY_TYPE, "user");
            vb.setPageSessionAttribute(UMUserResourceOfferingViewBean.SERVICE_NAME, AMAdminConstants.DISCOVERY_SERVICE);
            vb.setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, req.getParameter("realm"));
            vb.setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
            vb.forwardTo(rc);
        } else {
            handleEntityOperationRequest(req.getParameter("realm"), univId, rc);
        }
    } catch (IdRepoException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
        super.forwardTo(rc);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) SMDiscoveryServiceModel(com.sun.identity.console.service.model.SMDiscoveryServiceModel) AMIdentity(com.sun.identity.idm.AMIdentity) UMUserResourceOfferingViewBean(com.sun.identity.console.user.UMUserResourceOfferingViewBean) IdRepoException(com.sun.identity.idm.IdRepoException)

Aggregations

SMDiscoveryServiceModel (com.sun.identity.console.service.model.SMDiscoveryServiceModel)1 UMUserResourceOfferingViewBean (com.sun.identity.console.user.UMUserResourceOfferingViewBean)1 AMIdentity (com.sun.identity.idm.AMIdentity)1 IdRepoException (com.sun.identity.idm.IdRepoException)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1