searchContext.setGroupIds(new long[] {themeDisplay.getScopeGroupId()}); searchContext.setLayout(themeDisplay.getLayout()); searchContext.setLocale(themeDisplay.getLocale());
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(); // Theme display searchContext.setCompanyId(companyId); searchContext.setGroupIds(new long[] {scopeGroupId}); searchContext.setLayout(layout); searchContext.setLocale(locale); searchContext.setTimeZone(timeZone); searchContext.setUserId(userId); // Attributes if (attributes != null) { searchContext.setAttributes(attributes); } else { searchContext.setAttributes(new HashMap<String, Serializable>()); } // Asset searchContext.setAssetCategoryIds(assetCategoryIds); searchContext.setAssetTagNames(assetTagNames); // Keywords searchContext.setKeywords(keywords); // Query config QueryConfig queryConfig = searchContext.getQueryConfig(); queryConfig.setLocale(locale); return searchContext; }
searchContext.setGroupIds(groupIds);
searchContext.setGroupIds(null); searchContext.setGroupIds(new long[] {groupId});
searchContext.setEnd(end); searchContext.setFolderIds(folderIds); searchContext.setGroupIds(new long[] {groupId});
protected SearchContext buildSearchContext( long groupId, long userId, long creatorUserId, int status, int start, int end) throws PortalException { SearchContext searchContext = new SearchContext(); searchContext.setAttribute(Field.STATUS, status); searchContext.setAttribute("paginationType", "none"); if (creatorUserId > 0) { searchContext.setAttribute( Field.USER_ID, String.valueOf(creatorUserId)); } Group group = groupLocalService.getGroup(groupId); searchContext.setCompanyId(group.getCompanyId()); searchContext.setEnd(end); searchContext.setGroupIds(new long[] {groupId}); searchContext.setSorts(new Sort(Field.MODIFIED_DATE, true)); searchContext.setStart(start); searchContext.setUserId(userId); return searchContext; }