Search in sources :

Example 1 with CCOrderableList

use of com.sun.web.ui.view.orderablelist.CCOrderableList in project OpenAM by OpenRock.

the class ReorderAuthChainsViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    CCOrderableList list = (CCOrderableList) getChild(REORDER_LIST);
    CCOrderableListModel model = (CCOrderableListModel) list.getModel();
    String xml = (String) getPageSessionAttribute(AuthConfigViewBean.ENTRY_LIST);
    List chains = new ArrayList(AMAuthConfigUtils.xmlToAuthConfigurationEntry(xml));
    OptionList optList = new OptionList();
    int sz = chains.size();
    for (int i = 0; i < sz; i++) {
        AuthConfigurationEntry entry = (AuthConfigurationEntry) chains.get(i);
        String name = entry.getLoginModuleName();
        String flag = entry.getControlFlag();
        String options = entry.getOptions();
        String displayName = name + " - " + flag;
        if ((options != null) && (options.trim().length() > 0)) {
            displayName += " - " + options;
        }
        optList.add(displayName, Integer.toString(i));
    }
    model.setSelectedOptionList(optList);
}
Also used : CCOrderableListModel(com.sun.web.ui.model.CCOrderableListModel) ArrayList(java.util.ArrayList) CCOrderableList(com.sun.web.ui.view.orderablelist.CCOrderableList) ArrayList(java.util.ArrayList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) CCOrderableList(com.sun.web.ui.view.orderablelist.CCOrderableList) OptionList(com.iplanet.jato.view.html.OptionList) AuthConfigurationEntry(com.sun.identity.authentication.config.AuthConfigurationEntry)

Example 2 with CCOrderableList

use of com.sun.web.ui.view.orderablelist.CCOrderableList in project OpenAM by OpenRock.

the class ReorderAuthChainsViewBean method handleButton1Request.

/**
     * Handles change request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    String xml = (String) getPageSessionAttribute(AuthConfigViewBean.ENTRY_LIST);
    List chains = new ArrayList(AMAuthConfigUtils.xmlToAuthConfigurationEntry(xml));
    List newChains = new ArrayList();
    CCOrderableList list = (CCOrderableList) getChild(REORDER_LIST);
    list.restoreStateData();
    CCOrderableListModel model = (CCOrderableListModel) list.getModel();
    OptionList optList = model.getSelectedOptionList();
    int sz = optList.size();
    for (int i = 0; i < sz; i++) {
        String idx = optList.getValue(i);
        int num = Integer.parseInt(idx);
        newChains.add(chains.get(num));
    }
    setPageSessionAttribute(AuthConfigViewBean.ENTRY_LIST, AMAuthConfigUtils.authConfigurationEntryToXMLString(newChains));
    forwardToAuthConfigViewBean();
}
Also used : CCOrderableListModel(com.sun.web.ui.model.CCOrderableListModel) ArrayList(java.util.ArrayList) CCOrderableList(com.sun.web.ui.view.orderablelist.CCOrderableList) ArrayList(java.util.ArrayList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) CCOrderableList(com.sun.web.ui.view.orderablelist.CCOrderableList) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

OptionList (com.iplanet.jato.view.html.OptionList)2 CCOrderableListModel (com.sun.web.ui.model.CCOrderableListModel)2 CCOrderableList (com.sun.web.ui.view.orderablelist.CCOrderableList)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 AuthConfigurationEntry (com.sun.identity.authentication.config.AuthConfigurationEntry)1