use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.
the class RealmPropertiesViewBean method createPropertyModel.
private void createPropertyModel(String realmName) {
RMRealmModel model = (RMRealmModel) getModel();
try {
psModel = new AMPropertySheetModel(model.getRealmProfilePropertyXML(realmName, getClass().getName()));
psModel.clear();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.
the class RealmPropertiesViewBean method handleButton1Request.
/**
* Handles save button request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
RMRealmModel model = (RMRealmModel) getModel();
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
AMPropertySheet ps = (AMPropertySheet) getChild(REALM_PROPERTIES);
try {
Map orig = model.getAttributeValues(realm);
Map values = ps.getAttributeValues(orig, true, true, model);
model.setAttributeValues(realm, values);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.
the class RealmPropertiesViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
if (!isJatoSessionRequestFromXUI(getRequestContext().getRequest()) && isXuiAdminConsoleEnabled()) {
String redirectRealm = getRedirectRealm(this);
redirectToXui(getRequestContext().getRequest(), redirectRealm, MessageFormat.format("realms/{0}/dashboard", Uris.urlEncodePathElement(redirectRealm)));
return;
}
super.beginDisplay(event);
RMRealmModel model = (RMRealmModel) getModel();
if (model != null) {
if (!submitCycle) {
String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
AMPropertySheet ps = (AMPropertySheet) getChild(REALM_PROPERTIES);
psModel.clear();
try {
ps.setAttributeValues(model.getAttributeValues(realm), model);
} catch (AMConsoleException a) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "no.properties");
}
}
setPageTitle(getModel(), "page.title.realms.properties");
}
}
use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.
the class RMRealmViewBean method getRealmNames.
private void getRealmNames() {
RMRealmModel model = (RMRealmModel) getModel();
String filter = ((String) getDisplayFieldValue(TF_FILTER));
if ((filter == null) || (filter.length() == 0)) {
filter = "*";
setDisplayFieldValue(TF_FILTER, "*");
} else {
filter = filter.trim();
}
try {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
populateTableModel(model.getRealmNames(curRealm, filter));
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.realm.model.RMRealmModel in project OpenAM by OpenRock.
the class RMRealmAddViewBean method populateRealmParentList.
private void populateRealmParentList() {
RMRealmModel model = (RMRealmModel) getModel();
Set realms = new HashSet();
try {
realms = model.getRealmNames(model.getStartDN(), "*");
} catch (AMConsoleException a) {
// do something here
}
Map display = new HashMap(realms.size() * 2);
for (Iterator i = realms.iterator(); i.hasNext(); ) {
String tmp = (String) i.next();
String path = getPath(tmp);
display.put(tmp, path);
}
OptionList optionList = createOptionList(display);
CCSelectableList parentList = (CCSelectableList) getChild(RMRealmModel.TF_PARENT);
parentList.setOptions(optionList);
String value = (String) parentList.getValue();
if ((value == null) || (value.length() == 0)) {
Option opt = optionList.get(0);
parentList.setValue(opt.getValue());
}
}
Aggregations