Managing DataSources

A DataSource is a Database published to a DataPortal Server that is available for transfering to a DataPortal client. DataSources are managed (added, modified, removed, monitored) through the DataPortal Server Web management area which can be accessed by pointing a browser to the URL:

http://DPhost:port/DataPortal/ManageDataPortal.jsp
(where DPhost:port is the DataPortal server host machine and port value, respectively)

A valid adminstrator user name and password must be entered to gain access to the management area. Once access is granted, the "Manage DataSources" link should be selected. The options within the DataSource management area are:
  • View Active Data Source Configuration
  • View Active DataSource Status
  • Modify Data Sources
Adding DataSources
When a DataPortal Server is first started, no DataSources will have been configured, so both the Configuration and Status areas will be empty. DataSources may be added within the "Modify DataSource" area. DataSources may be added, changed or deleted in the "Modify DataSource Area". Select the "Add DataSource" link to add a DataSource. The "Add DataSource" area contains the fields required to make a connection with the Database to be published as the DataSource. These fields are
  • DB Vendor Type
  • Host
  • DB Name
  • DataSource Name
  • User
  • Password
  • Min. Number of Connections
  • Max. Number of Connections
The DBVendor Type is selected from the drop-down menu which contains all supported vendor database types. The Host is the machine hosting the database. A port may be specified by appending a ":' followed by the port number after the host name. Normally, a port does not need to be specified if the default port for the database is used. The DB Name is the name of the database to be connected to. The DataSource Name is the name that the DataSource will be published as, which is the name that will be presented to DataPortal clients. The actual database name is not available to clients. The User and Password fields are used to specify the user and password values, if required, to connect to the database. The Min. Number of Connections and Max. Number of Connections are used to specify the range of connections used by a connection pool. DataPortal servers establish connection pools to DataSources. A connection pool is a collection of connections that can accomodate server load better than single connections. A DataPortal will start with the minimum number of connections and will add connections, as needed, up to the maximum number of connections specified. The connections in the pool are monitored and, if problems are detected, the DataPortal server will try to reestablish the connections. If access to the DataSource is to be restricted, the "yes" value of the "Require Username/Password for Access" field should be selected, otherwise, access will not be restricted.

A populated "Add DataSource" form is shown in Figure 1.


Figure 1) Add DataSource area.

Once the fields have been populated, the "Add DataSource" button may be selected. A form displaying the newly configured DataSource(s) will be displayed. If the new configuration is acceptable, the "Update" button should be selected, otherwise, additional modifications may be made. Selecting "Update" will update the DataSource configuration, but will not  change the current active DataSources. The updated fields will be displayed but greyed out, indicating they are not editable. To apply the new configuration immediately, select the "Implement DataSource Modifications Now" link. The DataPortal server will attempt to make the newly configured connections. The results will be displayed in a DataSource status page, inidicating the values of each configure DataSource connection and whether the connection was succesful or not.

Each connection for each connection pool is attempted mulitple times, if necessary, so, if connections for a requested DataSource can not be made, there may be a noticeable time delay during the connection attempt period.
There are many database, network, and firewall configuration issues which may prevent connections from being made. These include, but are not limited to, access permission for the specifed database user, correct connection port, network access to the database, enabling remote database connections, and firewall blocking of required port(s).

DataSource Username/Password Management
If a Username/Password for a DataSource is required, the corresponding values should be specified. This is done by navigating to the "Data Source User Names and Passwords" area (e.g. through the "Manage DataSources" area), (see Figure 2).



Figure 2) Manage DataSource Username/Password area.

The top text area is used for adding, editing and deleting user/password pairs. User/password pairs may be entered, one per line, user name first separated from the password with blank space. Once all pairs have been entered, the "UPDATE" button may be selected to commit the changes, which take effect immediately. The values may be changed, at any time, by repeating this process and editing, removing or adding pairs.

The lower area is used to associate available user/password pairs (as entered in the upper area) with DataSources (or vice versa). The type of action is selected by choosing a mode, one from the choices:
  1. Show User(s)/Password(s) for Selected DataSource (Select 1)
  2. Show DataSource(s) for Selected User/Password (Select 1)
  3. Apply Selected User(s)/Password(s) to Selected DataSource
If the first mode choice is selected, a datasource is selected from the available list and clicking the "APPLY" button displays the associated user/password pair value(s). Similarly, if the second mode is selected, a user/password pair is chosen and clicking the "APPLY" button displays the associated datasource(s). In the third mode, both user/password pair value(s) and datasource value(s) are selected. Clicking the "APPLY" button then implements the selected associations. The result is that the selected user/password pair(s) will be used for the selected datasource(s).


