[opencms-dev] Dynamic rewrite of links in HTML file?

Olli Aro olli_aro at yahoo.co.uk
Mon Jan 19 09:01:01 CET 2004


Hi Al,

The code below will give you a content for the file type page. However, I
assume you use template elements for creating your navigation and therefore
you should also filter your links within your navigation elements (Parsing
the page content would not help you to modify those links, since it returns
only the content item and possible static links you might have with it).

Regards,

Olli

CmsFile reqFile=cms.getCmsObject().readFile(fileURI);
CmsXmlControlFile ctl=new CmsXmlControlFile(cms,reqFile);
CmsElementDefinitionCollection
collection=ctl.getElementDefinitionCollection();
CmsElementDefinition def=collection.get("body");
CmsXmlTemplateFile template=new
CmsXmlTemplateFile(cms,def.getTemplateName());
String content=template.getProcessedDataValue("TEMPLATE");

> -----Original Message-----
> From: opencms-dev-admin at opencms.org
> [mailto:opencms-dev-admin at opencms.org]On Behalf Of Alexander Langer
> Sent: 19 January 2004 02:42
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] Dynamic rewrite of links in HTML file?
>
>
>
> following structure:
>
> /a.jsp includes /html/a.html
> /b.jsp includes /html/b.html
> ...
>
> For some reason I need a mechanism to read the html file into a
> string, change some <a ...> tags (add a parameter to the url) and then
> output the changed string.
>
> problem:
> I can't even figure out how to read a vfs file into a string.
>
> Any suggestions/solutions?
>
>
> Thanks,
> al
>
> --
> Alexander Langer
> homepage: http://www.al-arenal.de
> mailto: langer at al-arenal.de
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.561 / Virus Database: 353 - Release Date: 13/01/2004
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.561 / Virus Database: 353 - Release Date: 13/01/2004




More information about the opencms-dev mailing list