Search in sources :

Example 36 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class AuthConfigViewBean method getTableData.

private List getTableData() throws ModelControlException {
    List entryList = new ArrayList();
    CCActionTable table = (CCActionTable) getChild(AUTH_ENTRY_TABLE);
    table.restoreStateData();
    int size = entryTableModel.getNumRows();
    for (int i = 0; i < size; i++) {
        entryTableModel.setRowIndex(i);
        String module = (String) entryTableModel.getValue(MODULE_NAME);
        String flag = (String) entryTableModel.getValue(CRITERIA);
        String option = (String) entryTableModel.getValue(OPTION_FIELD);
        try {
            AuthConfigurationEntry ae = new AuthConfigurationEntry(module, flag, option);
            entryList.add(ae);
        } catch (AMConfigurationException e) {
            debug.warning("AuthConfigViewBean.getTableData() " + "Couldn't create the auth configuration entry", e);
        }
    }
    return entryList;
}
Also used : ArrayList(java.util.ArrayList) AMConfigurationException(com.sun.identity.authentication.config.AMConfigurationException) ArrayList(java.util.ArrayList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AuthConfigurationEntry(com.sun.identity.authentication.config.AuthConfigurationEntry)

Example 37 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class AuthConfigViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (!tablePopulated) {
        populateEntryTable();
    }
    if (name.equals(PGTITLE_THREE_BTNS)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (name.equals(PROPERTY_ATTRIBUTE)) {
        view = new AMPropertySheet(this, propertySheetModel, name);
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else if (name.equals(ACTION_TILED_VIEW)) {
        view = new AuthActionTiledView(this, entryTableModel, name);
    } else if (name.equals(AUTH_ENTRY_TABLE)) {
        CCActionTable table = new CCActionTable(this, entryTableModel, name);
        table.setTiledView((AuthActionTiledView) getChild(ACTION_TILED_VIEW));
        view = table;
    } else if (propertySheetModel.isChildSupported(name)) {
        view = propertySheetModel.createChild(this, name, getModel());
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 38 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class AbstractAuditViewBean method populateTableModel.

private void populateTableModel(List<SMSubConfig> subConfigs) {
    CCActionTable tbl = (CCActionTable) getChild(TBL_SUB_CONFIG);
    CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
    tblModel.clearAll();
    if (CollectionUtils.isEmpty(subConfigs)) {
        return;
    }
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    List<SMSubConfig> cache = new ArrayList<>(subConfigs.size());
    boolean firstEntry = true;
    for (SMSubConfig conf : subConfigs) {
        if (firstEntry) {
            firstEntry = false;
        } else {
            tblModel.appendRow();
        }
        tblModel.setValue(TBL_SUB_CONFIG_DATA_NAME, conf.getName());
        tblModel.setValue(TBL_SUB_CONFIG_HREF_NAME, conf.getName());
        tblModel.setValue(TBL_SUB_CONFIG_DATA_TYPE, conf.getType());
        cache.add(conf);
    }
    szCache.setValue(cache);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) SerializedField(com.sun.identity.console.components.view.html.SerializedField) SMSubConfig(com.sun.identity.console.base.model.SMSubConfig) ArrayList(java.util.ArrayList) CCActionTable(com.sun.web.ui.view.table.CCActionTable)

Example 39 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class SAMLv2SPServicesViewBean method updateWithAssertionServiceVlues.

private List updateWithAssertionServiceVlues() throws ModelControlException {
    List asconsServiceList = new ArrayList();
    int num = 0;
    SAMLv2Model model = (SAMLv2Model) getModel();
    CCActionTable tbl = (CCActionTable) getChild(TBL_ASSERTION_CONSUMER_SERVICE);
    tbl.restoreStateData();
    try {
        num = model.getAssertionConsumerServices(realm, entityName).size();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    for (int i = 0; i < num; i++) {
        tblAssertionConsumerModel.setLocation(i);
        String isDefault = (String) tblAssertionConsumerModel.getValue(TBL_DATA_DEFAULT);
        boolean theValue = Boolean.parseBoolean(isDefault);
        String type = (String) tblAssertionConsumerModel.getValue(TBL_DATA_TYPE);
        String binding = "urn:oasis:names:tc:SAML:2.0:bindings:" + type;
        String location = (String) tblAssertionConsumerModel.getValue(TBL_DATA_LOCATION);
        String index = (String) tblAssertionConsumerModel.getValue(TBL_DATA_INDEX);
        AssertionConsumerServiceElement acsElem = null;
        try {
            acsElem = model.getAscObject();
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
        acsElem.setBinding(binding);
        acsElem.setIsDefault(theValue);
        acsElem.setIndex(Integer.parseInt(index));
        acsElem.setLocation(location);
        asconsServiceList.add(acsElem);
    }
    return asconsServiceList;
}
Also used : ArrayList(java.util.ArrayList) AssertionConsumerServiceElement(com.sun.identity.saml2.jaxb.metadata.AssertionConsumerServiceElement) ArrayList(java.util.ArrayList) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model)

Example 40 with CCActionTable

use of com.sun.web.ui.view.table.CCActionTable in project OpenAM by OpenRock.

the class SAMLv2IDPAssertionContentViewBean method getAuthenticationContexts.

private SAMLv2AuthContexts getAuthenticationContexts() throws ModelControlException {
    CCActionTable tbl = (CCActionTable) getChild(TBL_AUTHENTICATION_CONTEXTS);
    tbl.restoreStateData();
    SAMLv2AuthContexts authContexts = new SAMLv2AuthContexts();
    String defaultAuthnContext = (String) getDisplayFieldValue(SAMLv2Model.IDP_AUTHN_CONTEXT_CLASS_REF_MAPPING_DEFAULT);
    for (int i = 0; i < tblAuthContextsModel.getSize(); i++) {
        tblAuthContextsModel.setLocation(i);
        String name = (String) tblAuthContextsModel.getValue(TBL_DATA_CONTEXT_REFERENCE);
        String supported = (String) tblAuthContextsModel.getValue(TBL_DATA_SUPPORTED);
        String key = (String) tblAuthContextsModel.getValue(TBL_DATA_KEY);
        String value = (String) tblAuthContextsModel.getValue(TBL_DATA_VALUE);
        String level = (String) tblAuthContextsModel.getValue(TBL_DATA_LEVEL);
        boolean isDefault = false;
        if (name.equals(defaultAuthnContext)) {
            isDefault = true;
            supported = "true";
        }
        authContexts.put(name, supported, key, value, level, isDefault);
    }
    return authContexts;
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable)

Aggregations

CCActionTable (com.sun.web.ui.view.table.CCActionTable)82 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)40 SerializedField (com.sun.identity.console.components.view.html.SerializedField)28 ArrayList (java.util.ArrayList)25 List (java.util.List)23 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)22 HashSet (java.util.HashSet)19 Set (java.util.Set)17 View (com.iplanet.jato.view.View)16 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)15 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)13 HashMap (java.util.HashMap)13 Map (java.util.Map)13 OptionList (com.iplanet.jato.view.html.OptionList)6 SMSubConfig (com.sun.identity.console.base.model.SMSubConfig)6 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)5 ServerSiteModel (com.sun.identity.console.service.model.ServerSiteModel)5 Policy (com.sun.identity.policy.Policy)5 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)4 SMDiscoveryServiceData (com.sun.identity.console.service.model.SMDiscoveryServiceData)4