use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class MAPCreateDeviceTwoViewBean method handleButton2Request.
/**
* Handles create device request.
*
* @param event Request Invocation Event.
*/
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
MAPCreateDeviceModel model = (MAPCreateDeviceModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
try {
Map values = ps.getAttributeValues(model.getCreateDeviceAttributeNames());
Set setParentId = new HashSet(2);
setParentId.add(attrParentId);
values.put("parentId", setParentId);
model.createDevice(values);
MAPDeviceProfileViewBean vb = (MAPDeviceProfileViewBean) getViewBean(MAPDeviceProfileViewBean.class);
vb.deviceName = (String) AMAdminUtils.getValue((Set) values.get(MAPCreateDeviceModel.ATTRIBUTE_NAME_CLIENT_TYPE));
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} 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 SCPropertiesBase method getValues.
protected Map getValues() throws ModelControlException, AMConsoleException {
SCModel model = (SCModel) getModel();
Map values = null;
Map orig = model.getValues();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
// pass true to get only the values that have been modified
return ps.getAttributeValues(orig, true, model);
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class ServerAddViewBean method handleButton1Request.
/**
* Handles create server request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
ServerSiteModel model = (ServerSiteModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String name = (String) getDisplayFieldValue(TF_NAME);
name = name.trim();
if (name.length() > 0) {
try {
FQDNUrl test = new FQDNUrl(name);
if ((!test.isFullyQualified()) || (test.getPort().length() == 0) || (test.getURI().length() == 0)) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "serverconfig.create.site.invalid.url");
forwardTo();
} else {
model.createServer(name);
backTrail();
ServerSiteViewBean vb = (ServerSiteViewBean) getViewBean(ServerSiteViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
} catch (MalformedURLException mue) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", mue.getMessage());
forwardTo();
}
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "serverconfig.create.site.missing.attributes");
forwardTo();
}
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class ServerCloneViewBean method handleButton1Request.
/**
* Handles clone server request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
ServerSiteModel model = (ServerSiteModel) getModel();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
String name = (String) getDisplayFieldValue(TF_NAME);
name = name.trim();
if (name.length() > 0) {
try {
model.cloneServer(serverName, name);
backTrail();
ServerSiteViewBean vb = (ServerSiteViewBean) getViewBean(ServerSiteViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
} else {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "serverconfig.clone.server.missing.atributes");
forwardTo();
}
}
use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.
the class STSAddViewBeanBase method getAttributeSettings.
/*
Returns a map of all settings, including those not changed from the default values in the model.
AMConsoleException will be thrown if passwords are mis-matched.
*/
private Map getAttributeSettings() throws ModelControlException, AMConsoleException {
Map values = null;
AMServiceProfileModel model = (AMServiceProfileModel) getModel();
if (model != null) {
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
values = ps.getAttributeValues(model.getAttributeValues(), false, model);
}
return values;
}
Aggregations