Commit fd8f731d authored by ankraft's avatar ankraft

Updated Readme, Introduction and SDT Build system. Updated some images

parent 9ee51d0b
<?xml version="1.0" encoding="UTF-8" ?>
<!-- - HGI Device Abstraction Layer - - - - - - - - - - - - - - - - - - - - -->
<!-- SDT - Smart Device Template Build File -->
<!-- -->
<!-- Extends the standard build with targets for: -->
<!-- - generate XML schema the from Relax NG (xml) description -->
<!-- - validate DAL documents against the XML Schema -->
<!-- - generate HTML documentation from DAL documents -->
<!-- Extends the standard build with targets for: -->
<!-- - generate XML schema the from Relax NG (xml) description -->
<!-- - validate DAL documents against the XML Schema -->
<!-- - generate HTML documentation from DAL documents -->
<project name="importing" basedir="." default="schemas">
<import file="etc/common.xml"/>
......
This diff is collapsed.
# Build System Libraries and Licenses
# SDT Build System Components and Licenses
The following libraries are used in the build system for the SDT.
## trang.jar
......
# SDT Build System
This document describes the SDT build system and how to build the SDT and validate new contributions.
This document describes the SDT build system and how to build the SDT and validate new templates and contributions.
The files referenced in this document point to version **4.0** of the SDT.
......@@ -7,43 +7,47 @@ The files referenced in this document point to version **4.0** of the SDT.
- [SDT/schema4.0/](../..) : Base directory
- [SDT/schema4.0/src/](../src/) : Source files of the SDT.
- [domain.rng](../src/domain.rng) : RELAX NG file with the SDT schema definition. This is the source file that is converted to the actual schema definition *domain.xsd* during the build. See also [http://en.wikipedia.org/wiki/RELAX_NG](http://en.wikipedia.org/wiki/RELAX_NG).
**Only edit this file when one wants to make changes to the SDT!**
- [domain.xsd](../src/domain.xsd) : The SDT schema definition that is generated from *domain.rng*.
**Only edit this file when you want to make changes to the SDT!** See also [Editing](#Editing) below.
- [domain.xsd](../src/domain.xsd) : The actual SDT schema definition that is generated from *domain.rng*.
- [xml.xsd](../src/xml.xsd) : General schema definitions for the SDT
- [SDT/schema4.0/test/](../test/) : This directory contains all XML files with SDT definitions that should be validated whether they conform to the SDT schema. This could be example definitions or contributions.
- [SDT/schema4.0/test/](../test/) : This directory contains XML files with SDT definitions that should be validated whether they conform to the SDT schema.
This could be example definitions or new templates and contributions. If you want to validate your newly created template put it into this directory and follow the steps descripted in [Validate SDT Templates](#Validate) below.
- [SDT/schema4.0/build.xml](../build.xml) : This is the definition file for the ant build system.
- [SDT/schema4.0/etc/](../etc/), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Please, don't make unnecessary changes to these files.
- [SDT/schema4.0/etc/](../etc), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Please, don't make unnecessary changes to these files.
- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc) : This file contains various configuration parameter to convert the file [domain.rng](../src/domain.rng) to schema file. **The important parameter to change when changing the namespace or the version number is**:
default namespace xsl = "http://homegatewayinitiative.org/xml/dal/3.0"
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml) : This file contains the header for the schema file. **This must be changed when changing the namespace or the version number.**
- [SDT/schema4.0/etc/](../etc/), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Please, don't make changes to these files.
- [SDT/schema4.0/etc/](../etc), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Only the following files should be changed if necessray. See the section [Editing](#Editing) below.
- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc) : This file contains various configuration parameter to convert the file [domain.rng](../src/domain.rng) to schema file.
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml) : This file contains the header for the schema file.
- [SDT/schema4.0/etc/schema.xmlns](../etc/schema.xmlns) : This file defines the target namespace for the schema.
- [SDT/schema4.0/lib/](../lib/) : Tasks for the ant-based build system. See also [SDT Build System Components and Licenses](SDT%20Build%20System%20Components%20and%20Licenses.md).
## Installation
- Install Java on your computer
- Download and install Apache ant from [http://ant.apache.org](http://ant.apache.org)
- Clone the SDT repository from GitHub:
$ git clone https://github.com/Homegateway/SmartDeviceTemplate.git
### Prerequisites
- Java
- Ant (at least version 1.8). See [http://ant.apache.org](http://ant.apache.org).
### Installing SDT
- Clone the SDT repository from oneM2M's GitLab:
$ git clone https://git.onem2m.org/MAS/SDT.git
## How to Use the Build System
After cloning the repository go to the directory *SDT/schema* and run commands depending on what you want to achieve.
After cloning the repository go to the directory *SDT/schema4.0* and run commands depending on what you want to achieve.
### Build the Schema
Running *ant* without any parameter builds the schema definition from the rng-definition [SDT/schema4.0/src/domain.rng](../src/domain.rng) and writes it to [SDT/schema4.0/src/domain.xsd](../src/domain.xsd)
$ cd SDT/schema
$ cd SDT/schema4.0
$ ant
### Validate SDT Definitions
<a name="Validate"/></a>
### Validate SDT Templates
You can use the build system to validate new SDT definitions or changes made to existing ones by running the following command:
$ cd SDT/schema
$ cd SDT/schema4.0
$ ant validate
The output after a successful validation should look like this:
The output after a successful validation should look similar this:
>[schemavalidate] 2 file(s) have been successfully validated.
>BUILD SUCCESSFUL
......@@ -56,18 +60,30 @@ Otherwise you most likely receive a stack trace or some other error messages. Se
---
<a name="Editing"/></a>
## Editing
As mentioned above, the actual schema definition is defined in the file [domain.rng](../src/domain.rng) and converted to the XML schema definition [domain.xsd](../src/domain.xsd) during the build process.
As mentioned above, the actual schema definition is defined in the file [src/domain.rng](../src/domain.rng) and converted to the XML schema definition [src/domain.xsd](../src/domain.xsd) during the build process.
**All changes to the schema must therefore be made in [domain.rng](../src/domain.rng), NOT [domain.xsd](../src/domain.xsd) !**
**All changes to the schema must only be made to [src/domain.rng](../src/domain.rng), NOT [src/domain.xsd](../src/domain.xsd) !**
You may need to make additional changes in the following files, e.g. when the name space or the version number need to be adjusted.
PLEASE ONLY EDIT THESE FILES IF NECESSARY.
PLEASE EDIT THESE FILES ONLY IF NECESSARY.
- [SDT/schema4.0/build.xml](../build.xml)
e.g. in the *ant* target "validate"
e.g. change the *ant* target "validate" when you want to set another directory for the files for validation.
- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc)
e.g. the entry "default namespace xsl"
- [SDT/schema4.0/etc/schema.xmlns](../etc/schema.xmlns)
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml)
The important parameter to update when changing the namespace or the version number is:
default namespace xsl = "http://www.onem2m.org/xml/sdt/4.0"
- [SDT/schema4.0/etc/schema.xmlns](../etc/schema.xmlns)
This file must be updated when changing the namespace or the version number:
targetNamespace="http://www.onem2m.org/xml/sdt/4.0"
xmlns="http://www.onem2m.org/xml/sdt/4.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml)
Upate the namespace when changing the namespace or the version number:
<namespace ns="http://www.onem2m.org/xml/sdt/4.0" typeId="DAL"/>
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