Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
venka reddy
Asset Entry
June 10, 2013 7:25 AM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi,

I am retrieving the Blog entry by tags , Here is the code as follows, But i am not able to retrieve the custom attributes values,How can i retrieve the custom attributes ?

AssetEntryQuery assetEntryQuery = new AssetEntryQuery();
assetEntryQuery.setClassNameIds(new long[]{PortalUtil.getClassNameId(DLFileEntry.class)});
assetEntryQuery.setAllCategoryIds(new long[] {10111});

List<AssetEntry> assetEntriesList = AssetEntryLocalServiceUtil.getEntries(assetEntryQuery);

System.out.println("assetEntry ====== is "+assetEntriesList );


Is there any preferred solution for this?
Sreeraj AV
RE: Asset Entry
June 10, 2013 9:07 AM
Answer

Sreeraj AV

Rank: Regular Member

Posts: 236

Join Date: April 26, 2010

Recent Posts

Its better u use Indexer classes for the search. You can set ur tags ids in searchcontext object and pass to indexer.search(searchcontext ) method.. Its ur wish which method to use for searching.. both the ways will give you list of blog Id's and using this id u need to load blog object then its custom fields..

venka reddy:
Hi,

I am retrieving the Blog entry by tags , Here is the code as follows, But i am not able to retrieve the custom attributes values,How can i retrieve the custom attributes ?

AssetEntryQuery assetEntryQuery = new AssetEntryQuery();
assetEntryQuery.setClassNameIds(new long[]{PortalUtil.getClassNameId(DLFileEntry.class)});
assetEntryQuery.setAllCategoryIds(new long[] {10111});

List<AssetEntry> assetEntriesList = AssetEntryLocalServiceUtil.getEntries(assetEntryQuery);

System.out.println("assetEntry ====== is "+assetEntriesList );


Is there any preferred solution for this?