April 1, 2010 by
Beginning with IBM Cognos 8.4 and higher, IBM provides a means of
linking package objects from within Cognos Viewer or any of the studios,
to IBM Business Glossary to serve as a central, web-based repository
for documentation. If you do not own Business Glossary but you do have
an existing enterprise wiki that houses your own organizations business
documentation, with a little bit of ingenuity we can integrate that
resource using the same inline facilities.
Now let’s enable the business glossary by configuring the business glossary URI following the steps outlined in the IBM Cognos 8.4 Security and Administration Guide
Steps
If we click on it we should expectedly get an error, but by right clicking and viewing the properties of this error window, we can learn quite a bit about how the Business Glossary link works.
The value of the Address (URL) property of the window tells us exactly what the URL was that Cognos attempted to retrieve when we clicked on our Glossary link from within Query Studio.
http://www.google.com/search?q=searchTerms
This means we will have to dynamically rewrite our original search query to match this format.
Before:
http://myserver:9080/bg/popup/popupSearch.do?searchBy=Terms&searchText=Inventory
After:
http://www.google.com/search?q=Inventory
In our example we will achieve this with some simple JSP because it can be easily run within the Tomcat container that is included with IBM Cognos 8 by default, but the same result can be achieved with virtually any server side application language of your choosing (PHP, ASP, Perl/CGI, Apache w/mod_rewrite etc.)
Business Glossary URI: http://myPHPServer/glossary.php
RewriteEngine on
RewriteCond %{QUERY_STRING} ^searchBy=Terms&searchText=(.*)$
RewriteRule ^$ http://www.google.com/search?q=%1 [L]
Business Glossary URI: http://myApacheWebServer/
Background
Before we can tackle our own Wiki, we need to have a better understanding of how IBM Business Glossary was designed to integrate with IBM Cognos 8. To begin, open any package in query studio, and right click on any object from within the metadata and a context menu will appear. Within that context menu you should see that the Glossary link which should be disabled.Now let’s enable the business glossary by configuring the business glossary URI following the steps outlined in the IBM Cognos 8.4 Security and Administration Guide
Steps
- In IBM Cognos Connection, click Launch, IBM Cognos Administration.
- On the Status tab, click System.
- Click the arrow next to System to display the Actions menu, and then click Set Properties.
- Click the Settings tab.
- For the Environment category, IBM Business Glossary URI, type the following URI:
For example, type
http://myserver:9080/bg/popup/popupSearch.do
All terms that contain the keyword specified in the search are returned.
- Click OK.
If we click on it we should expectedly get an error, but by right clicking and viewing the properties of this error window, we can learn quite a bit about how the Business Glossary link works.
The value of the Address (URL) property of the window tells us exactly what the URL was that Cognos attempted to retrieve when we clicked on our Glossary link from within Query Studio.
http://myserver:9080/bg/popup/popupSearch.do?searchBy=Terms&searchText=Inventory
From this we can assume that IBM Cognos 8 will simply append the
query string (bold) to whatever Business Glossary URI we configure in
our System Properties. It is also important to note that IBM Cognos uses
the name of whichever item you have right clicked within Query Studio
to assign the value of the searchText parameter within
the http query string. If we want to search our own Wiki or web based
resource, all we need to do is translate this search query into
something that can be understood by that resource.Solution
In our example we will be using Google as our enterprise business glossary. When integrating your own wiki, you must first determine the correct URL and Query String for searching that resource. Google accepts search queries by URL in the following format:http://www.google.com/search?q=searchTerms
This means we will have to dynamically rewrite our original search query to match this format.
Before:
http://myserver:9080/bg/popup/popupSearch.do?searchBy=Terms&searchText=Inventory
After:
http://www.google.com/search?q=Inventory
In our example we will achieve this with some simple JSP because it can be easily run within the Tomcat container that is included with IBM Cognos 8 by default, but the same result can be achieved with virtually any server side application language of your choosing (PHP, ASP, Perl/CGI, Apache w/mod_rewrite etc.)
- Create a new text file called glossary.jsp that contains the following JSP code:
1
2
3
4
5
6
| <% String searchType = request.getParameter( "searchBy" ); String searchText = request.getParameter( "searchText" ); response.sendRedirect(redirectURL); %> |
- Move this file to your IBM Cognos server and place it in the
<IBM Cognos 8 Install Root>\ webapps\p2pd folder. -
Following the steps previously outlined, reconfigure your IBM Business Glossary URI to be the following:http://myCognosServer:myCognosPort/p2pd/glossary.jsp
For example:
http://localhost:9300/p2pd/glossary.jsp
- After allowing a minute for the server to pick up the change, return to Query Studio and once again attempt to click on the Glossary context menu item. You should now be presented with Google search results for the name of the item you have selected.
Additional Examples
Using PHP
File: glossary.php
1
2
3
4
5
6
7
8
| <?php $BG_SEARCH_TYPE = $_GET [ 'searchBy' ]; $BG_SEARCH_TEXT = $_GET [ 'searchText' ]; //Redirect to the wiki header( 'Location: ' . $REDIRECT_URL ); die (); ?> |
Using Apache with mod_rewrite
File: .htaccess (placed in apache www root for this example)RewriteEngine on
RewriteCond %{QUERY_STRING} ^searchBy=Terms&searchText=(.*)$
RewriteRule ^$ http://www.google.com/search?q=%1 [L]
Business Glossary URI: http://myApacheWebServer/
No comments:
Post a Comment