From OpenHome

(Difference between revisions)
Jump to: navigation, search
(Created page with "= Introduction = This document is for Widget manufacturers using OpenHome to define Widget services and properties. The services and properties are defined in XML, following th...")
Line 28: Line 28:
to see how the XML is used:
to see how the XML is used:
* [[ohWidget Driver Development|OpenHome Widget Driver Development]]
* [[ohWidget Driver Development|OpenHome Widget Driver Development]]
 +
 +
 +
= Widget Service XML =
 +
 +
The Widget Service XML file is used to define the features that your Widget provides to users.
 +
 +
Each of these features is described as a property in the Widget Service XML. This may be a simple light Widget offering an on/off — or power — property, or a more complicated Widget offering volume, bass, and treble properties.
 +
 +
Your Widget Service XML file can contain as many properties as are necessary to describe the full range of the Widget's feature set. Your Widget Service XML must contain at least one property.
 +
 +
== Internal structure ==
 +
 +
The Widget Service XML file is validated against an XSD. The XSD is included in the OpenHome SDK.
 +
 +
Snippet 1 shows an abstract hierarchy of the elements used in a Widget Service XML file.
 +
 +
widgetservice
 +
  description
 +
  version
 +
      major
 +
      minor
 +
  propertylist
 +
      property
 +
          name
 +
          description
 +
          dataType
 +
          access
 +
          allowedValueList*
 +
              allowedValue
 +
          allowedValueRange*
 +
              minimum*
 +
              maximum*
 +
              step*
 +
 +
Snippet 1: An abstract view of a Widget Service XML, showing the structure of the various elements used.
 +
Elements marked * are optional.
 +
 +
The structure of the XML is defined by OpenHome. You cannot change it and expect your Widget to operate on an OpenHome network. However, some of the files you generate from it can be customized.
 +
 +
 +
== External document dependencies ==
 +
 +
Your Widget Service XML is used in several areas of Widget development. Several files are automatically generated from this one. Driver authors and UI developers both depend heavily on the code generated from your Widget Service XML. It is therefore essential that you write a well-formed Widget Service XML, conforming to the schema defined in the WidgetService.xsd.
 +
 +
The diagram below shows the significance of the Widget Service XML in relation to the generated files used by other developers to define and publish your Widget on an OpenHome network:
 +
 +
Figure 1: The OpenHome document hierarcy, showing the files you can generate from the Widget Service
 +
XML.

Revision as of 11:24, 1 March 2012

Contents

Introduction

This document is for Widget manufacturers using OpenHome to define Widget services and properties. The services and properties are defined in XML, following the schema published by OpenHome.

Note

Note The OpenHome SDK contains a copy of the WidgetService.xsd used for validation. OpenHome may occasionally update the XSD definition to include new Widget properties. When these become available, OpenHome will publish the new XSD documents on openhome.org. All new XSD documents will be included in new releases of the SDK.


To help you produce your Widget Service XML file, this document provides descriptions of each element you can use in your own Widget Service XML file. A sample Widget Service XML file is used throughout the document.


Prerequisites

To begin defining your Widget Service XML you must in possession of the following items:

  • technical details about the properties your Widget physically provides
  • the OpenHome SDK, specifically the WidgetService.xsd file


Related documents

The XML you define is used in several areas of Widget development. Refer to the following documents to see how the XML is used:


Widget Service XML

The Widget Service XML file is used to define the features that your Widget provides to users.

Each of these features is described as a property in the Widget Service XML. This may be a simple light Widget offering an on/off — or power — property, or a more complicated Widget offering volume, bass, and treble properties.

Your Widget Service XML file can contain as many properties as are necessary to describe the full range of the Widget's feature set. Your Widget Service XML must contain at least one property.

Internal structure

The Widget Service XML file is validated against an XSD. The XSD is included in the OpenHome SDK.

Snippet 1 shows an abstract hierarchy of the elements used in a Widget Service XML file.

widgetservice
  description
  version
      major
      minor
  propertylist
      property
          name
          description
          dataType
          access
          allowedValueList*
              allowedValue
          allowedValueRange*
              minimum*
              maximum*
              step*

Snippet 1: An abstract view of a Widget Service XML, showing the structure of the various elements used. Elements marked * are optional.

The structure of the XML is defined by OpenHome. You cannot change it and expect your Widget to operate on an OpenHome network. However, some of the files you generate from it can be customized.


External document dependencies

Your Widget Service XML is used in several areas of Widget development. Several files are automatically generated from this one. Driver authors and UI developers both depend heavily on the code generated from your Widget Service XML. It is therefore essential that you write a well-formed Widget Service XML, conforming to the schema defined in the WidgetService.xsd.

The diagram below shows the significance of the Widget Service XML in relation to the generated files used by other developers to define and publish your Widget on an OpenHome network:

Figure 1: The OpenHome document hierarcy, showing the files you can generate from the Widget Service XML.