Fórumok
Relating Layout and AssetEntries
Maximiliano Chiesa, módosítva 11 év-val korábban
Relating Layout and AssetEntries
Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2012.07.20. Legújabb bejegyzések
I want to obtain all the AssetEntries that are contained in a certain Layout.
Is there a way of doing this?
I tried with the following DynamicQuery
DynamicQuery query= DynamicQueryFactoryUtil.forClass(AssetEntry.class, PortalClassLoaderUtil.getClassLoader());
query.add(PropertyFactoryUtil.forName("groupId").eq(new Long(layout.getGroupId())));
List<AssetEntry> results = AssetEntryLocalServiceUtil.dynamicQuery(query);
I use the "groupId" in the query since is the only attribute in common with Layout and AssetEntry that I found.
The problem here is that the list "results" contains a lot of AssetEntries that are contained in other layouts.
Thanks in advance!
Is there a way of doing this?
I tried with the following DynamicQuery
DynamicQuery query= DynamicQueryFactoryUtil.forClass(AssetEntry.class, PortalClassLoaderUtil.getClassLoader());
query.add(PropertyFactoryUtil.forName("groupId").eq(new Long(layout.getGroupId())));
List<AssetEntry> results = AssetEntryLocalServiceUtil.dynamicQuery(query);
I use the "groupId" in the query since is the only attribute in common with Layout and AssetEntry that I found.
The problem here is that the list "results" contains a lot of AssetEntries that are contained in other layouts.
Thanks in advance!