Provide alternative JSON renderer? Without losing default JSON renderer?


requirement

construct custom json rendition of page. example: /content/site/page.my.json

 

and want accomplish without losing out-of-the-box functionality:

 

  • /content/site/page.html - works out of box
  • /content/site/page.json - works out of box

 

what we've tried

 

we've added jsp our global page template , named my.json.jsp. has given behavior:

 

  • /content/site/page.my.json - invalid recursion selector (the request gets handled default json renderer , "my" not valid recursion selector)
  • /content/site/page/_jcr_content.my.json - works (we can see our custom json renderer working), have other reasons cannot use uri.

 

so we're there. next, add "json" list of extensions treated default resolution behavior, going felix config , editing "apache sling servlet/script resolver , error handler:
resolverconfig.png

 

by doing this, our custom json works, following results:

  • /content/site/page.my.json  - works (our custom json renders)
  • /content/site/page.json - doesn't work (html rendered rather default json renderer)

 

how can provide custom renderer @ *.my.json without losing functionality of default  *.json renderer, necessary dialogs in page properties, etc.

 

thanks!

assuming using oob page component.

after adding jsp our global page template , named my.json.jsp.

 

in order [0] work create file @ [1] having contents [2]. advise overlay @ /apps instead of modifying @ /libs.   please refer sling url-to-script-resolution , our training material more details.

 

[0]   /content/site/page.my.json

 

[1] /libs/foundation/components/primary/cq/page/page.json.jsp

 

[2] <%@include file="proxy.jsp" %>



More discussions in Archived Spaces


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support