Search in sources :

Example 31 with SMDiscoEntryData

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

the class SMDiscoveryBootstrapRefOffViewBeanBase method getValues.

protected SMDiscoEntryData getValues(boolean validated) throws AMConsoleException {
    SMDiscoEntryData smDisco = new SMDiscoEntryData();
    smDisco.abstractValue = ((String) propertySheetModel.getValue(ATTR_ABSTRACT)).trim();
    smDisco.serviceType = ((String) propertySheetModel.getValue(ATTR_SERVICE_TYPE)).trim();
    smDisco.providerId = ((String) propertySheetModel.getValue(ATTR_PROVIDER_ID)).trim();
    String optionFlag = (String) propertySheetModel.getValue(ATTR_RESOURCE_OFFERING_OPTIONS_OPTIONS);
    smDisco.noOption = optionFlag.equalsIgnoreCase("true");
    CCEditableList eList = (CCEditableList) getChild(ATTR_RESOURCE_OFFERING_OPTIONS_LIST);
    eList.restoreStateData();
    CCEditableListModel eModel = (CCEditableListModel) eList.getModel();
    OptionList options = eModel.getOptionList();
    if (options != null) {
        smDisco.options = AMAdminUtils.toList(options);
    }
    List descData = (List) removePageSessionAttribute(ATTR_SECURITY_MECH_ID);
    if (descData != null) {
        smDisco.descData = descData;
    }
    smDisco.directives = getDirectiveMechIDMapping();
    if (validated) {
        if ((descData == null) || descData.isEmpty()) {
            throw new AMConsoleException("discovery.service.bootstrapResOff.missing.service.desc.message");
        } else if (smDisco.serviceType.length() == 0) {
            throw new AMConsoleException("discovery.service.bootstrapResOff.missing.serviceType.message");
        } else if (smDisco.providerId.length() == 0) {
            throw new AMConsoleException("discovery.service.bootstrapResOff.missing.providerId.message");
        }
    }
    return smDisco;
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) CCEditableListModel(com.sun.web.ui.model.CCEditableListModel) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) ArrayList(java.util.ArrayList) CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) OptionList(com.iplanet.jato.view.html.OptionList)

Example 32 with SMDiscoEntryData

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

the class SMDiscoveryDescriptionViewBeanBase method setMechID.

private void setMechID(CCAddRemoveModel model) {
    SMDiscoEntryData data = (SMDiscoEntryData) getPageSessionAttribute(PG_SESSION_DISCO_ENTRY_DATA);
    Set availableMechIds = getSecurityMechanisms();
    Set assignedMechIds = data.getAllAssignedMechIDs();
    availableMechIds.removeAll(assignedMechIds);
    model.setAvailableOptionList(createOptionList(availableMechIds));
    SMDescriptionData descData = getCurrentData();
    if (descData != null) {
        model.setSelectedOptionList(createOptionList(descData.securityMechId));
    }
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) HashSet(java.util.HashSet) Set(java.util.Set) SMDescriptionData(com.sun.identity.console.service.model.SMDescriptionData)

Example 33 with SMDiscoEntryData

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

the class SMDiscoveryBootstrapRefOffViewBeanBase method handleTblSecurityMechIDButtonAddRequest.

public void handleTblSecurityMechIDButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
    try {
        SMDiscoEntryData smData = getValues(false);
        setPageSessionAttribute(SMDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
        setPageSessionAttribute(SMDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
        SMDiscoveryDescriptionAddViewBean vb = (SMDiscoveryDescriptionAddViewBean) getViewBean(SMDiscoveryDescriptionAddViewBean.class);
        unlockPageTrail();
        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 34 with SMDiscoEntryData

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

the class EntityDiscoveryDescriptionEditViewBean method getCurrentData.

protected SMDescriptionData getCurrentData() {
    int currentIdx = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
    SMDiscoEntryData data = (SMDiscoEntryData) getPageSessionAttribute(PG_SESSION_DISCO_ENTRY_DATA);
    return (SMDescriptionData) data.descData.get(currentIdx);
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) SMDescriptionData(com.sun.identity.console.service.model.SMDescriptionData)

Example 35 with SMDiscoEntryData

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

the class EntityDiscoveryDescriptionAddViewBean method handleButton1Request.

protected void handleButton1Request(SMDescriptionData smData) {
    EntityResourceOfferingViewBeanBase vb = (EntityResourceOfferingViewBeanBase) getReturnToViewBean();
    SMDiscoEntryData data = (SMDiscoEntryData) removePageSessionAttribute(PG_SESSION_DISCO_ENTRY_DATA);
    data.descData.add(smData);
    setPageSessionAttribute(EntityResourceOfferingViewBeanBase.PROPERTY_ATTRIBUTE, data);
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData)

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