Search in sources :

Example 86 with CCActionTableModel

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

the class SCSAML2SOAPBindingViewBean method createRequestHandlerListTableModel.

private void createRequestHandlerListTableModel() {
    CCActionTableModel tblModel = new CCActionTableModel(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/tblSAML2SOAPBindingRequestHandlerList.xml"));
    tblModel.setTitleLabel("label.items");
    tblModel.setActionValue(TBL_REQUEST_HANDLER_LIST_COL_KEY, "soapBinding.service.table.requestHandlerList.key");
    tblModel.setActionValue(TBL_REQUEST_HANDLER_LIST_COL_CLASS, "soapBinding.service.table.requestHandlerList.class");
    tblModel.setActionValue(TBL_REQUEST_HANDLER_LIST_COL_ACTION, "soapBinding.service.table.requestHandlerList.action");
    tblModel.setActionValue(TBL_REQUEST_HANDLER_LIST_ADD_BTN, "soapBinding.service.table.requestHandlerList.add.button");
    tblModel.setActionValue(TBL_REQUEST_HANDLER_LIST_DELETE_BTN, "soapBinding.service.table.requestHandlerList.delete.button");
    propertySheetModel.setModel(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, tblModel);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel)

Example 87 with CCActionTableModel

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

the class SCSAML2SOAPBindingViewBean method populateRequestHandlerListTable.

private void populateRequestHandlerListTable(Set handlers) {
    tablePopulated = true;
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    tblModel.clearAll();
    boolean firstEntry = true;
    int counter = 0;
    for (Iterator iter = handlers.iterator(); iter.hasNext(); ) {
        String c = (String) iter.next();
        SAML2SOAPBindingRequestHandler entry = new SAML2SOAPBindingRequestHandler(c);
        if (entry.isValid()) {
            if (!firstEntry) {
                tblModel.appendRow();
            } else {
                firstEntry = false;
            }
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_DATA_KEY, entry.strKey);
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_DATA_CLASS, entry.strClass);
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_HREF_EDIT_ACTION, Integer.toString(counter));
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_LABEL_EDIT_ACTION, "soapBinding.service.table.requestHandlerList.action.edit.label");
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_HREF_DUP_ACTION, Integer.toString(counter));
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_LABEL_DUP_ACTION, "soapBinding.service.table.requestHandlerList.action.dup.label");
        }
        counter++;
    }
    setPageSessionAttribute(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, (OrderedSet) handlers);
}
Also used : SAML2SOAPBindingRequestHandler(com.sun.identity.console.service.model.SAML2SOAPBindingRequestHandler) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator)

Example 88 with CCActionTableModel

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

the class SCSOAPBindingViewBean method populateRequestHandlerListTable.

private void populateRequestHandlerListTable(Set handlers) {
    tablePopulated = true;
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    tblModel.clearAll();
    boolean firstEntry = true;
    int counter = 0;
    for (Iterator iter = handlers.iterator(); iter.hasNext(); ) {
        String c = (String) iter.next();
        SOAPBindingRequestHandler entry = new SOAPBindingRequestHandler(c);
        if (entry.isValid()) {
            if (!firstEntry) {
                tblModel.appendRow();
            } else {
                firstEntry = false;
            }
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_DATA_KEY, entry.strKey);
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_DATA_CLASS, entry.strClass);
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_HREF_EDIT_ACTION, Integer.toString(counter));
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_LABEL_EDIT_ACTION, "soapBinding.service.table.requestHandlerList.action.edit.label");
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_HREF_DUP_ACTION, Integer.toString(counter));
            tblModel.setValue(TBL_REQUEST_HANDLER_LIST_LABEL_DUP_ACTION, "soapBinding.service.table.requestHandlerList.action.dup.label");
        }
        counter++;
    }
    setPageSessionAttribute(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, (OrderedSet) handlers);
}
Also used : CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) Iterator(java.util.Iterator) SOAPBindingRequestHandler(com.sun.identity.console.service.model.SOAPBindingRequestHandler)

Example 89 with CCActionTableModel

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

the class SCServiceProfileViewBean method populateTableModel.

private void populateTableModel(List<SMSubConfig> subconfig) {
    CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
    CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
    tblModel.clearAll();
    if (subconfig != null) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        List<SMSubConfig> cache = new ArrayList<>(subconfig.size());
        if (!subconfig.isEmpty()) {
            tblModel.clearAll();
            boolean firstEntry = true;
            for (SMSubConfig conf : subconfig) {
                if (conf.isHidden()) {
                    continue;
                }
                if (firstEntry) {
                    firstEntry = false;
                } else {
                    tblModel.appendRow();
                }
                tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_DATA_NAME, conf.getLocalizedName() == null ? conf.getName() : conf.getLocalizedName());
                tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_HREF_NAME, conf.getName());
                tblModel.setValue(AMPropertySheetModel.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 90 with CCActionTableModel

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

the class SCSAML2SOAPBindingViewBean method handleTblRequestHandlerListButtonDeleteRequest.

/**
     * Handles remove request handlers request.
     *
     * @param event Request Invocation Event.
     */
public void handleTblRequestHandlerListButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    setSubmitCycle(true);
    CCActionTable table = (CCActionTable) getChild(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    table.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
    Integer[] selected = tblModel.getSelectedRows();
    if ((selected != null) && (selected.length > 0)) {
        OrderedSet tblValues = (OrderedSet) getPageSessionAttribute(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
        tblValues.removeAll(selected);
        setPageSessionAttribute(SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, tblValues);
        populateRequestHandlerListTable(tblValues);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.profile.modified");
        setPageSessionAttribute(PAGE_MODIFIED, "1");
    }
    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)

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