use of com.agiletec.aps.system.common.entity.helper.BaseFilterUtils in project entando-core by entando.
the class ApiContentListBean method getListName.
public String getListName() {
StringBuffer buffer = new StringBuffer("listName_api");
buffer.append("-TYPE:" + this.getContentType());
buffer.append("_FILTERS:");
if (null != this.getFilters() && this.getFilters().length > 0) {
BaseFilterUtils filterUtils = new BaseFilterUtils();
buffer.append(filterUtils.getFilterParam(this.getFilters()));
} else {
buffer.append("NULL");
}
buffer.append("_CATEGORIES:");
if (null != this.getCategories() && this.getCategories().length > 0) {
List<String> categories = Arrays.asList(this.getCategories());
Collections.sort(categories);
for (int i = 0; i < categories.size(); i++) {
if (i > 0) {
buffer.append("+");
}
buffer.append(categories.get(i));
}
} else {
buffer.append("NULL");
}
return buffer.toString();
}
use of com.agiletec.aps.system.common.entity.helper.BaseFilterUtils in project entando-core by entando.
the class ApiUserProfileInterface method getUserProfiles.
public List<String> getUserProfiles(Properties properties) throws Throwable {
List<String> usernames = null;
try {
String userProfileType = properties.getProperty("typeCode");
IUserProfile prototype = (IUserProfile) this.getUserProfileManager().getEntityPrototype(userProfileType);
if (null == prototype) {
throw new ApiException(IApiErrorCodes.API_PARAMETER_VALIDATION_ERROR, "Profile Type '" + userProfileType + "' does not exist", Response.Status.CONFLICT);
}
String langCode = properties.getProperty(SystemConstants.API_LANG_CODE_PARAMETER);
String filtersParam = properties.getProperty("filters");
BaseFilterUtils filterUtils = new BaseFilterUtils();
EntitySearchFilter[] filters = filterUtils.getFilters(prototype, filtersParam, langCode);
usernames = this.getUserProfileManager().searchId(userProfileType, filters);
} catch (ApiException ae) {
throw ae;
} catch (Throwable t) {
_logger.error("Error searching usernames", t);
// ApsSystemUtils.logThrowable(t, this, "getUserProfiles");
throw new ApsSystemException("Error searching usernames", t);
}
return usernames;
}
Aggregations