use of org.akaza.openclinica.domain.rule.action.ActionType in project OpenClinica by OpenClinica.
the class ViewRuleAssignmentTableFactory method getViewRuleAssignmentFilter.
/**
* A very custom way to filter the items. The AuditUserLoginFilter acts as a command for the Hibernate criteria object.
* Take the Limit information and filter the rows.
*
* @param limit The Limit to use.
*/
protected ViewRuleAssignmentFilter getViewRuleAssignmentFilter(Limit limit) {
ViewRuleAssignmentFilter viewRuleAssignmentFilter = new ViewRuleAssignmentFilter();
FilterSet filterSet = limit.getFilterSet();
Collection<Filter> filters = filterSet.getFilters();
for (Filter filter : filters) {
String property = filter.getProperty();
String value = filter.getValue();
if ("ruleSetRuleStatus".equals(property)) {
Status s = Status.getByI18nDescription(value, locale);
int code = s != null ? s.getCode() : -1;
value = code > 0 ? Status.getByCode(code).getCode() + "" : "0";
} else if ("actionType".equals(property)) {
ActionType a = ActionType.getByDescription(value);
value = a != null ? a.getCode() + "" : value;
}
viewRuleAssignmentFilter.addFilter(property, value);
}
return viewRuleAssignmentFilter;
}
Aggregations