|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Structures Editor's DraftDevice Description Repository 1cExploiting Groups of Devices for Content AdaptationEditors' Draft 16 June 2008
Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply. AbstractContent Adaptation on the Mobile Web can be simplified by creating groups for those devices that share common characteristics. This WG Note defines an XML format, a group definition syntax and an extension to the DDR Simple API that can be used in the development of adaptive Mobile Web sites that exploit grouping. Status of this DocumentThis document is an editors' copy that has no official standing. This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/. This is an Editorial Draft of a possible future W3C Note Publication as an Editorial Draft does not imply endorsement by the Device Description Working Group or the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. This document is published as part of the W3C Mobile Web Initiative (MWI) by the Device Description Working Group. It is a deliverable as defined in the Charter of that group. Please send comments to public-ddwg@.... This list is archived at http://lists.w3.org/Archives/Public/public-ddwg-comments/. This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy. Revision DescriptionTable of Contents1 Introduction Appendices1 IntroductionThe mobile handset market is innovative and dynamic but at the same time fragmented. The result is that there are thousands of different devices made by multiple manufacturers. Nonetheless the majority of handsets share common characteristics and can be grouped into families. For example, all the devices made by a manufacturer or all the devices that provide certain functionalities. Device Grouping is useful as it provides a higher level of abstraction (in an specific context), avoiding to work with specific device instances or models. Device Grouping is also a valuable tool for content adaptation on the Mobile Web. One significative example could be the dynamic generation of a web page that includes a game download menu. The version of each game to be offered to the user could depend on the manufacturer and memory restrictions imposed by the target device, among others. This particular application would benefit from the existence of a grouping mechanism. The developer could define different groups of devices specifying certain conditions to be met by the 'vendor' and 'availableMemory' property values. Our problem could also have been solved by means of 'if' statements in any programming language (using the DDR Simple API). However such approach is unflexible as a change in the Group conditions would also imply a change in the application logic. Furthermore, "harcoded" Groups defined using programming language statements do not promote knowledge reuse between companies and organizations. In order to promote a more flexible approach for Device Grouping, this W3C Note proposes an XML format, a syntax for group expressions (based on boolean conditions over the DDR properties) and an extension to the DDR Simple API. 2 Device Grouping based on XML
The device groups are defined in the XML format defined in the following sections. The XML infoset is described in XML Schema ... with each element in the
2.2 The |
| [1]Â Â Â | GroupExpr | Â Â Â ::=Â Â Â |
'not' GroupExpr
|
| '(' GroupExpr ')' | |||
| GroupExpr 'or' GroupExpr | |||
| GroupExpr 'and' GroupExpr | |||
| RelationalExpr | |||
| [2]Â Â Â | RelationalExpr | Â Â Â ::=Â Â Â | PropertyDef '>' Number |
| PropertyDef '>=' Number | |||
| PropertyDef '<' Number | |||
| PropertyDef '<=' Number | |||
| PropertyDef '=='
Number |
Literal |
Boolean
| |||
| PropertyDef '!='
Number |
Literal |
Boolean
| |||
| PropertyDef 'contains' NumberEnum | |||
| PropertyDef 'contains' LiteralEnum | |||
| [3]Â Â Â | PropertyDef | Â Â Â ::=Â Â Â | '[' PropertyNameDef ']' |
| '[' PropertyNameDef ',' AspectNameDef ']' | |||
| [4]Â Â Â | PropertyNameDef | Â Â Â ::=Â Â Â | NsPrefix':'LocalPropertyName |
| LocalPropertyName | |||
| [5]Â Â Â | AspectNameDef | Â Â Â ::=Â Â Â | NsPrefix':'LocalAspectName |
| LocalAspectName | |||
| [6]Â Â Â | LocalPropertyName | Â Â Â ::=Â Â Â | NCName |
| [7]Â Â Â | LocalAspectName | Â Â Â ::=Â Â Â | NCName |
| [8]Â Â Â | NsPrefix | Â Â Â ::=Â Â Â | NCName |
| [9]Â Â Â | NumberEnum | Â Â Â ::=Â Â Â | (' ( Number ( ',' Number )* )? ')' |
| [10]Â Â Â | LiteralEnum | Â Â Â ::=Â Â Â | '(' ( Literal ( ',' Literal )* )? ')' |
| [11]Â Â Â | Literal | Â Â Â ::=Â Â Â | '"' [^"]* '"' |
| "'" [^']* "'" | |||
| [12]Â Â Â | Boolean | Â Â Â ::=Â Â Â | 'true' |
| 'false' | |||
| [13]Â Â Â | Number | Â Â Â ::=Â Â Â |
Digits ('.' Digits?)? |
| '.' Digits
| |||
| [14]Â Â Â | Digits | Â Â Â ::=Â Â Â | [0-9]+ |
The semantics of the boolean operators used are the same as those present in programming languages like Java.
The 'contains' clause returns true if the corresponding enumerated property value includes at least the set of elements between brackets.
This note proposes two extensions to the DDR Simple API
<deviceStructures xmlns="http://www.w3.org/2008/05/structures">
<vocabularies>
<vocabulary iri="http://www.w3.org/2008/01/ddr-core-vocabulary" nsPrefix="" />
<vocabulary iri="http://example.org/vocabulary" nsPrefix="ex"/>
</vocabularies>
<groups>
<group id="NiceDevice">
<expression>
([imageFormatSupport,webBrowser] contains ('gif','jpeg') and [displayWidth] >= 240)
or [ex:rendersTables,ex:webBrowser] == true and [inputDevices] contains ('touchScreen'))
</expression>
</group>
<group id="XhtmlDevice">
<expression>
[markupSupport] contains ('xhtmlmp10','xhtmlbasic10')
</expression>
</group>
</groups>
</deviceStructures>
Properties props = new Properties();
props.put("org.w3c.ddr.structures","file:///structuresExample.xml");
ServiceExt service = (ServiceExt)ServiceFactory.newService(
"org.example.DDRServiceExt","http://www.w3.org/2008/01/ddr-core-vocabulary",props);
Evidence evidence = service.newHttpEvidence();
evidence.put("User-Agent","Example Browser 1.1 on Example Device");
if(service.belongsTo(evidence,"XhtmlDevice")) {
// Do Something
}
else {
// Do other
}
| Free embeddable forum powered by Nabble | Forum Help |