use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class PMDefaultTimeConditionAddViewBean method getValues.
protected Map getValues(String conditionType) throws ModelControlException {
PolicyModel model = (PolicyModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
Map values = getConditionValues(model, realmName, conditionType);
return helper.getConditionValues(this, values);
}
use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class PMDefaultTimeConditionEditViewBean method getValues.
protected Map getValues(String conditionType) throws ModelControlException {
PolicyModel model = (PolicyModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
Map values = getConditionValues(model, realmName, conditionType);
return helper.getConditionValues(this, values);
}
use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class RuleEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
if (!submitCycle) {
try {
Rule rule = getRule();
propertySheetModel.setValue(RULE_NAME, rule.getName());
String serviceType = rule.getServiceTypeName();
propertySheetModel.setValue(SERVICE_TYPE, serviceType);
PolicyModel model = (PolicyModel) getModel();
Map map = model.getServiceTypeNames();
String i18nName = (String) map.get(serviceType);
propertySheetModel.setValue(SERVICE_TYPE_NAME_LBL, i18nName);
propertySheetModel.setValue(SERVICE_TYPE_NAME, i18nName);
propertySheetModel.setValue(RESOURCE_NAME, rule.getResourceName());
} catch (NameNotFoundException e) {
debug.error("RuleEditViewBean.beginDisplay: rule not found.");
} catch (AMConsoleException e) {
debug.warning("RuleEditViewBean.beginDisplay", e);
}
} else {
String i18nName = (String) propertySheetModel.getValue(SERVICE_TYPE_NAME);
propertySheetModel.setValue(SERVICE_TYPE_NAME_LBL, i18nName);
}
try {
populateActionsTable(submitCycle);
} catch (AMConsoleException e) {
debug.warning("RuleEditViewBean.beginDisplay", e);
//NO-OP
}
}
use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class RuleOpViewBeanBase method getActionValues.
private Map getActionValues(String serviceType, boolean withResource) throws ModelControlException {
Map actionValues = new HashMap();
PolicyModel model = (PolicyModel) getModel();
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
try {
Map mapActionSchemas = mapActionSchemaNameToActionSchema(model.getActionSchemas(getCachedPolicy().getPolicy(), realmName, serviceType, withResource));
CCActionTable table = (CCActionTable) getChild(TBL_ACTIONS);
table.restoreStateData();
List actionSchemaNames = (List) getPageSessionAttribute(PG_SESSION_ACTION_SCHEMA_NAMES);
if ((actionSchemaNames != null) && !actionSchemaNames.isEmpty()) {
HttpServletRequest req = getRequestContext().getRequest();
String chkName = getName() + "." + SELECTION_CHKBOX_NAME;
int sz = actionSchemaNames.size();
for (int i = 0; i < sz; i++) {
String chkValue = req.getParameter(chkName + i);
if ((chkValue != null) && chkValue.equals("true")) {
String actionSchemaName = (String) actionSchemaNames.get(i);
ActionSchema actionSchema = (ActionSchema) mapActionSchemas.get(actionSchemaName);
Set values = getActionSchemaValues(actionSchema, i);
actionValues.put(actionSchemaName, values);
}
}
}
if (actionValues.isEmpty()) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.missing.actionValues");
actionValues = null;
}
} catch (AMConsoleException e) {
debug.warning("RuleOpViewBeanBase.getActionValues", e);
//NO-OP
}
return actionValues;
}
use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class SelectSubjectTypeViewBean method handleButton2Request.
/**
* Handles next button request.
*
* @param event Request invocation event.
*/
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
PolicyModel model = (PolicyModel) getModel();
String subjectType = (String) propertySheetModel.getValue(ATTR_SUBJECT_TYPE);
setPageSessionAttribute(SubjectOpViewBeanBase.CALLING_VIEW_BEAN, (String) getPageSessionAttribute(CALLING_VIEW_BEAN));
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String viewBeanURL = model.getSubjectViewBeanURL(realmName, subjectType);
unlockPageTrailForSwapping();
if ((viewBeanURL != null) && (viewBeanURL.trim().length() > 0)) {
forwardToURL(viewBeanURL, subjectType, realmName);
} else {
forwardToViewBean(model, subjectType, realmName);
}
}
Aggregations