SData quick start (sdata)
De Wiki1000
(Différences entre les versions)
(→Second setp : Create a basic model) |
(→Second setp : Create a basic model) |
||
Ligne 10 : | Ligne 10 : | ||
===Second setp : Create a basic model=== | ===Second setp : Create a basic model=== | ||
− | A typical sdata application contains a persistent entity model and a sdata | + | A typical sdata application contains a persistent entity model and a sdata Contract which expose this model. |
− | *Create a new package of type "Paquet de classe métier", this | + | *Create a new package of type "Paquet de classe métier", this package will be your entity model |
− | *Add model elements to this | + | *Add model elements to this package : enumerations, classes, .... |
− | *Create a new | + | *Create a new package of type "Paquet de service local", this package will be your sdata Contract |
− | :*In the contract field enter the sdata | + | :*In the contract field enter the sdata Contract name |
:*In the domaine enter the sdata contract URI, typically this is the same URI as the packet. | :*In the domaine enter the sdata contract URI, typically this is the same URI as the packet. | ||
− | *In the service | + | *In the service package add views for your entity, select "Classe entité de service local" as the view stereotype. You can add properties with the "Importer les attributs de la classe de base" button |
− | You have now a basic model with its associate sdata | + | You have now a basic model with its associate sdata Contract |
===Third step : Enter basic datas=== | ===Third step : Enter basic datas=== |
Version actuelle en date du 5 mai 2011 à 10:32
Sommaire[masquer] |
First step : Create a simple application
In the Administation tool
- Create an empty Application with the system module
- Create a Folder for this application with an associate data base, add your user to the autorized user list
You can now log in the application
Second setp : Create a basic model
A typical sdata application contains a persistent entity model and a sdata Contract which expose this model.
- Create a new package of type "Paquet de classe métier", this package will be your entity model
- Add model elements to this package : enumerations, classes, ....
- Create a new package of type "Paquet de service local", this package will be your sdata Contract
- In the contract field enter the sdata Contract name
- In the domaine enter the sdata contract URI, typically this is the same URI as the packet.
- In the service package add views for your entity, select "Classe entité de service local" as the view stereotype. You can add properties with the "Importer les attributs de la classe de base" button
You have now a basic model with its associate sdata Contract
Third step : Enter basic datas
If your model uses currency you have to define some framework objects :
- Some currencies, you need at least the account currency (euro in Europe, iso code EUR)
- Use the data explorer, select Framework classes and "Devise", add the needed currencies
- Some system parameter : DeviseTC and DeviseRP
- Use the data explorer, sleect Framework classes and "Paramètre systeme", add the two object with code DeviseTC and DeviseRP and value the account currency iso code you just added.
After that you have working monetary types and you wan create simple set of datas for your model entities.
Four step : Set up a service for your application
- In your serverl1000.ini add entry for your application, this example is a simple entry
[\SOFTWARE\Sage\Ligne 1000\Administration\Servers\SYFRE] Master Profil=dbMasterTahoe Server Societies=Test Syfre iPhone Server Application=Test Syfre IPhone Server User=syfre Server Password= Public Folder=D:\Mes documents\Server\ BP Started=1 Automate Started=0 DEBUGGER Started=1 DEBUGGER Users=toto,titi SESSIONS profil=CONFIG_SESSION_1 SOAP Profil=CONFIG_SOAP_1 SNMP Profil=CONFIG_SNMP_1 SMTP Profil=CONFIG_SMTP_2 PROCESS Profil=CONFIG_PROCESS_1
sdata requires to expose end points in the service registry, end point defines contracts and dataset which are serviced by the Service.
To defines these end points you need a SData section, this example defines a end point for a ndfContract on a iphone dataset :
[\SOFTWARE\Sage\Ligne 1000\Administration\Servers\SYFRE\SData\1] DataSetName=iphone Title=syfre iphone Contract=ndfContract Version=1 Folder=Test Syfre iPhone Database=dbTestIPhone Society=
You can now start your service and test sdata access using any browser :
Show contract list : http://syfre/syfre/server/sdata/l1000 Show dataset list for a contract : http://syfre/syfre/server/sdata/l1000/ndfContract Show entity list for a contract in a dataset http://syfre/syfre/server/sdata/l1000/ndfContract/iphone