<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.17097" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>I'm trying to
programmatically export a scaled image, and struggling.</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>I've created a feed,
which should contain downscaled images. The feed unfortunately
also needs to contain the size of each image, according to the
spec.</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>I was able to get
the correct link (e.g. img.jpg_8494839439.jpg) which will take any user straight
to the exported downscaled image, but until someone requests that
link, the downscaled image does not exist, and so it is "impossible" to
determine its size.</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>This is why I want
to export the downscaled image (if it does not exist) upon building the feed. It
proved quite a challenge...</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>I've created a class
library for the feed module, so all my code is in a .jar
file.</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>I've tried
this:</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>CmsObject guestCmso
= OpenCms.initCmsObject("Guest"); // Doc says to use the guest
user</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>String scaleParams =
"__scale=w:400,h:200,q:90,t:3"; // Example scale parameters</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>String
imageScalePath = guestCmso.getSitePath(imageResource).concat("?" + scaleParams);
// imageResource is the CmsResource that is the original
image</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2>CmsStaticExportData data =
OpenCms.getStaticExportManager().getExportData(imageScalePath, guestCmso);
<BR>if (sed != null) {<BR>
OpenCms.getStaticExportManager().export(cms.getRequest(), cms.getResponse(),
guestCmso, data); // cms is an initialized CmsJspActionElement instance,
passed to this class by the JSP<BR>}</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>However, it
looks like "data" is always assigned a null value, probably because
I'm appending the "scaleParams". </FONT></SPAN><SPAN
class=360581621-12052011><FONT face=Arial size=2>But if I don't append these
parameters, how else can I tell the system that I want to export a _scaled_
version and not the original??? </FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011></SPAN><SPAN class=360581621-12052011><FONT
face=Arial size=2>Can someone point me to something or give an
example?</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>(PS: I am aware that
there are several workarounds for my problem, but I would really like to
accomplish it the way I'm describing it here. :)</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial size=2>Best
regards,</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2>Paul</FONT></SPAN></DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360581621-12052011><FONT face=Arial
size=2></FONT></SPAN> </DIV></BODY></HTML>