Now that you know how about using the web services SDK, you can now build BI portals using it. As with the samples provided for deploying the Business Objects Enterprise SDK, you can download a white-box starter portal using the web services SDKs at www.usingcrystal.com. Table 32.4 shows several of the files you will find.
Portions of these pages are described in greater detail in the sections that follow. Setting Up a Consumer SDK ProjectUsing the UWS Consumer SDKs in the Java environment requires the 1.4.2 version of the Java 2 SDK Standard Edition and a Java application server. Client jar and .NET assemblies can be found in the \Web Services\en\dsws_consumer\data directory of the installation directory. For J2EE clients, unzip the client JAR files from dswsJavaApi.zip into the WEB-INF\lib directory of your project. These files include dsws-bicatalog.jar, dsws-common.jar, dsws-reportengine.jar, dsws-session.jar, and wilog.jar. Additionally, the implementation requires these six jars that are part of the Apache Axis distribution: Axis.jar, commons-discovery.jar, Jaxrpc.jar, Saaj.jar, Wsdl4j.jar, and Jtools.jar. If you followed the previous build instructions, these files will be in the C:\Program Files\Business Objects\Assemble\dswsBobjeJava\src\WEB-INF\lib Directory. For rich Java clients, add these JAR files to your application's classpath. Note that these JARs are considerably smaller than those required to deploy the alternative CORBA-based SDK application. Checking AuthenticationAs with the SDK portal shown in Chapter 30, "Using the BusinessObjects Enterprise APIs," every page (except for login.jsp) in the UWS portal includes a special JSP page, check_authentication_uws.jsp, that ensures that the user has logged in properly. This page can process for credentials posted from the login page or create a page-level pointer to an EnterpriseSession in application session scope. In the event that an EnterpriseSession does not exist or has timed-out, it sends a user to the login page. Listing 32.2 contains login code from check_authentication_uws.jsp which shows how to create a new session from a username and password. Listing 32.2. Creating a New UWS Session
Listing 32.3 shows the login form itself, which is found in login.jsp. What is different about this login page versus the CORBA SDK code is that it does not reference a CMS name, but rather the UWS server endpoint URL. In this application, the actual URL is stored in the property file under the key UWS_CONNECTION_URL. Listing 32.3. Simplified Logon Form
Keeping sessions alive longer than necessary may tie-up licenses and server memory. Be sure to provide a logout page that includes logic to close the Business Objects session (see Listing 32.4) and optionally invalidate the appserver session. Listing 32.4. Logging Off
The default page is the UWS portal is directory.jsp. This page renders a permission-aware folder catalog. Reports can be viewed as HTML by clicking on their name and as PDF by clicking on the PDF icon. It renders a pseudo-breadcrumb at the top of the page. Portions of directory.jsp are shown in Listing 32.5. Listing 32.5. Listing Folders and Reports
Finally, the UWS viewer page (viewer.jsp) is used to output a report as HTML or PDF and a second file (getImage.jsp) is used to render image call-backs. Drilling in CrystalReports and simple text prompts are supported. These listings are quite long and can be downloaded from usingcrystal.com. |