[opencms-dev] change images links

gleb makarov gleb.a.makarov at gmail.com
Thu Apr 22 08:30:10 CEST 2010


Hello everyone,

I have a problem. I need to change programmatically 'src' attribute for
images in xmlpage file type. Now all images have internal links
(internal="true" parameter) and I need to make them external by changing
value in <target> tag. Can somebody tell me the name of function for this
action?

I`ve found only this method:
<...>
CmsXmlPage page = CmsXmlPageFactory.unmarshal(cmsObj,templateFile);
CmsLinkTable table = page.getLinkTable("body",locale);
for(Iterator i = table.iterator(); i.hasNext();){
      CmsLink listElement = (CmsLink)i.next();
      listElement.updateLink("http://somedomen.com"+listElement);
}
<...>

But it changes all links for <link type="A">, but I need to change links for
<link type="IMG">.

Thank you.

-- 
Best regards,
Gleb Makarov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100422/40d8e0cd/attachment.htm>


More information about the opencms-dev mailing list