|
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 |
WALL with Improvements 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: 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.
|