use of org.entando.entando.aps.system.services.dataobject.widget.UserFilterOptionBean in project entando-core by entando.
the class FilterUtils method getUserFilters.
public static List<UserFilterOptionBean> getUserFilters(String userFiltersParam, Integer currentFrame, Lang currentLang, IApsEntity prototype, String dateFormat, HttpServletRequest request) {
if (null == userFiltersParam) {
return new ArrayList<UserFilterOptionBean>();
}
List<UserFilterOptionBean> list = new ArrayList<UserFilterOptionBean>();
String[] filterStrings = userFiltersParam.split("\\+");
for (int i = 0; i < filterStrings.length; i++) {
String fullFilterString = filterStrings[i];
try {
String toStringFilter = fullFilterString.substring(1, fullFilterString.length() - 1);
Properties properties = getProperties(toStringFilter, DEFAULT_FILTER_PARAM_SEPARATOR);
UserFilterOptionBean filterBean = new UserFilterOptionBean(properties, prototype, currentFrame, currentLang, dateFormat, request);
list.add(filterBean);
} catch (Throwable t) {
_logger.error("Error extracting user filter by string '{}' for type '{}'", fullFilterString, prototype.getTypeCode(), t);
}
}
return list;
}
use of org.entando.entando.aps.system.services.dataobject.widget.UserFilterOptionBean in project entando-core by entando.
the class FilterUtils method getUserFilter.
public UserFilterOptionBean getUserFilter(String dataObjectType, IEntityFilterBean bean, IDataObjectManager dataObjectManager, String dateFormat, RequestContext reqCtx) {
UserFilterOptionBean filter = null;
try {
IApsEntity prototype = dataObjectManager.createDataObject(dataObjectType);
Properties props = new Properties();
props.setProperty(UserFilterOptionBean.PARAM_KEY, bean.getKey());
props.setProperty(UserFilterOptionBean.PARAM_IS_ATTRIBUTE_FILTER, String.valueOf(bean.isAttributeFilter()));
Lang currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
Integer currentFrame = (Integer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME);
filter = new UserFilterOptionBean(props, prototype, currentFrame, currentLang, dateFormat, reqCtx.getRequest());
} catch (Throwable t) {
_logger.error("Error creating user filter", t);
// ApsSystemUtils.logThrowable(t, FilterUtils.class, "getUserFilter", "Error creating user filter");
}
return filter;
}
Aggregations