There is no the best solution for that. It depends on many various
things smacdonald2008 wrote already (with massive exhausing
explanation). Although tldr: using Sling Models coexist with using a lot
of annotations (like JPA a little, at least for me) and Use classes are
rather manual processing from a resource to specific class. Moreover,
and forgive my ignorance, Sling Models are using (100% sure) adaptTo
method and I am not sure which mechanism Use classes are using (I think
its some injecti...
Sad to say that, but Resource class has no adapter to
SlingHttpServletRequest class. This is a problem with adaptTo method is
not reversable so aInstance.adaptTo(B.class).adaptTo(A.class) don't have
to work and those transitions are described with adapters you can find
in OSGi console.So, for example, if you are using Sling Models you can
simply set class to be adaptable from request, and after that inject
main resource using @Via(Resource.class) @Self annotations.This
discussion about propertie...
Well, there is a little exception there (OSGi bundle can be
split/replaced from existing content and nothing bad is happening -
assuming it is a valid and working replacement), apart from that I agree
with that statement.However, how are you handling existing deployment
anyway? I think it is installing a new package to the existing
repository. How its different from using Docker to run instance (without
wiping data out of course) and installing new application package on
prod as usual)? There al...
What you can do its just using script bindings, like that in HTL (seems
to be legit way to do):Keep in mind
that filter property here its just a custom one, so you can do it even
with two parameters like property and value, who knows what is
better!Alright, so now there is a draft how to use it, but how to
implement it? I won't write all class, believe that you can figure out
most of placeholders I left you here:@Model // all those stuff you need
to make its model, adaptable should be a Request ...
Unfortunately, includes are defined with extension, so that if generic
page template went to html that will cause those jsp files won't be
included.What you can do ASAP is just creating those files with jsp you
have (that are overriding base page) with html extension and just simply
load JSP as include, like:But
you have to check that base page is having same structure as it had
I have got the same problem here. Testing in AEM.First of all, unit
tests in Java are obvious and explored well in last, at least, 10 years.
Testing those: models, servlets and such is easy (at unit scope of
course).However, its getting nasty when you want to test component scope
(so that you want to test 1. component rendering 2. dialog 3. design
rules). There is a thing called Hobbes.js that is testing well single
component (its just a JS code that is ran within editor (or developer I
Hey AryA, to be honest:hard to tell what is your dispatcher
configurationare you getting 404 during this call to that JSP? Is it
fine, HTTP OK 200, any other response code? Any content in response?Some
of dispatchers (I am not 100% sure but the default one seems to be done
well) are configured to not handle jcr:content (to response with 404 or
Feike Visser wrote... Ok..., here comes a black-magic Sightly trick....
Use this (resourceType) in case you are referring to a page... Basically to
remove the div you need to specify the resourceType... This is the most
black-magic trick I have seen for sightly! 🙂 I thought that providing
resoureType won't affect rendering at all (just be nice way to render
even if there is no node under certain path). Thanks for that info!