You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Jason Bailey <Ja...@sas.com> on 2014/11/24 19:48:41 UTC
looking for feedback
I'm still feeling my way around the right way to implement solutions in Sling that follow "sling thinking" and I'm hoping to get some confirmation from the community.
I've got a requirement where I need to render an html page as text. It doesn't need to be perfect and I understand that there will be problems with any solution I come up with - that's acknowledged.
The two ways I have come up with so far are either as a selector, so that I can call /content/foo.html as /content/foo.text.html and then have a text.jsp under a component or maybe a pipeline service that listens for that selector and filters out the text. The other consideration, which I'm leaning towards, is a SlingServlet which would handle the txt extension where I would have it iterate through the page resources and compare with a list of whiteboard services that would render out text where appropriate.
Anybody know if I'm missing a third option?
TIA
-Jason
Re: looking for feedback
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Nov 25, 2014 at 9:51 AM, Julian Sedding <js...@gmail.com> wrote:
> ...Implementing a servlet is (largely) equivalent to implementing a JSP...
Or any other script for that matter, language doesn't have to be JSP.
-Bertrand
Re: looking for feedback
Posted by Julian Sedding <js...@gmail.com>.
Hi Jason
You should be able to create a "txt.jsp" file and call your resource
with the "txt" extension. I.e. /content/foo.txt. This is assuming that
your resource is "/content/foo" and not "/content/foo.html".
Implementing a servlet is (largely) equivalent to implementing a JSP.
So choose whichever is more convenient for implementing your
rendition.
Regards
Julian
On Mon, Nov 24, 2014 at 7:48 PM, Jason Bailey <Ja...@sas.com> wrote:
> I'm still feeling my way around the right way to implement solutions in Sling that follow "sling thinking" and I'm hoping to get some confirmation from the community.
> I've got a requirement where I need to render an html page as text. It doesn't need to be perfect and I understand that there will be problems with any solution I come up with - that's acknowledged.
>
> The two ways I have come up with so far are either as a selector, so that I can call /content/foo.html as /content/foo.text.html and then have a text.jsp under a component or maybe a pipeline service that listens for that selector and filters out the text. The other consideration, which I'm leaning towards, is a SlingServlet which would handle the txt extension where I would have it iterate through the page resources and compare with a list of whiteboard services that would render out text where appropriate.
>
> Anybody know if I'm missing a third option?
>
> TIA
> -Jason