Coder Social home page Coder Social logo

Comments (2)

habansal avatar habansal commented on August 31, 2024

@cqsapient Yes, indeed!
Like you said, since the html is formed on the fly via react, sling rewriters transformers won't come into picture.
LinkChecker also uses Sling Request Rewriter Pipeline and only parses content for HTML responses. In case of SPAs, there is no HTML repsonse. So, Linkchecking is also not performed on the pages.

from aem-spa-project-archetype.

cqsapient avatar cqsapient commented on August 31, 2024

Hi @habansal Yes currently I am doing url shortening on publish instances using reverse sling mapping and using resourceresolver.map in backend java sling model which exposes the .model json which is consumed by front end react. So the output json is domain appended and url shortened . I guess this is the most appropriate approach, let me know if you see a cleaner solution.

Now, this approach works fine for new custom components, but I am again facing another issue when using the Content Fragment core component in my SPA. We have enabled CF by creating a corresponding react component and mapped it with the wrapper AEM content fragment component using , which works fine, but I am not able to do url shortening in the CF component as the json is created by core component's code . I know we can extend core component models using Sling delegation patterns,

https://github.com/adobe/aem-core-wcm-components/wiki/Delegation-Pattern-for-Sling-Models

but the doc says we will be able to only use the public methods of the model; and I am not sure which one of these classes

https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/contentfragment/ContentFragmentImpl.java

https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/contentfragment/ContentFragmentListImpl.java

https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/contentfragment/DAMContentFragmentImpl.java

is responsible for rendering the pathfield configured in the CF model(as I want to apply resourceresolver.mapto() in the pathfield's value). Please let me know if it is possible to extend/customize any of these classes in my custom code so that I am able to use resourceresolver.mapto() and hence shorten the url in the json exposed by content fragment.

Will appreciate your help.

Thanks,

from aem-spa-project-archetype.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.