


I'm having a problem with two htmlwriter configurations: one for the versioned clientlibs and the other for link rewriting (removing /content/mysite from links). Only the configuration with the higher order is working, excluding the other one.
I've tried also combining them but it doesn't work for me, since the versioned clientlibs stopped working.
Is there a way to make two htmlwriter configurations work together ?
My merged configuration:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
contentTypes="text/html"
enabled="{Boolean}true"
generatorType="htmlparser"
order="5000"
paths="/content/mysite"
serializerType="htmlwriter"
transformerTypes="[linktype,linkchecker,versioned-clientlibs]">
<generator-htmlparser
jcr:primaryType="nt:unstructured"
includeTags="[A,OPTION]"/>
</jcr:root>
Solved! Go to Solution.
Views
Replies
Sign in to like this content
Total Likes
Ok I managed to fix this after @Asutosh_Jena_ suggestions and after various trying. Final working configuration is this:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" contentTypes="[text/html]" enabled="{Boolean}true" generatorType="htmlparser" order="1001" paths="[/content/mysite]" serializerType="htmlwriter" transformerTypes="[linktype,versioned-clientlibs]"> <generator-htmlparser jcr:primaryType="nt:unstructured" includeTags="[A,OPTION,LINK,SCRIPT]"/> </jcr:root>
Versioned clientlibs was working only for css because the SCRIPT options was missing from includeTags property.
Thank you @Asutosh_Jena_ for the tips.
You can configure the rewriter in the below format and it will work for both versioned clientlib as well as link rewriter.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
contentTypes="[text/html]"
enabled="{Boolean}true"
generatorType="htmlparser"
order="1"
serializerType="htmlwriter"
transformerTypes="[linkchecker,versioned-clientlibs,resourceresolver-map]">
<generator-htmlparser
jcr:primaryType="nt:unstructured"
component-optional="{Boolean}true"
includeTags="[A,/A,IMG,SOURCE,/SOURCE,LINK,SCRIPT,FORM]"/>
</jcr:root>
Thanks!
Hi @Asutosh_Jena_ ,
I've tried doing as you told, also removing the property "paths" which I need because I have multiple sites on the same instance, but it's working only the "versioned clientlibs" part, excluding link rewriting.
Please make sure the below config node has the below property.
com.day.cq.rewriter.linkchecker.impl.LinkCheckerTransformerFactory.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
linkcheckertransformer.disableChecking="{Boolean}true"/>
What's the rule that you are applying on /etc/maps for shortening the URL?
The "disableChecking" was already at true, but after some tests with the configurations I've managed to make the rewriter work with also the versioned-clientlibs.
The configuration is the following:
jcr:primaryType="nt:unstructured" contentTypes="[text/html]" enabled="{Boolean}true" generatorType="htmlparser" order="1001" paths="[/content/mysite]" serializerType="htmlwriter" transformerTypes="[linktype,versioned-clientlibs]"> <generator-htmlparser jcr:primaryType="nt:unstructured" includeTags="[A,OPTION,LINK]"/>
linktype is the identifier for my custom java Transformer factory, used to modify the links inside the website. /etc/maps is not being used.
The only problem right now is that the versioned clientlibs is being applied only for css, and not for js. I'm using acs commons latest version: 5.0.14
Ok I managed to fix this after @Asutosh_Jena_ suggestions and after various trying. Final working configuration is this:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" contentTypes="[text/html]" enabled="{Boolean}true" generatorType="htmlparser" order="1001" paths="[/content/mysite]" serializerType="htmlwriter" transformerTypes="[linktype,versioned-clientlibs]"> <generator-htmlparser jcr:primaryType="nt:unstructured" includeTags="[A,OPTION,LINK,SCRIPT]"/> </jcr:root>
Versioned clientlibs was working only for css because the SCRIPT options was missing from includeTags property.
Thank you @Asutosh_Jena_ for the tips.