Search in sources :

Example 36 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class FederationViewBean method populateCOTTable.

private void populateCOTTable() {
    tablePopulated = true;
    FSAuthDomainsModel model = (FSAuthDomainsModel) getModel();
    Set circleOfTrustDescriptors = model.getCircleOfTrustDescriptors();
    CCActionTableModel tableModel = (CCActionTableModel) propertySheetModel.getModel(COT_TABLE);
    tableModel.clearAll();
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    if ((circleOfTrustDescriptors != null) && (!circleOfTrustDescriptors.isEmpty())) {
        List cache = new ArrayList(circleOfTrustDescriptors.size());
        boolean first = true;
        for (Iterator iter = circleOfTrustDescriptors.iterator(); iter.hasNext(); ) {
            if (first) {
                first = false;
            } else {
                tableModel.appendRow();
            }
            CircleOfTrustDescriptor desc = (CircleOfTrustDescriptor) iter.next();
            String name = desc.getCircleOfTrustName();
            tableModel.setValue(COT_NAME_VALUE, name);
            tableModel.setValue(COT_NAME_HREF, stringToHex(name));
            // get entity/provider name
            Set entitySet = desc.getTrustedProviders();
            if ((entitySet != null) && (!entitySet.isEmpty())) {
                Iterator it = entitySet.iterator();
                StringBuffer sb = new StringBuffer();
                Encoder encoder = ESAPI.encoder();
                while (it.hasNext()) {
                    String entity = (String) it.next();
                    sb.append(encoder.encodeForHTML(entity)).append("<br>");
                }
                tableModel.setValue(COT_ENTITY_VALUE, sb.toString());
            } else {
                tableModel.setValue(COT_ENTITY_VALUE, "");
            }
            // get realm name
            String realm = desc.getCircleOfTrustRealm();
            tableModel.setValue(COT_REALM_VALUE, realm);
            // get cot status
            String status = desc.getCircleOfTrustStatus();
            if ((status != null) && status.equals("active")) {
                tableModel.setValue(COT_STATUS_VALUE, "label.active");
            } else {
                tableModel.setValue(COT_STATUS_VALUE, "label.inactive");
            }
            cache.add(name + "," + realm);
        }
        szCache.setValue((ArrayList) cache);
    } else {
        szCache.setValue(null);
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) Encoder(org.owasp.esapi.Encoder) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) FSAuthDomainsModel(com.sun.identity.console.federation.model.FSAuthDomainsModel) ArrayList(java.util.ArrayList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) CircleOfTrustDescriptor(com.sun.identity.cot.CircleOfTrustDescriptor)

Example 37 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class IDFFSPViewBean method createAuthContextsModel.

private void createAuthContextsModel() {
    tblAuthContextsModel = new CCActionTableModel(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/tblIDFFSPAuthenticationContext.xml"));
    tblAuthContextsModel.setTitleLabel("label.items");
    tblAuthContextsModel.setActionValue(TBL_COL_SUPPORTED, "idff.sp.authenticationContext.table.name.supported.name");
    tblAuthContextsModel.setActionValue(TBL_COL_CONTEXT_REFERENCE, "idff.sp.authenticationContext.table.name.contextReference.name");
    tblAuthContextsModel.setActionValue(TBL_COL_LEVEL, "idff.sp.authenticationContext.table.name.level.name");
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel)

Example 38 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class PolicyOpViewBeanBase method createResponseProviderTableModels.

protected void createResponseProviderTableModels() {
    tblResponseProvidersModel = new CCActionTableModel(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/tblPMResponseProviders.xml"));
    tblResponseProvidersModel.setTitleLabel("label.items");
    tblResponseProvidersModel.setActionValue("tblResponseProvidersButtonAdd", "button.new");
    tblResponseProvidersModel.setActionValue("tblResponseProvidersButtonDelete", "button.delete");
    tblResponseProvidersModel.setActionValue(TBL_RESPONSE_ATTRIBUTES_COL_NAME, "policy.responseproviders.table.column.name");
    tblResponseProvidersModel.setActionValue(TBL_RESPONSE_ATTRIBUTES_COL_TYPE, "policy.responseproviders.table.column.type");
    tblResponseProvidersModel.setActionValue(TBL_RESPONSE_ATTRIBUTES_COL_ACTION, "policy.responseproviders.table.column.action");
    propertySheetModel.setModel(TBL_RESPONSE_ATTRIBUTES, tblResponseProvidersModel);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel)

Example 39 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class PolicyOpViewBeanBase method createConditionTableModels.

protected void createConditionTableModels() {
    tblConditionsModel = new CCActionTableModel(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/tblPMConditions.xml"));
    tblConditionsModel.setTitleLabel("label.items");
    tblConditionsModel.setActionValue("tblConditionsButtonAdd", "button.new");
    tblConditionsModel.setActionValue("tblConditionsButtonDelete", "button.delete");
    tblConditionsModel.setActionValue(TBL_CONDITIONS_COL_NAME, "policy.conditions.table.column.name");
    tblConditionsModel.setActionValue(TBL_CONDITIONS_COL_TYPE, "policy.conditions.table.column.type");
    propertySheetModel.setModel(TBL_CONDITIONS, tblConditionsModel);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel)

Example 40 with CCActionTableModel

use of com.sun.web.ui.model.CCActionTableModel in project OpenAM by OpenRock.

the class PolicyOpViewBeanBase method createSubjectTableModels.

protected void createSubjectTableModels() {
    tblSubjectsModel = new CCActionTableModel(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/tblPMSubjects.xml"));
    tblSubjectsModel.setTitleLabel("label.items");
    tblSubjectsModel.setActionValue("tblSubjectsButtonAdd", "button.new");
    tblSubjectsModel.setActionValue("tblSubjectsButtonDelete", "button.delete");
    tblSubjectsModel.setActionValue(TBL_SUBJECTS_COL_NAME, "policy.subjects.table.column.name");
    tblSubjectsModel.setActionValue(TBL_SUBJECTS_COL_TYPE, "policy.subjects.table.column.type");
    tblSubjectsModel.setActionValue(TBL_SUBJECTS_COL_ACTION, "policy.subjects.table.column.action");
    propertySheetModel.setModel(TBL_SUBJECTS, tblSubjectsModel);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel)

Aggregations

CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)103 CCActionTable (com.sun.web.ui.view.table.CCActionTable)22 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)18 Iterator (java.util.Iterator)18 List (java.util.List)14 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)13 ArrayList (java.util.ArrayList)12 HashSet (java.util.HashSet)9 Set (java.util.Set)9 SerializedField (com.sun.identity.console.components.view.html.SerializedField)8 OptionList (com.iplanet.jato.view.html.OptionList)6 SMSubConfig (com.sun.identity.console.base.model.SMSubConfig)6 HashMap (java.util.HashMap)5 Map (java.util.Map)5 SCConfigModel (com.sun.identity.console.service.model.SCConfigModel)4 AuthPropertiesModel (com.sun.identity.console.authentication.model.AuthPropertiesModel)3 EntityModel (com.sun.identity.console.federation.model.EntityModel)2 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)2 FSSAMLServiceModel (com.sun.identity.console.federation.model.FSSAMLServiceModel)2 SMDiscoEntryData (com.sun.identity.console.service.model.SMDiscoEntryData)2