Commit 982d002d authored by ankraft's avatar ankraft

Changed Product to ProductClass. Changed test case accordingly

parent 8103002b
...@@ -18,7 +18,7 @@ Domain = ...@@ -18,7 +18,7 @@ Domain =
element DataTypes { DataTypeDef+ }?, element DataTypes { DataTypeDef+ }?,
ModuleClassesDef?, ModuleClassesDef?,
DeviceClassesDef?, DeviceClassesDef?,
ProductsDef? ProductClassesDef?
} }
PropertiesDef = PropertiesDef =
element Properties { element Properties {
...@@ -128,19 +128,16 @@ ModuleClassesDef = ...@@ -128,19 +128,16 @@ ModuleClassesDef =
Events? Events?
}+ }+
} }
ProductsDef = ProductClassesDef =
element Products { element ProductClasses {
element Product { element ProductClass {
attribute id { xsd:Name }, attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?, attribute semanticURI { xsd:anyURI }?,
DocDef, DocDef,
PropertiesDef?, PropertiesDef?,
ModuleClassesDef?, ModuleClassesDef?,
SubDevicesRef?, SubDevicesRef?,
element DeviceClass { element DeviceClass { ExtendDef }?,
# TODO: Make optional?
ExtendDef
},
ExtendDef? ExtendDef?
}+ }+
} }
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<ref name="DeviceClassesDef" /> <ref name="DeviceClassesDef" />
</optional> </optional>
<optional> <optional>
<ref name="ProductsDef" /> <ref name="ProductClassesDef" />
</optional> </optional>
</element> </element>
</define> </define>
...@@ -366,10 +366,10 @@ ...@@ -366,10 +366,10 @@
</define> </define>
<define name="ProductsDef"> <define name="ProductClassesDef">
<element name="Products"> <element name="ProductClasses">
<oneOrMore> <oneOrMore>
<element name="Product"> <element name="ProductClass">
<attribute name="id"> <attribute name="id">
<data type="Name"/> <data type="Name"/>
</attribute> </attribute>
...@@ -388,9 +388,11 @@ ...@@ -388,9 +388,11 @@
<optional> <optional>
<ref name="SubDevicesRef" /> <ref name="SubDevicesRef" />
</optional> </optional>
<element name="DeviceClass"> <!-- TODO: Make optional? --> <optional>
<ref name="ExtendDef" /> <element name="DeviceClass">
</element> <ref name="ExtendDef" />
</element>
</optional>
<optional> <optional>
<ref name="ExtendDef" /> <ref name="ExtendDef" />
</optional> </optional>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<xs:element minOccurs="0" ref="DataTypes"/> <xs:element minOccurs="0" ref="DataTypes"/>
<xs:element minOccurs="0" ref="ModuleClasses"/> <xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="DeviceClasses"/> <xs:element minOccurs="0" ref="DeviceClasses"/>
<xs:element minOccurs="0" ref="Products"/> <xs:element minOccurs="0" ref="ProductClasses"/>
</xs:sequence> </xs:sequence>
<xs:attribute ref="xml:base"/> <xs:attribute ref="xml:base"/>
<xs:attribute name="id" use="required" type="xs:Name"/> <xs:attribute name="id" use="required" type="xs:Name"/>
...@@ -275,14 +275,14 @@ ...@@ -275,14 +275,14 @@
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="Products"> <xs:element name="ProductClasses">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element maxOccurs="unbounded" ref="Product"/> <xs:element maxOccurs="unbounded" ref="ProductClass"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="Product"> <xs:element name="ProductClass">
<xs:complexType> <xs:complexType>
<xs:complexContent> <xs:complexContent>
<xs:extension base="DocDef"> <xs:extension base="DocDef">
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
<xs:element minOccurs="0" ref="Properties"/> <xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="ModuleClasses"/> <xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="SubDevices"/> <xs:element minOccurs="0" ref="SubDevices"/>
<xs:element name="DeviceClass"> <xs:element minOccurs="0" name="DeviceClass">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element ref="Extend"/> <xs:element ref="Extend"/>
......
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<Domain xmlns="http://www.onem2m.org/xml/sdt/4.0" xmlns:xi="http://www.w3.org/2001/XInclude" id="deviceClass-test" > <Domain xmlns="http://www.onem2m.org/xml/sdt/4.0" xmlns:xi="http://www.w3.org/2001/XInclude" id="productClass-test" >
<Products> <ProductClasses>
<Product id="TestProduct" semanticURI="http://example.com/TestProduct.rdf"> <ProductClass id="TestProduct" semanticURI="http://example.com/TestProduct.rdf">
<Doc>This is a test product</Doc> <Doc>This is a test product</Doc>
<Properties> <Properties>
<Property name="aProperty"> <Property name="aProperty">
...@@ -25,10 +25,21 @@ ...@@ -25,10 +25,21 @@
<DeviceClass> <DeviceClass>
<Extend domain="deviceClass.test" entity="Test" /> <Extend domain="deviceClass.test" entity="Test" />
</DeviceClass> </DeviceClass>
</Product> </ProductClass>
<!-- TODO: test <extends> element, but only when DeviceClas is optional <!-- TODO: test <extends> element, but only when DeviceClas is optional
<Product id="AnotherTestProduct"> <Product id="AnotherTestProduct">
</Product> --> </Product> -->
</Products>
<!-- Derived ProductClass -->
<ProductClass id="DerivedProduct" semanticURI="http://example.com/DerivedProduct.rdf">
<ModuleClasses>
<ModuleClass name="anotherModuleClass">
<Extend domain="hgi.dal.core" entity="BooleanState" />
</ModuleClass>
</ModuleClasses>
<Extend domain="productClass.test" entity="TestProduct" />
</ProductClass>
</ProductClasses>
</Domain> </Domain>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment