use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class SubConfigEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
SubConfigModel model = (SubConfigModel) getModel();
if (!submitCycle) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
propertySheetModel.clear();
try {
// If this is a dynamic request the UI is set with unsaved attribute values
if (dynamicRequest) {
ps.setAttributeValues(unsavedAttributeValues, model);
} else {
ps.setAttributeValues(model.getSubConfigAttributeValues(), model);
}
} catch (AMConsoleException a) {
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "noproperties.message");
}
}
if (model.hasGlobalSubSchema()) {
if (!submitCycle) {
populateTableModel(model.getSubConfigurations());
}
resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_DELETE);
Map createable = model.getCreateableSubSchemaNames();
if (createable.isEmpty()) {
resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_ADD);
}
}
ptModel.setPageTitleText(MessageFormat.format(model.getLocalizedString("page.title.services.edit.subconfig"), model.getDisplayName()));
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class SubConfigAddViewBean method handleButton1Request.
/**
* Handles next button request.
*
* @param event Request invocation event.
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
String subConfigName = (String) getDisplayFieldValue(ATTR_SUBCONFIG_NAME);
SubConfigModel model = (SubConfigModel) getModel();
try {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String schemaName = (String) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME);
Map values = ps.getAttributeValues(model.getAttributeNames(schemaName));
model.createSubConfig(subConfigName, schemaName, values);
backToProfileViewBean();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class SubConfigAddViewBean method getAttributeValueMap.
@Override
protected Map<String, Set<String>> getAttributeValueMap() {
try {
SubConfigModel model = (SubConfigModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String schemaName = (String) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME);
return ps.getAttributeValues(model.getAttributeNames(schemaName));
} catch (AMConsoleException | ModelControlException e) {
debug.error("Could not retrieve attribute values", e);
}
return Collections.emptyMap();
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class SubConfigEditViewBean method handleButton1Request.
/**
* Handles next button request.
*
* @param event Request invocation event.
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
SubConfigModel model = (SubConfigModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
try {
Map orig = model.getSubConfigAttributeValues();
Map values = ps.getAttributeValues(orig, true, true, model);
model.setSubConfigAttributeValues(values);
backToProfileViewBean();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class AgentAddViewBean method handleButton1Request.
/**
* Handles create request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) {
AgentsModel model = (AgentsModel) getModel();
String agentType = getAgentType();
AMPropertySheet prop = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String agentName = (String) propertySheetModel.getValue(TF_NAME);
agentName = agentName.trim();
String password = (String) propertySheetModel.getValue(TF_PASSWORD);
String passwordConfirm = (String) propertySheetModel.getValue(TF_PASSWORD_CONFIRM);
password = password.trim();
passwordConfirm = passwordConfirm.trim();
String choice = (String) propertySheetModel.getValue(RADIO_CHOICE);
if (password.length() > 0) {
if (password.equals(passwordConfirm)) {
try {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
if (agentType.equals(AgentConfiguration.AGENT_TYPE_J2EE) || agentType.equals(AgentConfiguration.AGENT_TYPE_WEB)) {
String agentURL = (String) propertySheetModel.getValue(TF_AGENT_URL);
agentURL = agentURL.trim();
if (choice.equals(AgentsViewBean.PROP_LOCAL)) {
model.createAgentLocal(curRealm, agentName, agentType, password, agentURL);
} else {
String serverURL = (String) propertySheetModel.getValue(TF_SERVER_URL);
serverURL = serverURL.trim();
model.createAgent(curRealm, agentName, agentType, password, serverURL, agentURL);
}
} else {
model.createAgent(curRealm, agentName, agentType, password, choice);
}
forwardToAgentsViewBean();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("agents.passwords.not.match"));
forwardTo();
}
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("agents.password.blank"));
forwardTo();
}
}
Aggregations