From Device Description Working Group Wiki
Jump to: navigation, search

DDR API Sketch Input from Jose Cantera (TI+D) (Version 2)

// File: DDR-API.idl

#ifndef _DDR_IDL_

#define _DDR_IDL_

#pragma prefix ""

module ddr {

	const unsigned short UNSPECIFIED_ERROR     =  1;
	const unsigned short NOT_SUPPORTED_ERROR   =  2;
	const unsigned short ACCESS_VIOLATION      =  3;
	const unsigned short SYNTAX_ERROR          =  4;
	const unsigned short NO_SUCH_ELEMENT       =  5;
	const unsigned short NO_SUCH_PROPERTY      =  6;
	const unsigned short UNKNOWN_VALUE         =  7;
	// A trade-off  between concrete and generic exceptions should be taken
	exception DDRException {
		unsigned short code;
	// It represents a unit.
	typedef string Unit;
	// XML-Schema datatype I guess
	typedef string DataType;
	// DDR's vocabulary property name (may be an alias to the ontology)
	typedef string PropertyName;
	// This is the URI of the property according to the DC Ontology (normative property name)
	typedef string OntologyIdentifier;
	// Path to a property of the delivery context
	// For example: /device/deviceHardware/display
	typedef string DeliveryContextPath;
	typedef string InformalDescription;  // i.e. Needs a human to interpret
	const Unit NO_UNIT = "";
	// A property in a DDR	
	// This represents  a property i.e. all  the characteristics of a property
	interface DDRProperty {
		readonly attribute OntologyIdentifier id;
		readonly attribute PropertyName name;
		readonly attribute DataType type;
		readonly attribute Unit defaultUnit;
		readonly attribute InformalDescription description;

	// This is a property value measured in certain units, 
	interface DDRPropertyValue {
		readonly attribute DDRProperty property;
		readonly attribute any value;
		readonly attribute Unit unit;

	// A lis of values for a property
	interface DDRPropertyValueList {
		readonly attribute unsigned long length;
		DDRPropertyValue item(in unsigned long index) raises(DDRException);
		readonly attribute DDRPropertyValue defaultValue;
	// This represents an element of the delivery context (Device, Browser, Display, Camera, etc)
	interface DCElementDescription {
		// What's a property name? URI according to the ontology? Shortcut? UAProf property??
		DDRPropertyValue getPropertyValue(in DeliveryContextPath propertyName) raises(DDRException);
		// Does it raise an exception when the property is not available in that unit? How to deal with this
		DDRPropertyValue getPropertyValueInUnits(in DeliveryContextPath propertyName,in Unit unit) raises(DDRException);
		DDRPropertyValueList getPropertyValues(in DeliveryContextPath propertyName) raises(DDRException);
		DDRPropertyValueList getPropertyValuesInUnits(in DeliveryContextPath propertyName,in Unit unit) raises(DDRException);
	interface DCElementDescriptionList {
		readonly attribute unsigned long length;
		DCElementDescription item(in unsigned long index) raises (DDRException);
	// This interface represents all the delivery context. Usin this interface I can ask for different properties of the delivery context
	interface DeliveryContext : DCElementDescription {
		DCElementDescription getDeliveryContextElement(in DeliveryContextPath path) raises(DDRException);
	module core {	
		// A condition over to query info on the DDR
		typedef string DeliveryContextCondition;
		struct ContextInfoPair {
			string element;
			string value;
		typedef sequence<ContextInfoPair> ContextInfo;
		interface ContextInformation {
			void put(in string element,in string value);
			string get(in string element);
			ContextInfo getAll();
		interface Repository {
			DeliveryContext getDeliveryContext(in ContextInformation contextInfo) raises(DDRException);
			DCElementDescriptionList query(in DeliveryContextCondition condition) raises(DDRException);
	// To be defined Ckeck the Requirements
	module admin {
		interface RepositoryExt : Repository {
			void addProperty(in DDRProperty property);
			void addDCElementDescription();
			void removeProperty();
			void removeDCElementDescription();


Questions raised in this version