adobe / adobe/aem-core-wcm-components
Cannot extend data layer to include a generic asset info for non-image
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 796
- Forks
- 776
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 8
Description
If extending the Download component, it doesnt seem possible to effectively add the asset data for the linked file into the data layer.
There is a AssetDataBuilder in WCM Core, but it is only ever used from the ImageComponentDataBuilder. This requires the data layer to be rendered .asImageComponent() labeling the asset as "image" in the data layer output.
I considered making a new AssetComponentDataBuilder in my project, but to appropriately hook into and reuse the WCM Core data layer supplier capabilities I'd need to reference internal classes like com.adobe.cq.wcm.core.components.internal.models.v1.datalayer.builder.DataLayerSupplierImpl
That said, maybe I'm looking at the issue incorrectly - admittedly the data layer builder framework in WCM Core is very confusing to me - it seems extremely abstract with a lot of loose coupling that would appear to be in support of extension by client code, but then some of the most critical classes are buried in internal packages preventing them from being used in client extensions. The data layer works well enough for anything already supported in the WCM Core data layer implementation, it just seems very hard to expand upon it in a client project.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review how the Download component uses the data layer, then compare AssetDataBuilder and ImageComponentDataBuilder. Examine the referenced internal DataLayerSupplierImpl and determine what public extension point is needed for generic non-image asset data; done means a client project can add that asset data without relying on internal classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100