since ‎19-10-2018
‎10-03-2020
navjots90210021
Level 1
Re: SPA AEM : How can we apply business logic in .model.j... navjots90210021 - Adobe Experience Manager
The root .model.json is getting rendered by ComponentExporter. This is different than normal jackson exporter. So, the business logic can go intogetExportedType() that is in each sling model. if we return NULL from here instead of resource type, the component do not renders on Front End.This would require un-caching of root .model.json if some properties needs to be checked on each request. I am looking now versioning of this root .model.json and use selector in order to cache .model.json with d...
1540
Views
1
Like
0
Answers
Re: SPA AEM : How can we apply business logic in .model.j... navjots90210021 - Adobe Experience Manager
But the spa project uses spa core component at "com.adobe.aem.spa.project.core.models.Page". This is not public, so can not even get the file and over-ride it.
3277
Views
0
Likes
0
Comments
Re: SPA AEM : How can we apply business logic in .model.j... navjots90210021 - Adobe Experience Manager
Not exactly. Let's say home page has 3 components, https://example.com/home.model.json --> This will export the data from 3 sling models. What I am looking is export data from only 2 components instead of 3 based upon some if condition, else export from 3 components.If I get into this, just by not caching .model.json will fulfill the purpose.
3298
Views
0
Likes
0
Comments
Re: SPA AEM : How can we apply business logic in .model.j... navjots90210021 - Adobe Experience Manager
Sling model exporter will export all keys, I think the only thing we can control is values for those keys. I thing you meant this ? This would require additional check in UI in order to render the component. But if the sling model itself does not export anything, then UI will not render the component. Is there any way we can make sling model do not export anything based upon if condition ? Its B2B and traffic would be very low, so no caching of model.json as of now. Earlier though of versioning ...
3319
Views
0
Likes
0
Comments
Re: SPA AEM : How can we apply business logic in .model.json output ? navjots90210021 - Adobe Experience Manager
The spa core page component might be rendering the .model.json , and then calls component sling models. There is no documentation on that.
3642
Views
0
Likes
0
Comments
Re: SPA AEM : How can we apply business logic in .model.json output ? navjots90210021 - Adobe Experience Manager
What I am trying to achieve is CUG at component level ? If I am not using SPA framework, I can do same using SDI and do things in sling model.
3648
Views
0
Likes
0
Comments
Re: SPA AEM : How can we apply business logic in .model.j... navjots90210021 - Adobe Experience Manager
Thanks for your reply.I am using SPA framework with React, and if the component is not available in .model.json then, react does not even render that component.So, what you suggested is applicable if I want to expose different json values based upon business requirement. But my scenario is to HIDE Component-X in .model.json and therefore UI will not show it. I even tried to return from PostContruct so that the sling model does not export anything, but it still export all get functions. Is there ...
3376
Views
0
Likes
0
Comments
Re: SPA AEM : How can we apply business logic in .model.json output ? navjots90210021 - Adobe Experience Manager
One way is to add rep:cugPolicy node under the content/../componentX to restrict to some group. Dn't know any performance issues with this. But looking something that can be done by Business Authors.
3689
Views
0
Likes
0
Comments
SPA AEM : How can we apply business logic in .model.json output ? navjots90210021 - Adobe Experience Manager
Requirement is to show components of Page-A to specific user group therefore we need to apply business logic where model.json is getting generated ? Any pointers on how to do this ?Currently when /content/xyz/en.model.json is generated, it checks components on each page and call the sling model for those component. Before calling, i want to check some user info and then call the sling model else skip it.
3700
Views
0
Likes
14
Answers and Comments
Re: SDI with SPA component navjots90210021 - Adobe Experience Manager
1. How caching works with SSR ? Looks like, with SSR enabled, the model json should not be cached and same goes with page. Because, all pages have CUG based components.2. Is CUG at component level is OOTB with SSR ? I know page level CUG works OOTB with page model json and therefore in that case also, we can not even cache model json.
1236
Views
0
Likes
0
Comments
Re: Populate the table dynamic navjots90210021 - Adobe Experience Manager
Add some markup in component htl file. use ajax and jquery to populate dynamically. Please post more info so what is use case ? Using AEM forms ?
1348
Views
0
Likes
2
Answers
SDI (Sling Dynamic Include) in SPA navjots90210021 - Adobe Experience Manager
The page related data flow via .model.json. How can we let mode.json know that load a particular component json on each request ? Use Case : want to hide/ unhide a particular component on a page for a group(CUG). Can we still map a component with AEM component that has html file (HTL) and also have react rendering mechanism in react component so that HTL file adds data attribute from model and react component reads that. What could be possible solution with SPA for dynamic rendering of a compone...
267
Views
0
Likes
0
Answers and Comments
Re: Getting Layout Containers in React Components using SPA SDK navjots90210021 - Adobe Experience Manager
Any update ?
850
Views
0
Likes
0
Comments
SDI with SPA component navjots90210021 - Adobe Experience Manager
All data to react (frontend) comes via .model.json, which contains all info of the page. If I want to have a component that should not be cached, rather gets called on every request and then .model.json should always gets updated content, how we can do that ? Use case is : On each request, I want to check whether the user is allowed for particular action and then pass that true/false to the model.json so that react does not render the component (want to achieve CUG at component level ) Do not wi...
1255
Views
0
Likes
3
Answers and Comments
Likes given to
Likes from