use of com.sun.identity.console.federation.model.CreateMetaDataModel in project OpenAM by OpenRock.
the class CreateSAML2MetaDataViewBean method handleButton1Request.
/**
* Handles save button request.
* save
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
setPageSessionAttribute(getTrackingTabIDName(), AMAdminConstants.FED_TAB_ID);
setPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID, getTrackingTabIDName());
CreateMetaDataModel model = (CreateMetaDataModel) getModel();
try {
String realm = getDisplayFieldStringValue("singleChoiceRealm");
String entityId = getDisplayFieldStringValue("tfEntityId");
if ((realm == null) || (realm.trim().length() == 0)) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("samlv2.create.provider.missing.realm"));
forwardTo();
} else if ((entityId == null) || (entityId.trim().length() == 0)) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("samlv2.create.provider.missing.entityId"));
forwardTo();
} else {
Map map = getWorkflowParamMap(realm, model);
if (protocol.equals(PROTO_SAMLv2)) {
model.createSAMLv2Provider(realm, entityId, map);
} else if (protocol.equals(PROTO_IDFF)) {
model.createIDFFProvider(realm, entityId, map);
} else {
model.createWSFedProvider(realm, entityId, map);
}
backTrail();
FederationViewBean vb = (FederationViewBean) getViewBean(FederationViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.federation.model.CreateMetaDataModel in project OpenAM by OpenRock.
the class CreateSAML2MetaDataViewBean method populateRealmData.
private void populateRealmData() {
CreateMetaDataModel model = (CreateMetaDataModel) getModel();
try {
Set realmNames = new TreeSet(model.getRealmNames("/", "*"));
CCDropDownMenu menu = (CCDropDownMenu) getChild("singleChoiceRealm");
OptionList list = new OptionList();
for (Iterator i = realmNames.iterator(); i.hasNext(); ) {
String name = (String) i.next();
list.add(getPath(name), name);
}
menu.setOptions(list);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
Aggregations