Hello Dirk,
I did not really solve the problem, but I figured out the causes and
constructed some workarounds.
Part of the problems are solved with current Tomahawk 1.1.7 Snapshot, but only
part, so I turned back to 1.1.6 and applied the following patches.
All patches affect files in the tomahawk-1.1.6.jar. If you put
tomahawk-1.1.6.jar in the WEB-INF/lib folder, it is simply sufficient to put the
patched files in the WEB-INF/classes folder which will take precedence. So you
don't have to patch the jarfile itself, if you don't want to.
1. The JSCookMenu version delivered with Tomahawk 1.1.6 is very old and isn't
XHTML ready. This is corrected in 1.1.7, but for 1.1.6, you have to
manually download JSCookMenu.js v.1.4.4 (google for JSCookMenu) and put it in
place. This is not the newest JSCookMenu version, but it is compatible
with Tomahawk 1.1.6. The right place is
org/apache/myfaces/custom/navmenu/jscookmenu/resource/JSCookMenu.js.
2. theme.js of the JSCookMenu theme we are using (ThemeOffice) had to be
patched. Copy file
org/apache/myfaces/custom/navmenu/jscookmenu/resource/ThemeOffice/theme.js from
the Tomahawk sources, search for "<img" and change the '">' at end of
line to '"/>' (4 times).
3. DefaultAddResource has to be patched. Copy file
org/apache/myfaces/renderkit/html/util/DefaultAddResource.java. Search for
method
"writeWithFullHeader" containing lines:
ResponseWriter writer = new HtmlResponseWriterImpl(response.getWriter(),
HtmlRendererUtils.selectContentType(request.getHeader("accept")),
response.getCharacterEncoding());
Change these lines to:
String contenttype = "application/xhtml+xml";
ResponseWriter writer = new HtmlResponseWriterImpl(
response.getWriter(), contenttype, response.getCharacterEncoding());
Note: this is only a hack, but it works for me.
4. Finally, HtmlRendererUtils has to be patched. Copy file
org/apache/myfaces/shared_tomahawk/renderkit/html/HtmlRendererUtils.java.
Search for method
"isAllowedCdataSection". In 1.1.6, this method looks like:
public static boolean isAllowedCdataSection(FacesContext fc) {
Boolean value = (Boolean)
fc.getExternalContext().getRequestMap().get(ALLOW_CDATA_SECTION_ON);
return value != null && ((Boolean) value).booleanValue();
}
Add as first line in method:
if (fc==null) return true;
In 1.1.7, this method is changed such that it returns false in case of
fc==null, but then the DefaultAddResource hack wouldn't work any longer. For
me, my patch works fine, but you see that somebody who understands some more of
this should have a look at it to make it really correct.
So far for the patches. With all this, the menu gets displayed. If you
furthermore want to have it working (ie that clicking menu items results in
actions) :-), you have to manually add a hidden input field to your xhtml pages:
<input type="hidden" name="jscook_action" />
Just put it immediately before the closing </h:form> tag.
Good luck!
Marcus.
neander
<[EMAIL PROTECTED] An:
[email protected]
mail.com> Kopie:
Thema: Re: Problems Tomahawk
/ Extensionsfilter / Facelets / XHTML / CDATA / JSCookMenu
17.10.2007 14:09
Bitte antworten
an "MyFaces
Discussion"
Hi Marcus,
I'm facing the same problem you do. At first everything worked fine with my
webapplication.
My problem occured after I enhanced my webapplication with facelets.
The IE browser ignores the problem, but doesn't seem to accept
the css-definition of the styleLocation-Attribut and displays the navigation
menu in default-look.
For me it looks like the Extension-Filter of Tomahawk is not able to resolve
the correct path
of the given css-Definition anymore.
I believe if the css is correctly loaded there won't be a problem anymore
...
Please let me know if you solved the problem.
Regards
Dirk
Marcus Schmidke wrote:
>
>
> Hello all,
>
> I'm using Tomahawk 1.1.5 in a JBoss Seam / Facelets / RI environment, and
> I am having problems displaying JSCookMenu. In IE it is deployed, in
> Firefox, it isn't, so I suspect it's some xhtml issue.
>
> I've had a look at the generated source and found one single line of
> JavaScript which is not embedded in CDATA:
>
> <script type="text/javascript"><!--
> var
>
myThemeOfficeBase='http://localhost:8080/Argos3Web/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11920263/navmenu.jscookmenu.HtmlJSCookMenuRenderer/ThemeOffice/';
> //--></script>
>
> Might be it's the reason. All else JavaScript is within an autogenerated
> CDATA block.
>
> I've tried to figure out the reason (why are there some CDATAs, but not
> all?), but I'm far too new to this all to understand it completely. I've
> debugged a bit around in DefaultAddResource, HtmlResponseWriterImpl and so
> on. I saw that there are different ResponseWriters in use, some of them
> know about xhtml, others don't, but if I force the latter to xhtml by
> patching DefaultAddResource, I get a NullPointerException in
> isAllowedCdataSection().
>
> Can anybody help me? Will I have to replace RI by Myfaces? Will that help?
> But Seam recommends using RI, and for legacy reasons I am forced to use
> Tomahawk.
>
> Please help!!
>
> Marcus.
> _____________________________________________________________________
> prosystems IT GmbH
> Anwendungsentwicklung
> Postfach 31 51
> 53021 Bonn (Germany)
>
> Tel: 0228 / 3366 - 3329, Fax: 0228 / 3366 - 73329
> mailto:[EMAIL PROTECTED] http://www.prosystemsIT.de
> Amtsgericht Bonn - HR B 13189
> Geschaeftsfuehrer: Vassilios Timiliotis, Richard Adams
>
>
> Der Austausch von Nachrichten mit der prosystems IT GmbH via E-Mail dient
> ausschliesslich Informationszwecken. Rechtsgeschaeftliche Erklaerungen
> duerfen ueber dieses Medium nicht ausgetauscht werden. Verfaelschungen des
> urspruenglichen Inhaltes dieser Nachricht bei der Datenuebertragung
> koennen
> nicht ausgeschlossen werden.
>
>
>
>
--
View this message in context:
http://www.nabble.com/Problems-Tomahawk---Extensionsfilter---Facelets---XHTML---CDATA---JSCookMenu-tf4612626.html#a13252273
Sent from the MyFaces - Users mailing list archive at Nabble.com.
_____________________________________________________________________
prosystems IT GmbH
Anwendungsentwicklung
Postfach 31 51
53021 Bonn (Germany)
Tel: 0228 / 3366 - 3329, Fax: 0228 / 3366 - 73329
mailto:[EMAIL PROTECTED] http://www.prosystemsIT.de
Amtsgericht Bonn - HR B 13189
Geschaeftsfuehrer: Vassilios Timiliotis, Richard Adams
Der Austausch von Nachrichten mit der prosystems IT GmbH via E-Mail dient
ausschliesslich Informationszwecken. Rechtsgeschaeftliche Erklaerungen
duerfen ueber dieses Medium nicht ausgetauscht werden. Verfaelschungen des
urspruenglichen Inhaltes dieser Nachricht bei der Datenuebertragung koennen
nicht ausgeschlossen werden.