Thanks Bertrand. I will try this out, but I believe in theory it should
work for us.

And no worries about the contribution, at least it let me get more familiar
with some of Sling's internals :)

I'll still reiterate that the deprecation on the Post classes threw me off
because it meant our code ended up using deprecated classes, adding several
warnings to the compilation process. My suggestion would be to add this
solution you just proposed to the javadocs of those deprecated classes.

Regards,

Carlos

On Mon, Jun 22, 2020 at 8:27 AM Bertrand Delacretaz <bdelacre...@apache.org>
wrote:

> Hi Carlos,
>
> On Thu, Jun 18, 2020 at 3:59 AM Carlos Munoz <camu...@redhat.com> wrote:
> ...
> > https://github.com/apache/sling-org-apache-sling-servlets-post/pull/5
> ...
>
> Thank you for this!
>
> In the meantime I think there's a simpler way for you to use the
> existing
> org.apache.sling.servlets.post.impl.operations.AbstractPostOperation
> with no changes to Sling code.
>
> That class is public, so you can use it in your code, however it's not
> exported at runtime so your bundle fails to load it.
>
> The workaround is to embed the class in your bundle, using a bnd
> -includeresource as in [1].
>
> I think this is in some ways better than us moving that class to an
> exported package, as you can then precisely control which version of
> that class you use as that's the one you embedded as opposed to
> whatever the environment provides.
>
> Would that work for you?
>
> -Bertrand
>
> P.S. too bad this means we probably don't need your contribution,
> sorry that we didn't suggest this variant before
>
> [1]
> https://github.com/apache/sling-org-apache-sling-servlets-post/blob/master/bnd.bnd
>
>

Reply via email to