Search in sources :

Example 26 with SMDiscoEntryData

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

the class RealmResourceOfferingViewBean method populateTableModel.

private void populateTableModel(SMDiscoveryServiceData data) {
    tblModel.clearAll();
    if (data != null) {
        int counter = 0;
        RealmResourceOfferingModel model = (RealmResourceOfferingModel) getModel();
        for (Iterator i = data.getResourceData().iterator(); i.hasNext(); counter++) {
            if (counter > 0) {
                tblModel.appendRow();
            }
            SMDiscoEntryData entry = (SMDiscoEntryData) i.next();
            tblModel.setValue(TBL_DATA_SERVICE_TYPE, entry.serviceType);
            tblModel.setValue(TBL_DATA_ABSTRACT, entry.abstractValue);
            tblModel.setValue(TBL_DATA_ACTION_HREF, Integer.toString(counter));
        }
        DiscoveryDataCache cache = DiscoveryDataCache.getInstance();
        String id = cache.cacheData(model.getUserSSOToken(), data);
        setPageSessionAttribute(DATA_ID, id);
    }
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) Iterator(java.util.Iterator) RealmResourceOfferingModel(com.sun.identity.console.realm.model.RealmResourceOfferingModel) DiscoveryDataCache(com.sun.identity.console.service.model.DiscoveryDataCache)

Example 27 with SMDiscoEntryData

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

the class RealmResourceOfferingViewBeanBase method handleTblSecurityMechIDHrefActionRequest.

/**
     * Handles edit security mechanism ID request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblSecurityMechIDHrefActionRequest(RequestInvocationEvent event) throws ModelControlException {
    SMDiscoEntryData smData = (SMDiscoEntryData) getPageSessionAttribute(PROPERTY_ATTRIBUTE);
    setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
    setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
    RealmDiscoveryDescriptionEditViewBean vb = (RealmDiscoveryDescriptionEditViewBean) getViewBean(RealmDiscoveryDescriptionEditViewBean.class);
    passPgSessionMap(vb);
    vb.populateValues((String) getDisplayFieldValue(TBL_SECURITY_MECH_ID_HREF_ACTION));
    vb.forwardTo(getRequestContext());
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData)

Example 28 with SMDiscoEntryData

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

the class RealmResourceOfferingViewBeanBase method handleTblSecurityMechIDButtonAddRequest.

public void handleTblSecurityMechIDButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
    try {
        SMDiscoEntryData smData = getValues(false);
        setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
        setPageSessionAttribute(RealmDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
        RealmDiscoveryDescriptionAddViewBean vb = (RealmDiscoveryDescriptionAddViewBean) getViewBean(RealmDiscoveryDescriptionAddViewBean.class);
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 29 with SMDiscoEntryData

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

the class RealmResourceOfferingEditViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (populateValues) {
        SMDiscoEntryData data = getCurrentServiceData();
        setValues(data, getModel());
    } else {
        SMDiscoEntryData data = (SMDiscoEntryData) getPageSessionAttribute(PROPERTY_ATTRIBUTE);
        if (data != null) {
            populateDirectiveMechIDRefs(data);
        }
    }
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData)

Example 30 with SMDiscoEntryData

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

the class SMDiscoveryServiceViewBean method populateBootstrapResOffTable.

private void populateBootstrapResOffTable(Set resoff) {
    tablePopulated = true;
    if (resoff != null) {
        CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
        tblModel.clearAll();
        boolean firstEntry = true;
        int counter = 0;
        try {
            SMDiscoveryServiceData smEntry = SMDiscoveryServiceData.getEntries(resoff);
            List resourceList = smEntry.getResourceData();
            if ((resourceList != null) && !resourceList.isEmpty()) {
                for (Iterator i = resourceList.iterator(); i.hasNext(); ) {
                    SMDiscoEntryData smDisco = (SMDiscoEntryData) i.next();
                    if (!firstEntry) {
                        tblModel.appendRow();
                    } else {
                        firstEntry = false;
                    }
                    tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_DATA_SERVICE_TYPE, smDisco.serviceType);
                    tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_DATA_ABSTRACT, smDisco.abstractValue);
                    tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_HREF_ACTION, Integer.toString(counter));
                    counter++;
                }
                disableButton(TBL_BOOTSTRAP_RES_OFF_ADD_BTN, true);
            } else {
                disableButton(TBL_BOOTSTRAP_RES_OFF_ADD_BTN, false);
            }
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
    }
    setPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, (OrderedSet) resoff);
}
Also used : SMDiscoveryServiceData(com.sun.identity.console.service.model.SMDiscoveryServiceData) SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Aggregations

SMDiscoEntryData (com.sun.identity.console.service.model.SMDiscoEntryData)42 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)10 List (java.util.List)7 DiscoveryDataCache (com.sun.identity.console.service.model.DiscoveryDataCache)6 SMDescriptionData (com.sun.identity.console.service.model.SMDescriptionData)6 SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)5 Iterator (java.util.Iterator)5 ArrayList (java.util.ArrayList)3 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)2 OptionList (com.iplanet.jato.view.html.OptionList)1 EntityResourceOfferingModel (com.sun.identity.console.idm.model.EntityResourceOfferingModel)1 RealmResourceOfferingModel (com.sun.identity.console.realm.model.RealmResourceOfferingModel)1 UMUserResourceOfferingModel (com.sun.identity.console.user.model.UMUserResourceOfferingModel)1 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)1 CCEditableListModel (com.sun.web.ui.model.CCEditableListModel)1 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)1 CCSelectableList (com.sun.web.ui.view.html.CCSelectableList)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1