Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » How to distinguish the "sub-resouce" and "attribute" in xsd schema?
How to distinguish the "sub-resouce" and "attribute" in xsd schema? [message #1713556] Thu, 05 November 2015 06:56 Go to next message
David Zheng is currently offline David ZhengFriend
Messages: 11
Registered: April 2015
Junior Member
Dear,
I am now tracing the OM2M source code.

In the org.eclipse.om2m.commons, we can see the xsd file which is provided by ETSI M2M.
For example, "sclBase.xsd" defined the following complexType

<complexType name="SclBase">
<all>
<element ref="tns:accessRightID" minOccurs="0" />
<element ref="tns:searchStrings" minOccurs="0" />
<element ref="tns:creationTime" minOccurs="0" />
<element ref="tns:lastModifiedTime" minOccurs="0" />
<element ref="tns:aPocHandling" minOccurs="0" />
<!-- subresources -->
<element ref="tns:sclsReference" minOccurs="0" />
<element ref="tns:applicationsReference" minOccurs="0" />
<element ref="tns:containersReference" minOccurs="0" />
<element ref="tns:groupsReference" minOccurs="0" />
<element ref="tns:accessRightsReference" minOccurs="0" />
<element ref="tns:subscriptionsReference" minOccurs="0" />
<element ref="tns:discoveryReference" minOccurs="0" />
</all>
</complexType>


I am wondering what is the different between "attributes" and "sub-resources". I mean, how do OM2M know "tns:accessRightID" is an attribute while "tns:sclsReference" is s sub-resource?
I've read the TS-102921, but couldn't get more information about this.

Thanks so much!
Re: How to distinguish the "sub-resouce" and "attribute" in xsd schema? [message #1713584 is a reply to message #1713556] Thu, 05 November 2015 10:21 Go to previous message
Francois AissaouiFriend
Messages: 38
Registered: April 2015
Member
Dear David,

The ETSI M2M resource structure is a Tree. It means that we have a root resource (the SCL) that will have child resources, and each one will also have child resources and so on.

The attributes are value that characterize the actual resource. In your case, the "tns:accessRightID" is the identifier of the accessRight that allow the platform to know if the requester is allowed or not to see, created underneath resources, update the current resource or delete it.
The other element, "tns:accessRightsReference" is the link to the child collection of accessRights. They are child resources of sclBase resource but does not necessarly qualify the sclBase.

Another point is that "references" are set statically depending on the name of the current resource. They are only links to collections of sub-resources. When you perform a GET on the collection pointed by the reference, you will have the list of child resources of the specific type ("sclsReference" for remoteScl, "applicationsReference" for applications, etc.).
At the opposite, attributes are often provided by the user at creation time of the resource. Some attributes are set automatically by the platform.

Hope this can help,
François
Previous Topic:Missing plugins
Next Topic:Maximum number of content instances in a Container
Goto Forum:
  


Current Time: Wed Apr 24 16:56:13 GMT 2024

Powered by FUDForum. Page generated in 0.02649 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top