use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method forwardTo.
/**
* Forwards to Message View Bean if there are no profiles.
*
* @param reqContext Request Context.
* @throws NavigationException if model object is not accessible.
*/
public void forwardTo(RequestContext reqContext) throws NavigationException {
MAPServiceModel model = (MAPServiceModel) getModel();
Set profileNames = model.getProfileNames();
if ((profileNames == null) || profileNames.isEmpty()) {
MessageViewBean vb = (MessageViewBean) getViewBean(MessageViewBean.class);
vb.setMessage(CCAlert.TYPE_INFO, "message.information", "map.no.profiles");
vb.forwardTo(reqContext);
} else {
super.forwardTo(reqContext);
}
}
use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method deleteDevice.
private void deleteDevice(String deviceName, String message) {
MAPServiceModel model = (MAPServiceModel) getModel();
try {
model.removeClient(deviceName);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", message);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method createTab.
private View createTab(String name) {
CCTabsModel tabModel = new CCTabsModel();
MAPServiceModel model = (MAPServiceModel) getModel();
Set profileNames = model.getProfileNames();
if ((profileNames != null) && !profileNames.isEmpty()) {
for (Iterator iter = profileNames.iterator(); iter.hasNext(); ) {
String val = (String) iter.next();
tabModel.addNode(new CCNavNode(val.hashCode(), val, val, val));
}
tabModel.setSelectedNode(getProfileName().hashCode());
}
return new CCTabs(this, tabModel, name);
}
use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method getProfileName.
private String getProfileName(int nodeID) {
MAPServiceModel model = (MAPServiceModel) getModel();
Set profileNames = model.getProfileNames();
String profileName = null;
if ((profileNames != null) && !profileNames.isEmpty()) {
for (Iterator iter = profileNames.iterator(); iter.hasNext() && (profileName == null); ) {
String val = (String) iter.next();
if (val.hashCode() == nodeID) {
profileName = val;
}
}
}
return profileName;
}
use of com.sun.identity.console.service.model.MAPServiceModel in project OpenAM by OpenRock.
the class MAPClientManagerViewBean method setStyles.
private void setStyles() {
MAPServiceModel model = (MAPServiceModel) getModel();
Set styles = model.getStyleNames(getProfileName());
if ((styles != null) && !styles.isEmpty()) {
OptionList styleList = new OptionList();
for (Iterator iter = styles.iterator(); iter.hasNext(); ) {
String name = (String) iter.next();
styleList.add(name, name);
}
CCDropDownMenu menu = (CCDropDownMenu) getChild(SINGLECHOICE_STYLE);
menu.setOptions(styleList);
}
}
Aggregations