public static SearchContext getInstance(
long[] assetCategoryIds, String[] assetTagNames,
Map<String, Serializable> attributes, long companyId, String keywords,
Layout layout, Locale locale, long scopeGroupId, TimeZone timeZone,
long userId) {
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
searchContext.setGroupIds(new long[] {scopeGroupId});
searchContext.setLayout(layout);
searchContext.setLocale(locale);
searchContext.setTimeZone(timeZone);
searchContext.setUserId(userId);
if (attributes != null) {
searchContext.setAttributes(attributes);
}
else {
searchContext.setAttributes(new HashMap<String, Serializable>());
}
searchContext.setAssetCategoryIds(assetCategoryIds);
searchContext.setAssetTagNames(assetTagNames);
searchContext.setKeywords(keywords);
QueryConfig queryConfig = searchContext.getQueryConfig();
queryConfig.setLocale(locale);
return searchContext;
}