Search in sources :

Example 1 with RealmResourceOfferingModel

use of com.sun.identity.console.realm.model.RealmResourceOfferingModel in project OpenAM by OpenRock.

the class RealmResourceOfferingEditViewBean method handleButton1Request.

protected void handleButton1Request(SMDiscoEntryData smData) throws AMConsoleException {
    RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
    RealmResourceOfferingViewBean vb = (RealmResourceOfferingViewBean) getViewBean(RealmResourceOfferingViewBean.class);
    DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
    String cacheID = (String) getPageSessionAttribute(RealmResourceOfferingViewBean.DATA_ID);
    SMDiscoveryServiceData smEntry = cache.getData(model.getUserSSOToken(), cacheID);
    int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    smEntry.replaceResourceData(index, smData);
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    try {
        model.setRealmDiscoEntry(realm, smEntry);
        removePageSessionAttribute(RealmResourceOfferingViewBean.DATA_ID);
        removePageSessionAttribute(PGATTR_INDEX);
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : SMDiscoveryServiceData(com.sun.identity.console.service.model.SMDiscoveryServiceData) RealmResourceOfferingModel(com.sun.identity.console.realm.model.RealmResourceOfferingModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) DiscoveryDataCache(com.sun.identity.console.service.model.DiscoveryDataCache)

Example 2 with RealmResourceOfferingModel

use of com.sun.identity.console.realm.model.RealmResourceOfferingModel in project OpenAM by OpenRock.

the class RealmResourceOfferingAddViewBean method handleButton1Request.

protected void handleButton1Request(SMDiscoEntryData smData) {
    RealmResourceOfferingViewBean vb = (RealmResourceOfferingViewBean) getViewBean(RealmResourceOfferingViewBean.class);
    RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
    DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
    String cacheID = (String) getPageSessionAttribute(RealmResourceOfferingViewBean.DATA_ID);
    SMDiscoveryServiceData data = (SMDiscoveryServiceData) cache.getData(model.getUserSSOToken(), cacheID);
    data.addResourceData(smData);
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    try {
        model.setRealmDiscoEntry(realm, data);
        removePageSessionAttribute(RealmResourceOfferingViewBean.DATA_ID);
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : SMDiscoveryServiceData(com.sun.identity.console.service.model.SMDiscoveryServiceData) RealmResourceOfferingModel(com.sun.identity.console.realm.model.RealmResourceOfferingModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) DiscoveryDataCache(com.sun.identity.console.service.model.DiscoveryDataCache)

Example 3 with RealmResourceOfferingModel

use of com.sun.identity.console.realm.model.RealmResourceOfferingModel in project OpenAM by OpenRock.

the class RealmResourceOfferingViewBean method getBreadCrumbDisplayName.

protected String getBreadCrumbDisplayName() {
    RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
    String[] arg = { model.getLocalizedServiceName(AMAdminConstants.DISCOVERY_SERVICE) };
    return MessageFormat.format(model.getLocalizedString("breadcrumbs.realm.services.editService"), arg);
}
Also used : RealmResourceOfferingModel(com.sun.identity.console.realm.model.RealmResourceOfferingModel)

Example 4 with RealmResourceOfferingModel

use of com.sun.identity.console.realm.model.RealmResourceOfferingModel in project OpenAM by OpenRock.

the class SMDiscoveryServiceViewBean method handleRealmOperationRequest.

private void handleRealmOperationRequest(String realm, RequestContext rc) {
    HttpServletRequest req = rc.getRequest();
    String op = req.getParameter("Op");
    if (op.equals(AMAdminConstants.OPERATION_EDIT)) {
        setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
        setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
        unlockPageTrail();
        RealmResourceOfferingViewBean vb = (RealmResourceOfferingViewBean) getViewBean(RealmResourceOfferingViewBean.class);
        passPgSessionMap(vb);
        vb.forwardTo(rc);
    } else {
        setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
        setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
        RealmResourceOfferingModel realmModel = new RealmResourceOfferingModelImpl(req, getPageSessionAttributes());
        try {
            realmModel.assignService(realm);
        } catch (AMConsoleException e) {
            debug.error("SMDiscoveryServiceViewBean.handleRealmOperationRequest", e);
        }
        backTrail();
        AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
        passPgSessionMap(vb);
        vb.setTargetViewBeanURL("../realm/Services");
        vb.forwardTo(rc);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) RealmResourceOfferingViewBean(com.sun.identity.console.realm.RealmResourceOfferingViewBean) RealmResourceOfferingModel(com.sun.identity.console.realm.model.RealmResourceOfferingModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) RealmResourceOfferingModelImpl(com.sun.identity.console.realm.model.RealmResourceOfferingModelImpl) AMPostViewBean(com.sun.identity.console.base.AMPostViewBean)

Example 5 with RealmResourceOfferingModel

use of com.sun.identity.console.realm.model.RealmResourceOfferingModel in project OpenAM by OpenRock.

the class RealmResourceOfferingViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
    ptModel.setPageTitleText("title.realm.resource.offering");
    try {
        populateTableModel(model.getRealmDiscoEntry(realm));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : RealmResourceOfferingModel(com.sun.identity.console.realm.model.RealmResourceOfferingModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Aggregations

RealmResourceOfferingModel (com.sun.identity.console.realm.model.RealmResourceOfferingModel)7 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)5 DiscoveryDataCache (com.sun.identity.console.service.model.DiscoveryDataCache)4 SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)3 AMPostViewBean (com.sun.identity.console.base.AMPostViewBean)1 RealmResourceOfferingViewBean (com.sun.identity.console.realm.RealmResourceOfferingViewBean)1 RealmResourceOfferingModelImpl (com.sun.identity.console.realm.model.RealmResourceOfferingModelImpl)1 SMDiscoEntryData (com.sun.identity.console.service.model.SMDiscoEntryData)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1 Iterator (java.util.Iterator)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1