Foren
Relating Layout and AssetEntries
Maximiliano Chiesa, geändert vor 11 Jahren.
Relating Layout and AssetEntries
Junior Member Beiträge: 47 Beitrittsdatum: 20.07.12 Neueste Beiträge
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!