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...
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.
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
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 ...
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.
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.
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...
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...