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);
}
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();
}
Aggregations