Further Controlling Access to a DataSource
Username/password combinations can be used to allow or deny any access to datasources published to a DataPortal server, as described above.  However, more detailed control over datasource access by specific users is available by using datasource user access control configuration files. A user (determined by the user/passsword value entered and presented to the DataPortal server) can be granted or denied access to any of the tables in the published database. For each table the user has access to, the user may be granted access to all rows of the database or only those rows in the table where the value of a specified column matches the user name value. The configuration files that control detailed user access are governed by the following:
  1. File Name and Location:
    If detailed user access control for a given datasource is required, a file name of exactly the same name (including case) as the datasource should be placed in the user datasource access control directory:  DataSourceAccessControl , which is immediately below the DataPortal application root directory in the server. If there is no such file for a given datasource, access to that datasource is not restricted.
  2. File Contents:
    Each user access control file should consist of one block of lines for each table that a user should be granted access to, where each line should have the form: Field Name_k = Field Value, where Field Names are "Table", "Available" and "UserColumn" and "k" is the table number, starting at 1.

    Each table block has the following structure, where table "1" is shown:
Field Name = Field Value
Table_1 = Table Name
Available_1 = Whether the table is available to users
  (Values: "TRUE","FALSE")
UserColumn_1 = Column whose value must match the user value
  to return the row
 Addtional Rules:
  • If no access control file exists with the same name as a
    datasource, access
    to that datasource is NOT RESTRICTED

  • If there is no block (in an access control file) associated with a
    table in the database, that table will NOT BE AVAILABLE

  • If a UserColumn line is blank or has no value, NO USER VALUE FILTERING is performed for that table - so all or none of the
    data is returned, depending on the "Available_k" value


By way of example, assume a company keeps a mix of information, including employee and customer order information, in an "OPERATIONS" database. Further, assume that the company wants to use this database to deliver current order status data to its customers. The complete "OPERATIONS" database consists of the tables:

  CUSTOMERS, EMPLOYEES, ORDERS, PRODUCTS, SUPPLIERS, SHIPPERS, TERRITORIES

The company would like each customer to receive each of the rows in the "ORDERS" table that correspond to the customer's name, as stored in the database. Further, the company would like to provide the complete "SHIPPERS" and "PRODUCTS" data to each customer so the customers can follow up directly with shippers, if necessary, and also consider ordering addtional items from their product list. The company does not want to provide any other information from the "OPERATIONS" database - e.g. customers have no need to get access to employee information.

The "OPERATIONS" database is published to a DataPortal server with the name "OPEN_ORDERS" and a set of user names and passwords is assigned for each customer given access to the "OPEN_ORDERS" datasource. Order items exist as rows in the "ORDERS" table and the column "CUSTOMERID" is used to specify the customer for each order item. The user/password pairs are assigned to be consistent with values used in the "CUSTOMERID" column of the "ORDERS" table.

Then a user access control file, named "OPEN_ORDERS" is placed in the  DataSourceAccessControl directory and has the following contents:


OPEN_ORDERS:
Table_1=ORDERS
Available_1=TRUE
UserColumn_1=CUSTOMERID

Table_2=SHIPPERS
Available_2=TRUE
UserColumn_2=

Table_5=PRODUCTS
Available_5=TRUE


When a customer that has been assigned a valid user name and password (for example: VINET / vinetPass) accesses the "OPEN_ORDERS" datasource with their user name and password and transfers the datasource to their database of choice, the result is that they receive the order items that match their assigned user/customer name in the "CUSTOMERID" column of the "ORDERS" table and the entire "SHIPPERS" and "PRODUCTS" tables, since the UserColumn_k line is blank or missing, respectively, for the "SHIPPERS" and "PRODUCTS" blocks. Since there are no other blocks for other tables (e.g. EMPLOYEES), no other tables are included in the transfer. The "ORDERS" table, at the source, might look like:

   Source "ORDERS" Table:
