Search in sources :

Example 1 with SMDiscoveryServiceModel

use of com.sun.identity.console.service.model.SMDiscoveryServiceModel in project OpenAM by OpenRock.

the class SMDiscoveryServiceViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    resetButtonState(TBL_BOOTSTRAP_RES_OFF_DELETE_BTN);
    resetButtonState(TBL_PROVIDER_RESOURCEID_MAPPER_DELETE_BTN);
    if (!tablePopulated) {
        if (!isSubmitCycle()) {
            SMDiscoveryServiceModel model = (SMDiscoveryServiceModel) getModel();
            if (model != null) {
                populateProviderResourceIdMapperTable(model.getProviderResourceIdMapper());
                Set resoff = new OrderedSet();
                resoff.addAll(model.getDiscoEntry(false));
                populateBootstrapResOffTable(resoff);
            }
        }
    }
    if (!isInlineAlertMessageSet()) {
        String flag = (String) getPageSessionAttribute(PAGE_MODIFIED);
        if ((flag != null) && flag.equals("1")) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.profile.modified");
        }
    }
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) SMDiscoveryServiceModel(com.sun.identity.console.service.model.SMDiscoveryServiceModel)

Example 2 with SMDiscoveryServiceModel

use of com.sun.identity.console.service.model.SMDiscoveryServiceModel 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)2 UMUserResourceOfferingViewBean (com.sun.identity.console.user.UMUserResourceOfferingViewBean)1 AMIdentity (com.sun.identity.idm.AMIdentity)1 IdRepoException (com.sun.identity.idm.IdRepoException)1 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)1 Set (java.util.Set)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1