If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to make use of Extended Applications

Started by Kaspatoo, 16 Sep 2010 07:38:12 AM

Previous topic - Next topic

Kaspatoo

Hello,

I am searching for a couple of days to get an answer but wasn't successful.

I have written a web application to get access to a database. My application consists of jsp files, which allows the user to make inputs.
Between my jsp's I make use of servlets to communicate with my database.
The jsp's contains html-forms with a servlet as target.

I already appended an application in application.xml and chose an jsp as target.

One question is how and where to add the war-file.
It needs to use its own web.xml.

Another is how to access on the data of the war-file through the jsp.


It would be grateful if someone were able to help me.
Thanks a lot!

xiska

Hi Kaspatoo


Appending the application to the webapps\samples\cps4\applications.xml only helps to select the application within the frontend.
You are able to overwrite the uri to your jsp file.
However - you have done it right installing the sdk in the same location as all other products. Otherwhise you won't be able to configure your application.

So far so good.

These ressources might help but they depend on your installaton - Tomcat(standard), Webspehre ...:
http://www.ibm.com/developerworks/data/library/cognos/development/utilities/page509.html
http://www-01.ibm.com/support/docview.wss?uid=swg21370536

Please note that you need to restart your app server changing a war file. It is not neccessary when you change a .jsp file.

A different way:
I often use jar files - instead of war files. They must be placed in \webapps\samples\WEB-INF\lib.
In this case the jsp must import the package like <%@ page import ="com.cognos.developer.schemas.bibus._3.*"%> - take a look at webapps\samples\cps4\basicnav.jsp

Hope it helps

xiska

Hello

I have found an old description for a utility in a .war file.

"Place the war file into webapps directory of your server. For default Tomcat
installations of Cognos ReportNet, the directory would be C:\Program
Files\Cognos\crn\webapps. Once placed in this directory, it will automatically
explode its contents.
<installation directory>\webapps\crn\..."

Assuming that your web.xml within the .war file in servlet/servlet-name says "MyWarPage" your application should be http://SERVERNAME:9300/crn/MyWarPage

Greetings

Kaspatoo

#3
Hello,

Many thanks!
The deployment was successful but now i have another problem.
I noticed that I use Expression Languages but it seems that no EL is supported by Cognos.
The *.tld-files of other Cognos Extended Applications use this doctype:


<!DOCTYPE taglib
  PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
  "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">


And JSP 1.2 does afaik not support EL's.
I use JSTL 1.1 with JSP tag lib 2.0, which supports EL's.

But maybe there is a way to get JSP 2.0 (or somehow EL) supported, do anyone know?


In the sample "basicreport.jsp" I still found one statement using an EL (I think it's an EL):

<c:import var='report_table_xsl' url='report_table.xsl'/>
<x:transform xslt='${report_table_xsl}'>
<%=xmlResult%>
</x:transform>


Now I ask myself whether it's a conventional EL or something other.


Update:
A further thing I recognized is that Cognos is not using/accepting my web.xml. Things like servlet-mapping or welcom-file were not performed. I tried to use the web.xml of samples but with no difference.
Any ideas how to fix it or why it's (not) doing so?

Kaspatoo

Now I have found a working solution:

An Extended Application within Cognos should consist of one central JSP. This JSP has to be registered in "applications.xml" as described here:
http://blog.mydwbi.com/?p=91

The typically web.xml of a web project seems not to be supported by cognos. That's why Servlets, Servletmapping an Portletmapping will not succeed.
If you use a form in your registered JSP you have to use action="<cps:CreateURI/>"
CPS is a tag-lib of Cognos (found in samples/web-inf/lib) which requires a tag lib descriptor file (cps.tld; take a look at another predefined extended application in samples).

If you want to use more than on JSP, like me (some JSP's and some java classes), you have to make some if-statements which veryfies the next target and then make <jsp:forward page="<%=target %>" />
JSP is another tag lib (standard.jar I think).

In this JSP you may have a further form which also uses action="<cps:CreateURI/>"
This will go back to your (in my case) "index.jsp".
Please note that if you want to make a forward from index.jsp to index.jsp you cannot make <jsp:forward page="<cps:CreateURI/>" />.
In this case you should write: <jsp:forward page="index.jsp" />

To use java classes I create an instance of a class and call the public method "doAction(HttpRequest request)" (call it your way).
In this class you can make any logical stuff and, like in my case I return a String with my next target.


At first, before knowing how to, I tried a flowing structure, using a web.xml. But it only runs externally (direct link or frame within a cognos page).
But now it's transformed into a kind of star-topology. My registered JSP controls all further workflows.

I hope this explanation will help others.