ORDERID CUSTOMERID EMPLOYEEID ORDERDATE REQUIREDDATE SHIPPEDDATE SHIPVIA FREIGHT SHIPNAME SHIPADDRESS SHIPCITY SHIPREGION SHIPPOSTALCODE SHIPCOUNTRY
10248 VINET 5 04.07.1996 00:00:00.000 01.08.1996 00:00:00.000 16.07.1996 00:00:00.000 3 32.3800 Vins et alcools Chevalier 59 rue de l'Abbaye Reims null 51100 France
10249 TOMSP 6 05.07.1996 00:00:00.000 16.08.1996 00:00:00.000 10.07.1996 00:00:00.000 1 11.6100 Toms Spezialit?ten Luisenstr. 48 M?nster null 44087 Germany
10250 HANAR 4 08.07.1996 00:00:00.000 05.08.1996 00:00:00.000 12.07.1996 00:00:00.000 2 65.8300 Hanari Carnes Rua do Pa?o, 67 Rio de Janeiro RJ 05454-876 Brazil
10253 HANAR 3 10.07.1996 00:00:00.000 24.07.1996 00:00:00.000 16.07.1996 00:00:00.000 2 58.1700 Hanari Carnes Rua do Pa?o, 67 Rio de Janeiro RJ 05454-876 Brazil
10274 VINET 6 06.08.1996 00:00:00.000 03.09.1996 00:00:00.000 16.08.1996 00:00:00.000 1 6.0100 Vins et alcools Chevalier 59 rue de l'Abbaye Reims null 51100 France
10295 VINET 2 02.09.1996 00:00:00.000 30.09.1996 00:00:00.000 10.09.1996 00:00:00.000 2 1.1500 Vins et alcools Chevalier 59 rue de l'Abbaye Reims null 51100 France
10438 TOMSP 3 06.02.1997 00:00:00.000 06.03.1997 00:00:00.000 14.02.1997 00:00:00.000 2 8.2400 Toms Spezialit?ten Luisenstr. 48 M?nster null 44087 Germany
10446 TOMSP 6 14.02.1997 00:00:00.000 14.03.1997 00:00:00.000 19.02.1997 00:00:00.000 1 14.6800 Toms Spezialit?ten Luisenstr. 48 M?nster null 44087 Germany
10541 HANAR 2 19.05.1997 00:00:00.000 16.06.1997 00:00:00.000 29.05.1997 00:00:00.000 1 68.6500 Hanari Carnes Rua do Pa?o, 67 Rio de Janeiro RJ 05454-876 Brazil
10548 TOMSP 3 26.05.1997 00:00:00.000 23.06.1997 00:00:00.000 02.06.1997 00:00:00.000 2 1.4300 Toms Spezialit?ten Luisenstr. 48 M?nster null 44087 Germany
10903 HANAR 3 24.02.1998 00:00:00.000 24.03.1998 00:00:00.000 04.03.1998 00:00:00.000 3 36.7100 Hanari Carnes Rua do Pa?o, 67 Rio de Janeiro RJ 05454-876 Brazil
10922 HANAR 5 03.03.1998 00:00:00.000 31.03.1998 00:00:00.000 05.03.1998 00:00:00.000 3 62.7400 Hanari Carnes Rua do Pa?o, 67 Rio de Janeiro RJ 05454-876 Brazil


The table actually received by the user/customer "VINET" is:

  "ORDERS" Table Received by User/CUSTOMER "VINET":
ORDERID CUSTOMERID EMPLOYEEID ORDERDATE REQUIREDDATE SHIPPEDDATE SHIPVIA FREIGHT SHIPNAME SHIPADDRESS SHIPCITY SHIPREGION SHIPPOSTALCODE SHIPCOUNTRY
10248 VINET 5 04.07.1996 00:00:00.000 01.08.1996 00:00:00.000 16.07.1996 00:00:00.000 3 32.3800 Vins et alcools Chevalier 59 rue de l'Abbaye Reims null 51100 France
10274 VINET 6 06.08.1996 00:00:00.000 03.09.1996 00:00:00.000 16.08.1996 00:00:00.000 1 6.0100 Vins et alcools Chevalier 59 rue de l'Abbaye Reims null 51100 France
10295 VINET 2 02.09.1996 00:00:00.000 30.09.1996 00:00:00.000 10.09.1996 00:00:00.000 2 1.1500 Vins et alcools Chevalier 59 rue de l'Abbaye Reims null 51100 France

The user/customer "VINET" has received the rows from the source "ORDERS" table where the value in the "CUSTOMERID" field matched "VINET". So, the "VINET" customer has received all the order data, and ONLY the order data they should receive.

NOTE: When a new user access control file is placed in the DataSourceAccessControl directory
of the DataPortal server, it may be necessary to restart the server for the file to be regisered

  


Connection Concepts
Phone: (301) 625-9319
EMail: dataPortal@con2inc.com