Monetize with AdMob
Home / Java / Legacy

WALL
the Wireless Abstraction Library

Back to Java


Other Java/WURFL efforts
Murray Brandon:
Modified WALL


Nicholas Albion:
More Modified WALL


Laszlo Nadai:
JAXB-based API


Bill Ray:
MyWURFL





SourceForge.net Logo
 

WALL with Improvements

This is an update we kindly received from Murray Brandon in Australia.
A lot of what Murray did will be supported also in WURFL evolution, but for those who can't wait, just be grateful to Brandon.

Here is Murray's explanation of the new features:

  Hi Luca,

Here's the updated wurlf/wall source that we refactored for our project 
to allow wurfl to be reloaded at runtime (ie without stopping the 
webserver) and to allow us to create complex renderers made up of a 
bunch of WALL renderers as per my previous posting.

It also has:
+ style_class attributes for all the major WALL tags
+ a style tag with the ability to embed a css in the xhtml/html page so 
it loads faster on newer 3G phones.
+ log4j instead of system.out.printlns.
+ Ability to choose to default to XHTML/WML etc when a handset isn't known.

It does not implement (ran out of time and no ability to test):
+ coolmenus - should be easy to slot back in.
+ some of the WML form field stuff (see commented-out member variables 
in the DocumentInfo.java class), since we didn't need it for the work we 
were doing. 
I've left the code commented out in the places where it would fit if 
anyone would like to tackle that.

Sorry it's so late - better late than never, but anyway, here's our 
contribution back for your original hard work.
Let me know of any problems or questions, although I'm still very busy 
wrapping up this project.
Can you host it?

Cheers, Murray

PS. The .tld data is pasted at the end.
Of course we can host it, Murray. Thanks for that. Source Code is available here

and here is the .TLD Murray mentioned: <tag> <name>a</name> <tag-class>net.sourceforge.wurfl.wall.AnchorTag</tag-class> <body-content>JSP</body-content> <description>Multiserve Link and Menu Item</description> <attribute> <name>href</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>accesskey</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>title</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>opwv_icon</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>style_class</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>div</name> <tag-class>net.sourceforge.wurfl.wall.DivTag</tag-class> <body-content>JSP</body-content> <description>Generic DIV handler</description> <attribute> <name>style_class</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>id</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>br</name> <tag-class>net.sourceforge.wurfl.wall.BrTag</tag-class> <body-content>JSP</body-content> <description>Generic BR handler</description> </tag> <tag> <name>img</name> <tag-class>net.sourceforge.wurfl.wall.ImgTag</tag-class> <description>img element</description> <attribute> <name>src</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>alternate_src</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>style_class</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>alt</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>align</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>width</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>height</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>nopicture</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>opwv_icon</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>eu_imode_icon</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>ja_imode_icon</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>document</name> <tag-class>net.sourceforge.wurfl.wall.DocumentTag</tag-class> <body-content>JSP</body-content> <description>Container Tag</description> <attribute> <name>disable_wml_extensions</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>disable_xhtml_extensions</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>disable_cache</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>disable_content_type_generation</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>force_template</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>default_markup</name> <description>xhtmlmp or chtml or wml</description> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>xmlpidtd</name> <tag-class>net.sourceforge.wurfl.wall.XmlpidtdTag</tag-class> <description>Generate appropriate XML Processing Instruction and DTD</description> <attribute> <name>encoding</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>head</name> <tag-class>net.sourceforge.wurfl.wall.HeadTag</tag-class> <body-content>JSP</body-content> <description>Multiserve Head Description</description> <attribute> <name>title</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>enforce_title</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>title</name> <tag-class>net.sourceforge.wurfl.wall.TitleTag</tag-class> <body-content>JSP</body-content> <description>Multiserve Title Attribute</description> <attribute> <name>title</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>enforce_title</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>body</name> <tag-class>net.sourceforge.wurfl.wall.BodyTag</tag-class> <body-content>JSP</body-content> <description>Multiserve BODY tag</description> <attribute> <name>bgcolor</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>text</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>wml_back_button_label</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>disable_wml_template</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>newcontext</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>block</name> <tag-class>net.sourceforge.wurfl.wall.BlockTag</tag-class> <body-content>JSP</body-content> <description>Multiserve p tag</description> <attribute> <name>style_class</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>align</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>p</name> <tag-class>net.sourceforge.wurfl.wall.ParagraphTag</tag-class> <body-content>JSP</body-content> <description>Multiserve p tag</description> <attribute> <name>style_class</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>align</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>style</name> <tag-class>net.sourceforge.wurfl.wall.StyleTag</tag-class> <body-content>JSP</body-content> <description>Includes a different style sheet depending on the template attribute of the DocumentInfo</description> <attribute> <name>href</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>base</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>embed</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>override</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag>

