Db2

 View Only

How to build your own custom webpage using components from the Db2 Data Management Console

By Peter KOHLMANN posted Thu November 14, 2019 12:28 PM

  
One thing I demonstrated at IDUG at Rotterdam and at the recent Tridex RUG was how to integrate pages from the console into your own webpage. I plan on doing more elaborate examples in the future but here is a simple example:

1. Find a page you want to reuse in the console
2. Select the sharing icon on the screenScreen_Shot_2019-11-14_at_11_58_18_AM.png3. Select Html on the Share this page window and select the copy icon to copy the iframe html
Screen_Shot_2019-11-14_at_11_58_32_AM.png4. Add the IFrame to an active html webpage. Here is an example that includes two IFrames that I copied from the console using the share command. In this example I included one IFrame for the SQLEditor and one for the currently running SQL. I also added a width and height for each IFrame to help with the layout. I have included a copy of the index.html file as well. Make sure that you use your own src="xxx" that is generated in your own console. The HTML include in the IFrame tags below will only work for my specific system.

Screen_Shot_2019-11-14_at_12_09_27_PM.png
The results looks like this:

Screen_Shot_2019-11-14_at_12_16_25_PM.png
A couple of things:
1. Access: Anyone using this page has to have a valid userid and has to be able to authenticate to the console itself. The first time you use this page in a browser session you will be asked to log in:

Screen_Shot_2019-11-14_at_12_15_28_PM.png
2. Context: The HTML IFrame that is generated in the console includes JSON that includes information about which database you want to connect to as well as information like which columns are included in the view and sort order so you get what you see on the page. There are ways to construct your own HTML call from scratch and define which databases you want to talk to or what object you want to work with. Some examples are in my Python examples. But more on that in my next Blog posting. Please let me know if you try this yourself and what you would like to see improved or changed.

#Db2
0 comments
52 views

Permalink