Sunday, January 16, 2005

Page Import document available

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

In some
entries I've shown the designer rendering common web pages from the net.
These are great testcases for me to make sure the XHTML and CSS layout
engine is working correctly, at least for common web constructs.
You may wonder how I got the designer to render html pages. No, I didn't
sit and try to replicate the page by dragging JSF components on the page.
There's a hidden feature in the designer called "Page Import", which as of
Patch 5
is not so hidden.

screenshot of the little green j icon
There's a

new document about the feature here
Have you been curious what the little green triangles are? See image on the right -- the little triangular green icons in the top left corners of some components. If so, go read the article!

Note that this is a preview feature, so be careful. I just discovered a
bug the other day: If the html page you're importing has an xmlns
attribute on the <html> tag, Bad StuffTM
happens. Fixed but not in bits that are available yet. For now, remove
the attribute before importing.

There is one really cool aspect of Page Import I've gotta point out though.
Some browsers, like Mozilla and Internet Explorer, can save a "complete"
web page, where they not only save a page but all required images and
stylesheets as well. The problem is that they only save images and other
resources that are referenced in the html page. If the page being saved
has an image (or secondary stylesheet) that is referenced from a
stylesheet or style attribute, the image will not be
imported. The designer page import feature on the other hand does handle
this; it imports all external resources referenced in any reachable
stylesheets as well, and these stylesheets are rewritten to reference
the imported copy.

No comments:

Post a Comment