Finally, here is an email from Murray that explains what has been changed in particular:
================
What's in there:
================

+ Ability to pass in style_class to most tags for those dealing with 
modern handsets.  You can now do an xhtml style-sheet driven approach
+ WALL:div tag.
+ Appropriate calls to reset() on all WALL tags - this prevents a bug 
where subsequent tag usage shows old values.
+ A great deal of repeated code moved into helper classes:
         cm = ObjectsManager.getCapabilityMatrixInstance();
         uam = ObjectsManager.getUAManagerInstance();
         request = (HttpServletRequest) pageContext.getRequest();

         //Check the capability string
         warning = TagUtil.checkCapability("preferred_markup");
         if (warning.length() > 0) {
             throw new JspException(warning);
         }

         //get the user agent
         UA = TagUtil.getUA(this.request);
        
         device_id = uam.getDeviceIDFromUALoose(UA);

         capability_value = cm.getCapabilityForDevice(device_id, 
"preferred_markup");
         capability_value = TagUtil.getWallMarkup(capability_value);
+ Much of the repeated logic moved to a DocumentInfo class that contains 
anything that needs to be remembered about a page.
+ "if (capability_value.startsWith("xhtmlmp"))" check has been moved 
into the DocumentInfo class.
+ A WALL:style tag that gives the ability to embed or include style 
sheets, and to switch off embedding for phones that don't support it.  
Phones render faster if embedded - recommended for 3G.
+ Moved most hard coded strings into WurflConstants.java
+ Changed the System.out.println(..) to log4j calls - Our customers 
didn't allow us to go to production with println statements in the code.
+ Rendering of tags has been split out into renderers so logic can be 
re-used.  eg. BrTag and BrRenderer so users can cobble together complex 
tags for their projects by calling a series of renderers one after the 
other.
+ Fixed XHTML rendering so it renders well to normal web browsers (eg. 
Mozilla Firefox).  Hence it is easier to debug screens or check if they 
are XHTML compliant using http://validator.w3.org.
+ String TagUtil.checkCapability(String capability) was changed to: 
boolean TagUtil.isValidCapability(String capability) since that's all it 
does.
+ ObjectsManager.resetWurfl() used to set references to null, so all 
WALL renderings by other threads failed during the reload time.  Fixed 
so this means you can update WURFL at runtime.
+ WALL no longer keeps a cached reference to the WURFL, so WURFL can be 
updated at runtime.
+ When a phone isn't detected, WALL falls back to XHTML.
+ If you want WALL to fall back to another rendering when a device isn't 
detected, use default_markup="wml" in the WALL:document tag.
+ WallDocument which extends TagSupport is no longer attached to the 
request as an attribute.  The DocumentInfo object replaces this and goes 
into the request instead.
+ When a tag fails to detect a capability, some of the JspExceptions 
that used to get thrown are recovered from, since we should always 
attempt to render something in at least XHTMLMP.
+ You can now choose a style sheet depending on the handset.  
DocumentTag now has a method .setDocumentExit(DocumentExit) on it to 
adjust the DocumentInfo class.
+ Wurfl ObjectsManager can now tell you if the reload of WURFL has failed.
+ Lots of input streams in Wurfl.java are now closed.  No more resource 
leaks  ;-) 

========================
What's not in there (yet):
========================
+ Cool menus.  I ran out of time to include this but it would go in the 
wall.composite.* package.
+ some of the WML form field stuff (see commented-out member variables
in the DocumentInfo.java class), since we didn't need it for the work we
were doing.
+ I've left the code commented out in the places where it would fit if
anyone would like to tackle that - I doubt I'll get time and don't have 
the testing resources.

Copyright © 2008, Luca Passani