Creating Data Services Server Artifacts
This page describes how to create artifacts for the Data Services Server. It contains the following sections:
Creating a Data Service Project
To create a Data Service Project, open WSO2 Developer Studio Dashboard and select Data Service Project from Data Services Server category.
There are two ways to create a data service.
- New Data Service
- Import Data Service
With the New Data Service option, you will get an empty data service according to the information that you have provided. At the same time, you can upload a Data Service Descriptor file with the extension of .dbsfrom the file system.
If you select New Data Service option, and click Next, wizard page will ask you general information like Project Name, Data Service Name etc. Give necessary information and click Next.
In the next page, you need to specify information regarding the Data Source that you are going to use in your data service.
Â
There are several defined data sources. Information below will be filled according to the Database Engine you have selected. Suppose I select MySQL as my Database Engine. As you can see, Driver Class and the format of JDBC URL will be filled for you. You have to specify User Name field and Password field.
After giving necessary information, click Finish. Now you will see that the created Data Service has opened with Graphical Data Services Editor.
With this Graphical Editor, you can add different Data Sources, Queries, Operations etc in a very convenient manner.
If you are quite familiar with Data Services Descriptor language, you can navigate to source view and add components. Source view is fully functioned with content assist capability which will ease the pain of editing to great level.
With the Import Data Service option, you can browse for data service descriptor (dbs) file in your file system.
Now you will see a new Data Service Project has been created in the workspace and the data service descriptor (dbs) file open with graphical editor.
As you did for all the other projects, you can export the created Data Service Project in to a deployable artifact by right click on the project and select Export Project as Deployable Archive. With this it will create you a dbs file, which you can deploy in to any WSO2 Data Services Server. At the same time, you can group it with a Carbon Application Project and create the Carbon Application Archive [CAR] and deploy in to the Carbon Server.
Creating a Data Services Validator Project
To create a Data Services Validator Project, open WSO2 Developer Studio Dashboard and select Data Services Validator Project from Data Services category.
There are two ways to create an Data Services Validator Project.
- Create New Data Service Validator Project
- Import Project From Workspace
If you select Create New Data Service Validator Project option, you can create a new Data Service Validator Project from the scratch. Give necessary information as Project Name, Package Name and Class Name. Then click Finish.
Once you click Finish, you will see a new project has been created in the workspace and it has a data services class which is implementing org.wso2.carbon.dataservices.core.validation.Validator class.
In that class, you can implement your data services validator logic according to your requirement.
If you select Import Project From Workspace option, it will list all the projects which include source files that are being implemented by org.wso2.carbon.dataservices.core.validation.Validator.
Specify other information if necessary and click Finish. Now you will see that the project you select the data services validator class has become a Data Services Validator Project.
Once you click Finish, you will see that the selected project also added with the project nature of org.wso2.developerstudio.eclipse.artifact.ds.validator.project.nature and you will see a new icon has been added to the project.
Â
As you did for all the other projects, you can export the created Data Services Validator Project in to a deployable artifact by right click on the project and select Export Project as Deployable Archive. With this it will create you a jar file, which is a bundle that you can deploy in to any WSO2 Data Services Server. At the same time, you can group it with a Carbon Application Project and create the Carbon Application Archive [CAR] and deploy in to the WSO2 Data Services Server.