use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class EntityOpViewBeanBase method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
if (!submitCycle) {
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
EntitiesModel model = (EntitiesModel) getModel();
try {
String entityType = (String) getPageSessionAttribute(ENTITY_TYPE);
setDefaultValues(entityType);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class EntityOpViewBeanBase method createPropertySheetModel.
protected AMPropertySheetModel createPropertySheetModel(String type) {
AMPropertySheetModel psModel = null;
EntitiesModel model = (EntitiesModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String agentType = (String) getPageSessionAttribute(ENTITY_AGENT_TYPE);
try {
psModel = new AMPropertySheetModel(model.getPropertyXMLString(realmName, type, agentType, isCreateViewBean(), getClass().getName()));
} catch (AMConsoleException e) {
psModel = handleNoAttributeToDisplay(e);
}
return psModel;
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class EntityMembersFilteredIdentityViewBean method getMemberNames.
private void getMemberNames() {
EntitiesModel model = (EntitiesModel) getModel();
try {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String type = (String) getPageSessionAttribute(PG_SESSION_MEMBER_TYPE);
String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
Set entities = model.getMembers(curRealm, universalId, type);
CCSelectableList list = (CCSelectableList) getChild(MEMBERS);
list.setOptions(getOptionListForEntities(entities));
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class EntityMembershipViewBean method getMemberships.
private void getMemberships() {
if (!submitCycle) {
try {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String type = (String) getPageSessionAttribute(PG_SESSION_MEMBER_TYPE);
String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
if (cacheAssigned != null) {
assignedMembers = AMAdminUtils.toList(cacheAssigned);
} else {
EntitiesModel model = (EntitiesModel) getModel();
assignedMembers = new ArrayList();
assignedMembers.addAll(model.getMembership(curRealm, universalId, type));
}
if (canModify) {
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) propertySheetModel.getModel(ADD_REMOVE_MEMBERS);
addRemoveModel.clear();
if (cacheAssigned != null) {
addRemoveModel.setSelectedOptionList(cacheAssigned);
} else {
addRemoveModel.setSelectedOptionList(getOptionListForEntities(assignedMembers));
}
addRemoveModel.setAvailableOptionList(getAssignableMembership());
} else {
propertySheetModel.setValue(ADD_REMOVE_MEMBERS, AMAdminUtils.getString(getEntityDisplayNames(assignedMembers), ",", false));
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
if (canModify) {
CCAddRemove addRemove = (CCAddRemove) getChild(ADD_REMOVE_MEMBERS);
addRemove.resetStateData();
}
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class EntityResourceOfferingViewBeanBase method handleTblSecurityMechIDButtonAddRequest.
public void handleTblSecurityMechIDButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
try {
SMDiscoEntryData smData = getValues(false);
setPageSessionAttribute(EntityDiscoveryDescriptionViewBeanBase.PG_SESSION_DISCO_ENTRY_DATA, smData);
setPageSessionAttribute(EntityDiscoveryDescriptionViewBeanBase.PG_SESSION_RETURN_VIEW_BEAN_CLASSNAME, getClass().getName());
EntityDiscoveryDescriptionAddViewBean vb = (EntityDiscoveryDescriptionAddViewBean) getViewBean(EntityDiscoveryDescriptionAddViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
Aggregations