Search in sources :

Example 1 with AssetEntryQuery

use of com.liferay.portlet.asset.service.persistence.AssetEntryQuery in project liferay-ide by liferay.

the class KBArticleAssetEntriesUtil method getAssetEntries.

public static List<AssetEntry> getAssetEntries(long[] groupIds, long[] classNameIds, long[] assetTagIds, long resourcePrimKey, int start, int end, String orderByColumn) throws PortalException, SystemException {
    AssetEntryQuery assetEntryQuery = new AssetEntryQuery();
    assetEntryQuery.setAnyTagIds(assetTagIds);
    assetEntryQuery.setClassNameIds(classNameIds);
    assetEntryQuery.setEnd(end + 1);
    assetEntryQuery.setGroupIds(groupIds);
    assetEntryQuery.setOrderByCol1(orderByColumn);
    assetEntryQuery.setStart(start);
    List<AssetEntry> assetEntries = ListUtil.copy(AssetEntryServiceUtil.getEntries(assetEntryQuery));
    AssetEntry assetEntry = null;
    for (AssetEntry curAssetEntry : assetEntries) {
        if (curAssetEntry.getClassPK() == resourcePrimKey) {
            assetEntry = curAssetEntry;
        }
    }
    assetEntries.remove(assetEntry);
    return ListUtil.subList(assetEntries, 0, 10);
}
Also used : AssetEntry(com.liferay.portlet.asset.model.AssetEntry) AssetEntryQuery(com.liferay.portlet.asset.service.persistence.AssetEntryQuery)

Aggregations

AssetEntry (com.liferay.portlet.asset.model.AssetEntry)1 AssetEntryQuery (com.liferay.portlet.asset.service.persistence.AssetEntryQuery)1