List of usage examples for com.liferay.portal.kernel.dao.search SearchContainer SearchContainer
public SearchContainer()
From source file:com.liferay.asset.publisher.lar.test.AssetPublisherExportImportTest.java
License:Open Source License
protected void testDynamicExportImport(Map<String, String[]> preferenceMap, List<AssetEntry> expectedAssetEntries, boolean filtering) throws Exception { if (filtering) { // Creating entries to validate filtering addAssetEntries(group, 2, new ArrayList<AssetEntry>(), ServiceContextTestUtil.getServiceContext()); }/*from www .j a v a 2s.c om*/ String scopeId = _assetPublisherHelper.getScopeId(group, group.getGroupId()); preferenceMap.put("scopeIds", new String[] { scopeId }); preferenceMap.put("selectionStyle", new String[] { "dynamic" }); PortletPreferences portletPreferences = getImportedPortletPreferences(preferenceMap); Company company = CompanyLocalServiceUtil.getCompany(TestPropsValues.getCompanyId()); AssetEntryQuery assetEntryQuery = _assetPublisherHelper.getAssetEntryQuery(portletPreferences, importedGroup.getGroupId(), layout, null, null); SearchContainer<AssetEntry> searchContainer = new SearchContainer<>(); searchContainer.setTotal(10); List<AssetEntryResult> actualAssetEntryResults = _assetPublisherHelper.getAssetEntryResults(searchContainer, assetEntryQuery, layout, portletPreferences, StringPool.BLANK, null, null, company.getCompanyId(), importedGroup.getGroupId(), TestPropsValues.getUserId(), assetEntryQuery.getClassNameIds(), null); List<AssetEntry> actualAssetEntries = new ArrayList<>(); for (AssetEntryResult assetEntryResult : actualAssetEntryResults) { actualAssetEntries.addAll(assetEntryResult.getAssetEntries()); } assertAssetEntries(expectedAssetEntries, actualAssetEntries); }
From source file:com.liferay.asset.publisher.web.util.AssetRSSUtil.java
License:Open Source License
protected static List<AssetEntry> getAssetEntries(PortletRequest portletRequest, PortletResponse portletResponse, PortletPreferences portletPreferences) throws Exception { List<AssetEntry> assetEntries = new ArrayList<>(); SearchContainer searchContainer = new SearchContainer(); AssetPublisherCustomizer assetPublisherCustomizer = (AssetPublisherCustomizer) portletRequest .getAttribute(AssetPublisherWebKeys.ASSET_PUBLISHER_CUSTOMIZER); AssetPublisherDisplayContext assetPublisherDisplayContext = new AssetPublisherDisplayContext( assetPublisherCustomizer, portletRequest, portletResponse, portletPreferences); searchContainer.setDelta(assetPublisherDisplayContext.getRSSDelta()); List<AssetEntryResult> assetEntryResults = AssetPublisherUtil .getAssetEntryResults(assetPublisherDisplayContext, searchContainer, portletPreferences); for (AssetEntryResult assetEntryResult : assetEntryResults) { assetEntries.addAll(assetEntryResult.getAssetEntries()); }//from ww w . j a v a 2s . c o m return assetEntries; }