use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.
the class SubSchemaTypeSelectViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
SubConfigModel model = (SubConfigModel) getModel();
Map createables = model.getCreateableSubSchemaNames();
CCRadioButton rb = (CCRadioButton) getChild(RB_SUBCONFIG);
OptionList optList = AMFormatUtils.getSortedOptionList(createables, model.getUserLocale());
rb.setOptions(optList);
String val = (String) rb.getValue();
if ((val == null) || (val.length() == 0)) {
rb.setValue(optList.getValue(0));
}
}
use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.
the class SubConfigEditViewBean method createChild.
protected View createChild(String name) {
if (!populatedSubConfigTable && name.equals(AMPropertySheetModel.TBL_SUB_CONFIG)) {
populatedSubConfigTable = true;
SubConfigModel model = (SubConfigModel) getModel();
if (model.hasGlobalSubSchema()) {
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
populateTableModel(szCache.<List<SMSubConfig>>getSerializedObj());
}
}
View view = null;
if (name.equals(PGTITLE_TWO_BTNS)) {
view = new CCPageTitle(this, ptModel, name);
} else if (name.equals(PROPERTY_ATTRIBUTE)) {
view = new AMPropertySheet(this, propertySheetModel, name);
} else if (propertySheetModel.isChildSupported(name)) {
view = propertySheetModel.createChild(this, name, getModel());
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.
the class SubConfigEditViewBean method createPropertyModel.
private void createPropertyModel() {
try {
SubConfigModel model = (SubConfigModel) getModel();
propertySheetModel = new AMPropertySheetModel(model.getEditConfigPropertyXML(getClass().getName()));
propertySheetModel.clear();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.
the class SubConfigEditViewBean method getAttributeValueMap.
@Override
protected Map<String, Set<String>> getAttributeValueMap() {
try {
SubConfigModel model = (SubConfigModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
return ps.getAttributeValues(model.getSubConfigAttributeValues().keySet());
} catch (AMConsoleException e) {
debug.error("Could not retrieve attribute values", e);
} catch (ModelControlException e) {
debug.error("Could not retrieve attribute values", e);
}
return Collections.emptyMap();
}
use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.
the class SubConfigEditViewBean method handleTblSubConfigButtonAddRequest.
/**
* Adds sub configuration.
*
* @param event Request Invocation Event.
*/
public void handleTblSubConfigButtonAddRequest(RequestInvocationEvent event) {
SubConfigModel model = (SubConfigModel) getModel();
Map createable = model.getCreateableSubSchemaNames();
if (!createable.isEmpty()) {
if (createable.size() > 1) {
SubSchemaTypeSelectViewBean vb = (SubSchemaTypeSelectViewBean) getViewBean(SubSchemaTypeSelectViewBean.class);
addViewBeanClassToPageSession();
unlockPageTrail();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} else {
String subSchema = (String) createable.keySet().iterator().next();
setPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME, subSchema);
SubConfigAddViewBean vb = (SubConfigAddViewBean) getViewBean(SubConfigAddViewBean.class);
addViewBeanClassToPageSession();
unlockPageTrail();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
} else {
forwardTo();
}
}
Aggregations