use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.
the class ServicesEditViewBean method forwardTo.
public void forwardTo(RequestContext reqContext) throws NavigationException {
String serviceName = (String) getPageSessionAttribute(SERVICE_NAME);
EntitiesModel model = (EntitiesModel) getModel();
// Check if the selected service has attributes to display.
if (model.hasDisplayableAttributes(serviceName)) {
initialize(serviceName);
super.forwardTo(reqContext);
} else {
ServicesNoAttributeViewBean vb = (ServicesNoAttributeViewBean) getViewBean(ServicesNoAttributeViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(reqContext);
}
}
use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.
the class ServicesNoAttributeViewBean method getBreadCrumbDisplayName.
protected String getBreadCrumbDisplayName() {
EntitiesModel model = (EntitiesModel) getModel();
String lserviceName = model.getLocalizedServiceName((String) getPageSessionAttribute(SERVICE_NAME));
String[] param = { lserviceName };
return MessageFormat.format(model.getLocalizedString("breadcrumbs.editentities.editservice"), (Object[]) param);
}
use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.
the class ServicesSelectViewBean method handleButton2Request.
/**
* Handles assigned button request.
*
* @param event Request invocation event.
*/
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
String serviceName = (String) getDisplayFieldValue(ATTR_SERVICE_LIST);
String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
EntitiesModel model = (EntitiesModel) getModel();
if (model.hasUserAttributeSchema(serviceName)) {
unlockPageTrailForSwapping();
fowardToAddServiceViewBean(model, universalId, serviceName);
} else {
try {
model.assignService(universalId, serviceName, Collections.EMPTY_MAP);
forwardToEntityServiceViewBean();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
}
use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.
the class ServicesAddViewBean method handleButton2Request.
/**
* Handles add service request.
*
* @param event Request invocation event.
*/
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
EntitiesModel model = (EntitiesModel) getModel();
try {
Map values = getValues();
String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
String serviceName = (String) getPageSessionAttribute(SERVICE_NAME);
model.assignService(universalId, serviceName, values);
forwardToServicesViewBean();
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.idm.model.EntitiesModel in project OpenAM by OpenRock.
the class ServicesEditViewBean method handleButton1Request.
/**
* Handles add service request.
*
* @param event Request invocation event.
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
EntitiesModel model = (EntitiesModel) getModel();
try {
Map values = getValues();
String universalId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
String serviceName = (String) getPageSessionAttribute(SERVICE_NAME);
model.setServiceAttributeValues(universalId, serviceName, values);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations