[prev in list] [next in list] [prev in thread] [next in thread]
List: fop-user
Subject: modifying an external-graphic src
From: Carl Buxbaum <cbuxbaum () bamboorose ! com ! INVALID>
Date: 2021-01-29 16:50:57
Message-ID: B7C0B930-C8F6-4FDA-9CEA-5AE9A41F88CB () contoso ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
Hi all,
Here is perhaps a naïve question with an obvious answer.
I would like to extend the flexibility of our implementation by retrieving images \
through a servlet that is protected. We can do this by appending a token to the end \
of our URL. I would like to do this without requiring a change to the xml that is \
being passed to our application. I have the authenticating token available to me, \
and I have already implemented a custom ResourceResolver, and thought to add the \
token there, however, the ResourceResolver is associated with the FOPFactoryBuilder \
and does not change from one call to the next, whereas the token does.
The example I have is something like:
<fo:external-graphic src="{$img}"
$img is just a path to a file
The basedir gets prepended to that, in this case, http://host/imageservlet/
What I would like to end up with is something like
http://host/imageservlet/path/to/image.jpg?t=<sometokenvalue<http://host/imageservlet/path/to/image.jpg?t=%3csometokenvalue>>
Any ideas?
A custom FOEventHandler?
A custom DocumentHandler? I would just need to override the endElement and then pass \
control back to the super method.
Or is there a simple way to do a transform on the xml before handing off to FOP?
Thanks!
Carl Buxbaum
Bamboo Rose LLC
________________________________
DISCLAIMER:
E-mails and attachments from Bamboo Rose, LLC are confidential.
If you are not the intended recipient, please notify the sender immediately by \
replying to the e-mail, and then delete it without making copies or using it in any \
way. No representation is made that this email or any attachments are free of \
viruses. Virus scanning is recommended and is the responsibility of the recipient.
Disclaimer
The information contained in this communication from the sender is confidential. It \
is intended solely for use by the recipient and others authorized to receive it. If \
you are not the recipient, you are hereby notified that any disclosure, copying, \
distribution or taking action in relation of the contents of this information is \
strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been automatically \
archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. \
Providing a safer and more useful place for your human generated data. Specializing \
in; Security, archiving and compliance. To find out more visit the Mimecast website.
[Attachment #3 (text/html)]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:inherit;
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<style type="text/css">.style1 {font-family: "Times New Roman";}</style></head><body \
lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"> <div \
class="WordSection1"> <p class="MsoNormal"><span style="font-size:11.0pt">Hi \
all,<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt">Here is perhaps a naïve question with an obvious \
answer.<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt">I would like to extend the flexibility of our implementation \
by retrieving images through a servlet that is protected. We can do this by \
appending a token to the end of our URL. I would like to do this without \
requiring a change to the xml that is being passed to our application. I \
have the authenticating token available to me, and I have already implemented a \
custom ResourceResolver, and thought to add the token there, however, the \
ResourceResolver is associated with the FOPFactoryBuilder and does not change from \
one call to the next, whereas the token does.<o:p></o:p></span></p> <p \
class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span style="font-size:11.0pt">The example I have is something \
like:<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal" \
style="vertical-align:baseline"><span \
style="font-size:10.0pt;font-family:"inherit",serif;border:none windowtext \
1.0pt;padding:0in"><fo:external-graphic \
src="{$img}"<o:p></o:p></span></p> <p class="MsoNormal" \
style="vertical-align:baseline"><span \
style="font-size:10.0pt;font-family:"inherit",serif;border:none windowtext \
1.0pt;padding:0in"><o:p> </o:p></span></p> <p class="MsoNormal" \
style="vertical-align:baseline"><span \
style="font-size:10.0pt;font-family:"inherit",serif;border:none windowtext \
1.0pt;padding:0in"><o:p> </o:p></span></p> <p class="MsoNormal" \
style="vertical-align:baseline"><span \
style="font-size:10.0pt;font-family:Consolas">$img is just a path to a \
file<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas">The</span><span \
style="font-size:11.0pt"> basedir gets prepended to that, in this case, <a \
href="http://host/imageservlet/">http://host/imageservlet/</a><o:p></o:p></span></p> \
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span style="font-size:11.0pt">What I would like to end up with is \
something like<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><a \
href="http://host/imageservlet/path/to/image.jpg?t=%3csometokenvalue">http://host/imageservlet/path/to/image.jpg?t=<sometokenvalue</a>><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Any ideas?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">A custom \
FOEventHandler?<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt">A custom DocumentHandler? I would just need to \
override the endElement and then pass control back to the super \
method.<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt">Or is there a simple way to do a transform on the xml before \
handing off to FOP?<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt">Thanks!<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt">Carl Buxbaum<o:p></o:p></span></p> <p \
class="MsoNormal"><span style="font-size:11.0pt">Bamboo Rose \
LLC<o:p></o:p></span></p> </div>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" \
"http://www.w3.org/TR/html4/strict.dtd"> <title>BambooRose Email Disclaimer</title>
<hr>
<span style="font-family: Calibri; font-size:10px; color: #808080">DISCLAIMER:<br>
E-mails and attachments from Bamboo Rose, LLC are confidential.<br>
If you are not the intended recipient, please notify the sender immediately by \
replying to the e-mail, and then delete it without making copies or using it in any \
way.<br> No representation is made that this email or any attachments are free of \
viruses. Virus scanning is recommended and is the responsibility of the \
recipient.</span><br>
<br><br><p style="font-family: Verdana; font-size:10pt; \
color:#666666;"><b>Disclaimer</b></p><p style="font-family: Verdana; font-size:8pt; \
color:#666666;">The information contained in this communication from the sender is \
confidential. It is intended solely for use by the recipient and others authorized to \
receive it. If you are not the recipient, you are hereby notified that any \
disclosure, copying, distribution or taking action in relation of the contents of \
this information is strictly prohibited and may be unlawful.<br><br>This email has \
been scanned for viruses and malware, and may have been automatically archived by \
<b>Mimecast Ltd</b>, an innovator in Software as a Service (SaaS) for business. \
Providing a <b>safer</b> and <b>more useful</b> place for your human generated data. \
Specializing in; Security, archiving and compliance. To find out more <a \
href="http://www.mimecast.com/products/" target="_blank">Click \
Here</a>.</p></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic