Remote Data Sources
Setting up a databsase connection through OData.
Last updated
Setting up a databsase connection through OData.
Last updated
"Open Data Protocol (OData) is an open protocol which allows the creation and consumption of queryable and interoperable RESTful APIs in a simple and standard way." The WEM Modeler uses OData to access the database of an external system. And in order to do that, you need to specify where that database resides and what data can be accessed. Once WEM has this information, you can directly access the data from e.g. an interaction node. We call a system that is accessed through Data a Remote data source
.
Setting up a new Remote data source
is very simple. Follow these steps:
Go to the Remote data source
node in the Project tree. Click on Add data service
.
Give the service a name, this is the name that WEM will use for this particular data service.
You can now add a URL, and if needed, fill in the Username and Password for the source.
Based on these credentials the remote data source gives access to the database, including the specific rights this user has (insert, update, delete rights).
If the metadata or data model changes the service needs the current information. To update the service itself, click on the update odata service definition
button and WEM will update the data service. This can be found by right clicking the service you want to change or opening the context menu with the 3 dots when you have the intended service selected.
Alternatively, manually update the OData source by selecting 'Edit Settings' from the same context menu. This opens a window where you can update the name, service URL, settings for File URL's and batch optimization, the credentials for preview staging and live and service root URL's.
Once the remote data source is specified, it can be accessed via the WEM Modeler. Everywhere in WEM where you can access data, you can access this remote data source. E.g. if you are working an interaction node, the list(s) that represent the remote data can be found in the webservice tab of the resource pane under the specified datasource. Or when you create an expression using the expression editor, you can access the same remote data source lists and fields.
It is possible to expose your WEM application's data using the OData protocol. When you do this, external systems can access the data of your application using OData. Exposing OData is very straightforward:
Create user credentials that will be used by external systems to access the data of your application. The credentials can be found in the settings tab under the security settings on the right. Here you you can manage and add access to the OData lists and user access settings.
After you have created the user credentials you specify which list(s) in your data model are exposed to that user (and therefore to the external system);
Here you can also specify for each list which operations are available to that user (and therefore to the external system).
Once the steps above have been executed, your application is accessible via OData. Note: exposing your application via OData is always done per portal. In other words, you need to specify access per portal.
The next sections describe each step in more detail.
Managing OData users is done via the security settings found on the project setting page. When you go to the project settings and click on OData logins, you will see the following window open:
Here you can manage, add and see all active OData logins and control their access level. In the first column you can see the username used to log in to the service and the Portal column is where you specify either one or all portal used by the service for each user.
Management of the data list that is available for each user is managed by clicking the blue access link in the third column. This will open a new window called access control for 'username', here you select the access level and which specific lists are available through Odata. First you choose between giving full access and a restricted access, with the restricted setting allowing you to choose specific lists like the image below. More about this at the end.
This is the first page to add a new OData login user to your project. Here you set up the name/username, password and the portal(s) you want to provide access to. When this is filled in correctly you can go to the next page for the access level settings. This is the same screen as managing existing users access level. When you are done you save the user with the create button.
Deleting users can be done from the OData logins screen from earlier. In this screen the context menu for each user can be opened with the three dots on the right of the window. From here you can also change the access control, change usernames, change passwords and delete the users and its access to the data.
Once an OData user has been created, this user can be given access to your application's data. To do this, select the user you want to manage and select Access control rules
. This will bring up the following screen:
There are two main options:
1.Allow full access to all data
- this is the default selection.This option means that the user can access all lists of your application and has the right to insert data, update data or delete data for all the lists in your application. In other words, the user has full control over your application's data;
2.Specify access rules
This option makes it possible to have very granular control over providing access to your application's data. When this option is selected, you can specify which lists the user has access to and which actions can be performed on this list.
When the first option is selected the individual lists will be greyed out, but when the restricted access is selected you can start allowing to read on specific lists. The other options are available when the read is already selected, users will always need to be able to read the lists before they can get additional rights. Besides being able to read the data in the list you also have the following options:
Allow insert
- the user (external system) can insert new rows to the selected list;
Allow update
- the user (external system) can update data in the selected list;
Allow delete
- the user (external system) can delete rows in the selected list.
By selecting one or more options, it is possible to control exactly what the user (and therefor the external system) can do with the selected list.
You can repeat the steps above to select all lists of your application that need to be exposed.
When you click on in the top left of the Odata logins window this popup appears: