Search in sources :

Example 6 with SMDescriptionData

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

the class SMDiscoveryDescriptionEditViewBean 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 7 with SMDescriptionData

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

the class SMDiscoveryBootstrapRefOffViewBeanBase method populateDescriptionsTable.

private void populateDescriptionsTable(List descData) {
    tablePopulated = true;
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(ATTRIBUTE_NAME_SECURITY_MECH_ID);
    tblModel.clearAll();
    if (descData != null) {
        boolean firstEntry = true;
        int counter = 0;
        if ((descData != null) && !descData.isEmpty()) {
            for (Iterator iter = descData.iterator(); iter.hasNext(); ) {
                SMDescriptionData smDesc = (SMDescriptionData) iter.next();
                if (!firstEntry) {
                    tblModel.appendRow();
                } else {
                    firstEntry = false;
                }
                tblModel.setValue(TBL_SECURITY_MECH_ID_DATA_ID, smDesc.getFirstSecurityMechId());
                tblModel.setValue(TBL_SECURITY_MECH_ID_HREF_ACTION, Integer.toString(counter));
                tblModel.setValue(TBL_SECURITY_MECH_ID_LABEL_ACTION, "discovery.service.table.bootstrapResOff.action.edit.label");
                counter++;
            }
        }
    }
    setPageSessionAttribute(ATTR_SECURITY_MECH_ID, (ArrayList) descData);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) SMDescriptionData(com.sun.identity.console.service.model.SMDescriptionData)

Example 8 with SMDescriptionData

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

the class SMDiscoveryDescriptionViewBeanBase method getValues.

private SMDescriptionData getValues() throws AMConsoleException {
    SMDescriptionData smData = new SMDescriptionData();
    smData.descriptionID = (String) getDisplayFieldValue(TF_DESCRIPTION_ID);
    if (smData.descriptionID.length() == 0) {
        smData.descriptionID = SAMLUtils.generateID();
    }
    CCAddRemove mechIdChild = (CCAddRemove) getChild(ATTR_NAME_SECURITY_MECH_ID);
    mechIdChild.restoreStateData();
    CCAddRemoveModel mechIdModel = (CCAddRemoveModel) propertySheetModel.getModel(ATTR_NAME_SECURITY_MECH_ID);
    smData.securityMechId = getList(mechIdModel.getSelectedOptionList());
    smData.endPointUrl = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_END_POINT)).trim();
    smData.soapAction = ((String) propertySheetModel.getValue(ATTR_NAME_SOAP_HTTP_ACTION)).trim();
    if (smData.securityMechId.isEmpty()) {
        throw new AMConsoleException("discovery.service.description.missing.securityMechId.message");
    }
    if (smData.endPointUrl.length() == 0) {
        throw new AMConsoleException("discovery.service.description.missing.endPointUrl.message");
    }
    return smData;
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) SMDescriptionData(com.sun.identity.console.service.model.SMDescriptionData) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove)

Example 9 with SMDescriptionData

use of com.sun.identity.console.service.model.SMDescriptionData 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 10 with SMDescriptionData

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

the class SMDiscoveryDescriptionEditViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (populateValues) {
        SMDescriptionData data = getCurrentData();
        setValues(data);
    }
}
Also used : SMDescriptionData(com.sun.identity.console.service.model.SMDescriptionData)

Aggregations

SMDescriptionData (com.sun.identity.console.service.model.SMDescriptionData)13 SMDiscoEntryData (com.sun.identity.console.service.model.SMDiscoEntryData)6 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 Iterator (java.util.Iterator)2 DiscoveryDataCache (com.sun.identity.console.service.model.DiscoveryDataCache)1 SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)1 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)1 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)1 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1