I am trying to create custom SPA core page model json which implements Page. In that model class, ":children" creation code causing bundle issue.
without this function, page.model.json works fine
@notnull
@Override
public Map<String, ? extends Page> getExportedChildren() {
if (descendedPageModels == null) {
setDescendedPageModels(HierarchyUtils.getDescendantsModels(request, currentPage, currentStyle, modelFactory));
}
return descendedPageModels;
}
SPA core version: 1.3.16(latest)
Uber jar: 6.5.13
AEM instance: 6.5.13
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Venkatesha_BG,
You can't use HierarchyUtils class in your implementation. This is an internal class, which means it is not exported by spa.project.core.core bundle. It can be easily recognized by package structure, which is like: com.adobe.aem.spa.project.core.internal.impl.utils.HierarchyUtils.
In OSGi you can check that only com.adobe.aem.spa.project.core.models package is exported, so only classes/interfaces from this package can be used in custom implementation.
To solve the issue you have to remove com.adobe.aem.spa.project.core.internal.impl.utils.HierarchyUtils and any other internal class usage from your code.
You should use delegation pattern, in order to create your own Page model class.
Hi @Venkatesha_BG,
You can't use HierarchyUtils class in your implementation. This is an internal class, which means it is not exported by spa.project.core.core bundle. It can be easily recognized by package structure, which is like: com.adobe.aem.spa.project.core.internal.impl.utils.HierarchyUtils.
In OSGi you can check that only com.adobe.aem.spa.project.core.models package is exported, so only classes/interfaces from this package can be used in custom implementation.
To solve the issue you have to remove com.adobe.aem.spa.project.core.internal.impl.utils.HierarchyUtils and any other internal class usage from your code.
You should use delegation pattern, in order to create your own Page model class.
Thanks for the response. Yes We should use delegate pattern
Views
Replies
Total Likes