Search in sources :

Example 66 with CCActionTableModel

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

the class WSPersonalProfileServiceViewBean method createSupportedContainerTableModel.

private void createSupportedContainerTableModel() {
    CCActionTableModel tblModel = new CCActionTableModel(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/tblWSPersonalProfileSupportedContainers.xml"));
    tblModel.setTitleLabel("label.items");
    tblModel.setActionValue(TBL_SUPPORTED_CONTAINER_COL_NAME, "webservices.personal.profile.table.supportedContainers.name");
    tblModel.setActionValue(TBL_SUPPORTED_CONTAINER_ADD_BTN, "webservices.personal.profile.table.supportedContainers.add.button");
    tblModel.setActionValue(TBL_SUPPORTED_CONTAINER_DELETE_BTN, "webservices.personal.profile.table.supportedContainers.delete.button");
    propertySheetModel.setModel(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS, tblModel);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel)

Example 67 with CCActionTableModel

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

the class WSPersonalProfileServiceViewBean method handleTblSupportedContainerButtonDeleteRequest.

/**
     * Handles remove supported container request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblSupportedContainerButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    setSubmitCycle(true);
    CCActionTable table = (CCActionTable) getChild(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS);
        tblValues.removeAll(selected);
        setPageSessionAttribute(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_SUPPPORTED_CONTAINERS, tblValues);
        populateSupportedContainersTable(tblValues);
    }
    resetButtonState(TBL_SUPPORTED_CONTAINER_DELETE_BTN);
    forwardTo();
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) CCActionTable(com.sun.web.ui.view.table.CCActionTable)

Example 68 with CCActionTableModel

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

the class WSPersonalProfileServiceViewBean method createDSAttributeMapListTableModel.

private void createDSAttributeMapListTableModel() {
    CCActionTableModel tblModel = new CCActionTableModel(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/tblWSPersonalProfileDSAttributeMapList.xml"));
    tblModel.setTitleLabel("label.items");
    tblModel.setActionValue(TBL_DS_ATTRIBUTE_MAP_LIST_COL_NAME, "webservices.personal.profile.table.dsAttributeMapList.name");
    tblModel.setActionValue(TBL_DS_ATTRIBUTE_MAP_LIST_COL_MAP, "webservices.personal.profile.table.dsAttributeMapList.map");
    tblModel.setActionValue(TBL_DS_ATTRIBUTE_MAP_LIST_ADD_BTN, "webservices.personal.profile.table.dsAttributeMapList.add.button");
    tblModel.setActionValue(TBL_DS_ATTRIBUTE_MAP_LIST_DELETE_BTN, "webservices.personal.profile.table.dsAttributeMapList.delete.button");
    propertySheetModel.setModel(WSPersonalProfileServiceModelImpl.ATTRIBUTE_NAME_DS_ATTRIBUTE_MAP_LIST, tblModel);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel)

Example 69 with CCActionTableModel

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

the class SMDiscoveryServiceViewBean method populateProviderResourceIdMapperTable.

private void populateProviderResourceIdMapperTable(Collection mapper) {
    tablePopulated = true;
    OrderedSet cache = new OrderedSet();
    if (mapper != null) {
        CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER);
        tblModel.clearAll();
        boolean firstEntry = true;
        int counter = 0;
        for (Iterator i = mapper.iterator(); i.hasNext(); ) {
            String val = (String) i.next();
            if (!firstEntry) {
                tblModel.appendRow();
            } else {
                firstEntry = false;
            }
            Map map = AMAdminUtils.getValuesFromDelimitedString(val, "|");
            String providerId = (String) map.get(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_PROVIDER_ID);
            String idMapper = (String) map.get(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_ID_MAPPER);
            if ((providerId != null) && (idMapper != null)) {
                tblModel.setValue(TBL_PROVIDER_RESOURCEID_MAPPER_DATA_PROVIDERID, providerId);
                tblModel.setValue(TBL_PROVIDER_RESOURCEID_MAPPER_DATA_ID_MAPPER, idMapper);
                tblModel.setValue(TBL_PROVIDER_RESOURCEID_MAPPER_HREF_ACTION, Integer.toString(counter));
                counter++;
                cache.add(val);
            }
        }
    }
    setPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER, cache);
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) HashMap(java.util.HashMap) Map(java.util.Map)

Example 70 with CCActionTableModel

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

the class SMDiscoveryServiceViewBean method populateBootstrapResOffTable.

private void populateBootstrapResOffTable(Set resoff) {
    tablePopulated = true;
    if (resoff != null) {
        CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
        tblModel.clearAll();
        boolean firstEntry = true;
        int counter = 0;
        try {
            SMDiscoveryServiceData smEntry = SMDiscoveryServiceData.getEntries(resoff);
            List resourceList = smEntry.getResourceData();
            if ((resourceList != null) && !resourceList.isEmpty()) {
                for (Iterator i = resourceList.iterator(); i.hasNext(); ) {
                    SMDiscoEntryData smDisco = (SMDiscoEntryData) i.next();
                    if (!firstEntry) {
                        tblModel.appendRow();
                    } else {
                        firstEntry = false;
                    }
                    tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_DATA_SERVICE_TYPE, smDisco.serviceType);
                    tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_DATA_ABSTRACT, smDisco.abstractValue);
                    tblModel.setValue(TBL_BOOTSTRAP_RES_OFF_HREF_ACTION, Integer.toString(counter));
                    counter++;
                }
                disableButton(TBL_BOOTSTRAP_RES_OFF_ADD_BTN, true);
            } else {
                disableButton(TBL_BOOTSTRAP_RES_OFF_ADD_BTN, false);
            }
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
    }
    setPageSessionAttribute(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, (OrderedSet) resoff);
}
Also used : SMDiscoveryServiceData(com.sun.identity.console.service.model.SMDiscoveryServiceData) SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

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