Download presentation
Presentation is loading. Please wait.
Published byDominic Brooks Modified over 11 years ago
1
Client Access A proposal for client access
2
Requirements It must be simple for the bundle writer to deliver content to a diverse range of clients Separation of content and markup Performance issues, leverage smart clients Legacy clients Localisation issues
3
Architecture: Whiteboard Publisher Bundle A Bundle B Http Forum Display Registration events Only registers and modifies when data changes
4
Class Overview Publisher name Document DTD XSL templates Topic name title Element tag name attributes Has available 0..n Has sub topics 0..n 1 1 1 1 1 1 Document data Object 0..n 1 1 Enough information to generate XML Session capabilities attributes Literal for XML specials Object[]String Vector Locale 1
5
English Html style sheet WML style sheet Dutch Instance example Document dtd=http://w3c… xsl: html, wml Html style sheet WML style sheet Vector String M&C App Element tag=version Element tag=sensors Element tag=top String 1.1 Element[3] tag=sensor (=actual sensor) Element tag=actuator Element[1] tag=actuator (=actual actuator)
6
Auto Generated XML M & C App …. …. …. ….
7
Advantages Correct generation of XML –Closing tags –Correct character encoding (entities, escaping) Better performance due to less string handling Much less code for bundle authors Sessions Security
8
Publisher Interfaces/Classes public interface Publisher { String getName(); Topic getMainTopic(Locale language); Document createDocument( Session session, String topic, Dictionary parameters, boolean post ); URL getResource(String name); } public class Topic { public Topic( String name, String title, String [] users, Topic[] topics ); public Topic( String name, String title); public void updated(); String getName(); String getTitle(); long getModifiedTime(); String [] getAuthorizedUsers(); Topic [] getSubTopics(); }
9
Document Interfaces public interface Document { String getDTD(); Element getData(); // -> data URL getTemplate(String mime); // -> format } public interface Element { String getName(); Dictionary getAttributes(); Object getContent(); } public interface Literal { String toString(); }
10
Session Interface public interface Session { String getUser(); String getBaseURL(); longgetCreateTime(); longgetLastAccessTime(); String [] getAcceptedMimeTypes(); void setValue( String key, Object value ); void removeValue( String key ); Object getValue( String key ); void delete(); }
11
Publisher code static Topic main_nl = new Topic( main_nl, Welkom ); static Topic main_en = new Topic( main_en, Welcome ); String getName() { return sample; } Topic getMainTopic( Locale locale ) { return locale.getCountry().equals(NL) ? main_nl : main_en; } Document createDocument( Session session, String tpc, Dictionary p){ return new DocumentImpl( main, DTD, new ElementImpl( top, null, Hello World ) getClass() ); } URL getResource( String name ) { return getClass().getResource(name); }
12
Status Halfway an HTTP implementation –Will handle session & security –Browser profiles select between XSL in the browser or local Will include library for simplifying XML handling Example family calendar Question: Shall we continue this?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.