Search in sources :

Example 6 with FSSAMLServiceModel

use of com.sun.identity.console.federation.model.FSSAMLServiceModel in project OpenAM by OpenRock.

the class FSSAMLServiceViewBean method getValues.

private Map getValues(boolean modified, boolean matchPassword) throws ModelControlException, AMConsoleException {
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    FSSAMLServiceModel model = (FSSAMLServiceModel) getModel();
    Map origValues = model.getAttributeValues();
    Map origNonTableValues = new HashMap();
    origNonTableValues.putAll(origValues);
    AMAdminUtils.removeMapEntries(origNonTableValues, tabledAttributes);
    Map mapAttrValues = ps.getAttributeValues(origNonTableValues, modified, matchPassword, model);
    Map cachedValues = (Map) getPageSessionAttribute(PROPERTY_ATTRIBUTE);
    for (Iterator i = cachedValues.keySet().iterator(); i.hasNext(); ) {
        String attrName = (String) i.next();
        Set values = (Set) cachedValues.get(attrName);
        if (tabledAttributes.contains(attrName)) {
            mapAttrValues.put(attrName, values);
        }
    }
    return mapAttrValues;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) HashMap(java.util.HashMap) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) Iterator(java.util.Iterator) FSSAMLServiceModel(com.sun.identity.console.federation.model.FSSAMLServiceModel) HashMap(java.util.HashMap) Map(java.util.Map)

Example 7 with FSSAMLServiceModel

use of com.sun.identity.console.federation.model.FSSAMLServiceModel in project OpenAM by OpenRock.

the class FederationViewBean method getTrustedPartnersSelectType.

private String getTrustedPartnersSelectType(String input) {
    FSSAMLServiceModel model = (FSSAMLServiceModel) getSAMLModel();
    String ret = null;
    if (input.equals("artifact")) {
        ret = model.getLocalizedString("saml.profile.trustedPartners.selectType.profile.artifact.label");
    } else if (input.equals("post")) {
        ret = model.getLocalizedString("saml.profile.trustedPartners.selectType.profile.post.label");
    } else if (input.equals("soap")) {
        ret = model.getLocalizedString("saml.profile.trustedPartners.selectType.profile.soap.label");
    }
    return ret;
}
Also used : FSSAMLServiceModel(com.sun.identity.console.federation.model.FSSAMLServiceModel)

Example 8 with FSSAMLServiceModel

use of com.sun.identity.console.federation.model.FSSAMLServiceModel in project OpenAM by OpenRock.

the class FederationViewBean method handleDeleteTPButtonRequest.

/**
     * Handles the delete trusted partner request. The items which are
     * selected in the SAML table will be removed. After the processing is
     * complete a message will be displayed indicating the process succeeded,
     * or what failed if it didn't succeed.
     *
     * @param event Request Invocation Event.
     */
public void handleDeleteTPButtonRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable tbl = (CCActionTable) getChild(SAML_TABLE);
    tbl.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SAML_TABLE);
    // get selected rows here
    Integer[] selected = tblModel.getSelectedRows();
    List currentList = (List) getPageSessionAttribute(SAML_TABLE_ATTRIBUTE);
    Set selectedSet = new HashSet();
    for (int i = 0; i < selected.length; i++) {
        selectedSet.add(currentList.get(selected[i].intValue()));
    }
    try {
        FSSAMLServiceModel model = (FSSAMLServiceModel) getSAMLModel();
        model.deleteTrustPartners(selectedSet);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "saml.message.trusted.partner.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "saml.message.trusted.partner.deleted.pural");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) ArrayList(java.util.ArrayList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) FSSAMLServiceModel(com.sun.identity.console.federation.model.FSSAMLServiceModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

Example 9 with FSSAMLServiceModel

use of com.sun.identity.console.federation.model.FSSAMLServiceModel in project OpenAM by OpenRock.

the class FSSAMLServiceViewBean method setInlineHelps.

private void setInlineHelps() {
    FSSAMLServiceModel model = (FSSAMLServiceModel) getModel();
    Map helps = model.getAttributeInlineHelps();
    for (Iterator iter = helps.keySet().iterator(); iter.hasNext(); ) {
        String name = (String) iter.next();
        try {
            View view = getChild("help" + name);
            if (DisplayField.class.isInstance(view)) {
                ((DisplayField) view).setValue((String) helps.get(name));
            }
        } catch (IllegalArgumentException e) {
        // do nothing.
        // child is not a help.
        }
    }
}
Also used : DisplayField(com.iplanet.jato.view.DisplayField) Iterator(java.util.Iterator) FSSAMLServiceModel(com.sun.identity.console.federation.model.FSSAMLServiceModel) HashMap(java.util.HashMap) Map(java.util.Map) View(com.iplanet.jato.view.View)

Example 10 with FSSAMLServiceModel

use of com.sun.identity.console.federation.model.FSSAMLServiceModel in project OpenAM by OpenRock.

the class FSSAMLServiceViewBean method setLabels.

private void setLabels() {
    FSSAMLServiceModel model = (FSSAMLServiceModel) getModel();
    Map labels = model.getAttributeLabels();
    for (Iterator iter = labels.keySet().iterator(); iter.hasNext(); ) {
        String name = (String) iter.next();
        try {
            View view = getChild("lbl" + name);
            if (DisplayField.class.isInstance(view)) {
                ((DisplayField) view).setValue((String) labels.get(name));
            }
        } catch (IllegalArgumentException e) {
        // do nothing.
        // child is not a label.
        }
    }
}
Also used : DisplayField(com.iplanet.jato.view.DisplayField) Iterator(java.util.Iterator) FSSAMLServiceModel(com.sun.identity.console.federation.model.FSSAMLServiceModel) HashMap(java.util.HashMap) Map(java.util.Map) View(com.iplanet.jato.view.View)

Aggregations

FSSAMLServiceModel (com.sun.identity.console.federation.model.FSSAMLServiceModel)10 HashMap (java.util.HashMap)7 Iterator (java.util.Iterator)7 HashSet (java.util.HashSet)6 Map (java.util.Map)6 Set (java.util.Set)6 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)5 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)3 List (java.util.List)3 DisplayField (com.iplanet.jato.view.DisplayField)2 View (com.iplanet.jato.view.View)2 OptionList (com.iplanet.jato.view.html.OptionList)2 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)2 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)2 ArrayList (java.util.ArrayList)2 AMPipeDelimitAttrTokenizer (com.sun.identity.console.base.AMPipeDelimitAttrTokenizer)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1