12
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com © 2011 SAP AG 1 Viewing Documents with Java Web Services in SharePoint 2010 Applies to: BusinessObjects Enterprise XI 3.1. For more information, visit the Business Objects homepage . Summary This article describes how to create a viewer that enables viewing of SBOP Documents using SharePoint 2010. Author: Shivanand A T Company: SAP Created on: 11 th January 2011 Author Bio Shivanand A T is an associate architect Quality for SAP BusinessObjects and Microsoft SharePoint Integration products. In previous roles, has worked on development activities on UNIX products in HP India.

Viewing Documents with Java Web Services in SharePoint 2010

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 1

Viewing Documents with Java

Web Services in SharePoint 2010

Applies to:

BusinessObjects Enterprise XI 3.1. For more information, visit the Business Objects homepage.

Summary

This article describes how to create a viewer that enables viewing of SBOP Documents using SharePoint 2010.

Author: Shivanand A T

Company: SAP

Created on: 11th January 2011

Author Bio

Shivanand A T is an associate architect – Quality for SAP BusinessObjects and Microsoft SharePoint Integration products. In previous roles, has worked on development activities on UNIX products in HP India.

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 2

Table of Contents

Introduction ......................................................................................................................................................... 3

Solution ............................................................................................................................................................... 3

Steps Involved in Viewing the BOE Document through Sample .NET Portal in a SharePoint 2010 ................. 3

Include Binaries in their .NET Project ................................................................................................................. 3

Create the Session Service Object ..................................................................................................................... 4

Create the BIPlatform service object .................................................................................................................. 4

What is BIPlatform Service? ........................................................................................................................... 4

How to get the BIPlatform service object ........................................................................................................ 4

Query for InfoObjects using BIPlatofrm service .................................................................................................. 5

What is ResponseHolder Object ..................................................................................................................... 5

How to get the Info Object .............................................................................................................................. 5

Access each InfoObject returned in query .......................................................................................................... 6

What are different query string formats?......................................................................................................... 6 Path query.................................................................................................................................................................... 6

CUID query .................................................................................................................................................................. 6

Search query ................................................................................................................................................................ 6

SQL query .................................................................................................................................................................... 6

Use OpenDocURL Functionality to View the Document .................................................................................... 7

What is there in the sample application? ............................................................................................................ 8

Example .NET project is having following functionalities: ............................................................................... 8

What are all config files used in the project? .................................................................................................. 8

Sample login page screen .............................................................................................................................. 9

URE page screen ............................................................................................................................................ 9

Document View page .................................................................................................................................... 10

Related Content ................................................................................................................................................ 11

Copyright........................................................................................................................................................... 12

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 3

Introduction

In the SAP BusinessObjects XI3.1 release, the 64-bit version of SharePoint is not supported.

The SharePoint integration kit, primarily Integration Option for Microsoft SharePoint Software and legacy integration kits are all 32-bit versions and support the 32-bit version of SharePoint 2007. It does not support SharePoint 2010.

This limitation also prevents using the 64-bit operating system support as Microsoft does not recommend a 32-bit SharePoint 2007 on their 64-bit operating systems version.

The future SAP BusinessObjects plans to support 64-bit SharePoint 2007 and SharePoint 2010 but till that time we don’t have a viable solution for XI3.1

Solution

A lot of customers have a huge report viewer profile base. At an initial level they would like to see a content explorer which allows them to select a document and view it.

To cater to this persona there is a proof of concept developed that gives a web part for SharePoint 2010. It uses BusinessObjects Enterprise (BOE) Java web services on behalf of 32-bit COM DLL and works with SharePoint 2010.

As mentioned the scope is limited to view document functionality only.

BOE XI3.1 provides the web services support. Installation of BOE XI3.1 product installs and hosts the web services on the computer. Considering the nature of web services, the XI3.1 web services API can be used to view the BOE document in the 64-bit project.

BusinessObjects XI3.1 provides the binary which is a .NET wrapper of web services.

The end user can refer these binaries in their 64-bit application to access the functionality of BOE document.

In a nutshell, the purpose of this document is to do the following:

Enables user to use the BOE XI3.1 public Web Services API to view the documents from SharePoint 2010.

Provides sample .NET application.

Steps Involved in Viewing the BOE Document through Sample .NET Portal in a SharePoint 2010

Include binaries in their .NET project

Create the Session service object

Create the BIPlatofrm service object

Query for InfoObjects using BIPlatofrm service

Access each InfoObject returned in query

Use OpenDocURL functionality to view the document

Each of the above steps is explained in detail below.

Include Binaries in their .NET Project

Include the following binaries in the .NET project.

BusinessObjects.DSWS

BusinessObjects.DSWS.BIPlatform

BusinessObjects.DSWS.Session

These binaries come with BOE XI3.1 build: Assume the user has installed BOE XI3.1 build in the folder “C:\Program Files”. Then these binaries can be found at the folder:

“C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\web services\en\dsws_consumer\data\dswsDotNet2Api”

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 4

Create the Session Service Object

Assume BOE XI3.1 product is installed at the machine IP: 192.10.20.30 and it is running on port 8080 then the Session web service URL will be

http:// 192.10.20.30:8080/dswsbobje/services/Session

Here is the sample code for getting the BOE session object:

protected string m_strURL;

protected Session m_wiSession;

m_strURL = “http:// 192.10.20.30:8080/dswsbobje/services/Session"

BusinessObjects.DSWS.Connection oConnection = new BusinessObjects.DSWS.Connection

(m_strURL);

m_wiSession = new Session (oConnection);

// Creation of an authentication credential

BusinessObjects.DSWS.Session.EnterpriseCredential oEC = new

EnterpriseCredential ();

oEC.Login = “strLogin”;

oEC.Password = “strPassword”;

SessionInfo oSI = m_wiSession.Login(oEC);// User session is done

Create the BIPlatform service object

What is BIPlatform Service?

Like Session, BIPlatform is another web service provided by Business Objects. This service provides the query functionality.

The BIPlatform service lets you administer and manage the BusinessObjects Enterprise platform.

BIPlatform provides the following functions:

Search and access InfoObjects with the powerful URI-based path query language

Manage users, groups, servers, and all other InfoObjects

Monitor server metrics

Manage security

Schedule InfoObjects

Migrate InfoObjects

Upload reports and documents to the CMS

Built-in paging support for returned InfoObjects

Retrieve the following InfoObjects without the use of queries: o Categories o Inboxes o Folders o Profiles

How to get the BIPlatform service object

Here is the code snippet for getting the BIPlatform service:

Protected string m_strURL;

Protected Session m_wiSession;

m_strURL = “http:// 192.10.20.30:8080/dswsbobje/services/Session"

BusinessObjects.DSWS.Connection oConnection = new BusinessObjects.DSWS.Connection

(m_strURL);

m_wiSession = new Session (oConnection);

// Creation of an authentication credential

BusinessObjects.DSWS.Session.EnterpriseCredential oEC = new

EnterpriseCredential ();

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 5

oEC.Login = “strLogin”;

oEC.Password = “strPassword”;

SessionInfo oSI = m_wiSession.Login(oEC);// User session is done

//Get the BIPlatform service

string[] strURL = m_wiSession.GetAssociatedServicesURL("BIPlatform");

BusinessObjects.DSWS.BIPlatform.BIPlatform PlatformService= (BIPlatform)

m_wiSession.GetConsumer(“BIPlatform”,strURL[0]);

Query for InfoObjects using BIPlatofrm service

What is ResponseHolder Object

ResponseHolder is an object which contains the set of InfoObjects returned from a query.

How to get the Info Object

Steps for getting the InfoObject:

1. Make the session object.

2. Get the BIPlatform object.

3. Call the “Get” function provided by BIPlatform object. The Get function takes query string and

Optional info as input parameter.

Here is the sample code:

protected string m_strURL;

protected Session m_wiSession;

m_strURL = " http:// 192.10.20.30:8080/dswsbobje/services/Session"

BusinessObjects.DSWS.Connection oConnection = new

BusinessObjects.DSWS.Connection(m_strURL);

m_wiSession = new Session(oConnection);

// Creation of an authentication credential

BusinessObjects.DSWS.Session.EnterpriseCredential oEC = new

EnterpriseCredential();

oEC.Login = “strLogin”;

oEC.Password = “strPassword”;

SessionInfo oSI = m_wiSession.Login(oEC);// User session is done

//Get the BIPlatform service

string[] strURL = m_wiSession.GetAssociatedServicesURL("BIPlatform");

BusinessObjects.DSWS.BIPlatform.BIPlatform PlatformService= (BIPlatform)

m_wiSession.GetConsumer(“BIPlatform”,strURL[0]);

ResponseHolder respHolder = null;

GetOptions options = new GetOptions();

options.PageSize = 500;

ptions.PageSizeSpecified = true;

string strQuery = "query://{SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_KIND=‟Folder‟}

"

respHolder = oBIP.Get(strQuery, options);

InfoObjects folders = respHolder.InfoObjects;

if (folders == null) { return; }

String folderCUID = folders.InfoObject[0].CUID;

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 6

Access each InfoObject returned in query

What are different query string formats?

The path query language supports four types of queries:

Path query

Use this type of query to locate InfoObjects using their path. You can search for InfoObjects using wildcard characters.

Example: In this example, you retrieve a report named My Report from the CMS. It is assumed that you know the report

is located in the Feature Samples folder.

For the Crystal Report InfoObject type, the root table is InfoObjects and the base folder is Root Folder. Therefore, the

path query must begin with path://InfoObjects/Root Folder.

The Feature Samples folder is located in the base folder, so your finished path query looks like the following:

string strQuery = “path://InfoObjects/Root Folder/Feature Samples/My Report”;

CUID query

Use this type of query to locate InfoObjects using their CUID. The CUID query language syntax is as follows:

string strQuery = “cuid://<CUID_1, CUID_2,..., CUID_N>”;

Search query

Use this type of query to locate InfoObjects using more specific search conditions than wildcard characters.

Example: The following query returns all InfoObjects that have an exact SI_KEYWORDS or SI_NAME match with either the string "Financial" or "My World".

string strQuery = “search://{Financial 'My World'}?MatchExact=true&CaseSensitive=true”

SQL query

Use this type of query to locate InfoObjects using the traditional SQL query language. The SQL query language

syntax is as follows:

string strQuery = “query://{SELECT [Properties] FROM [Table] WHERE [Conditions] ORDER BY

[Properties]}”

All query types produce the same result: They return one or more InfoObject resources from the CMS. As such, the queries are completely interchangeable.

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 7

Use OpenDocURL Functionality to View the Document

OpenDocument service is provided by XI3.1 build. Installation of XI3.1 InfoView build hosts the OpenDocument service.

Here is the snapshot of inetmgr (IIS) from the machine where XI3.1 InfoView is installed:

OpenDoc can be used for viewing the document. User need to construct the URL string containing certain information related to user session and document and then pass this URL to a browser. Document gets opened into browser.

Here is the sample code:

protected string m_strURL;

protected Session m_wiSession;

m_strURL = " http:// 192.10.20.30:8080/dswsbobje/services/Session"

BusinessObjects.DSWS.Connection oConnection = new

BusinessObjects.DSWS.Connection(m_strURL);

m_wiSession = new Session(oConnection);

// Creation of an authentication credential

BusinessObjects.DSWS.Session.EnterpriseCredential oEC = new EnterpriseCredential();

oEC.Login = “strLogin”;

oEC.Password = “strPassword”;

SessionInfo oSI = m_wiSession.Login(oEC);// User session is done

//Get the BIPlatform service

string[] strURL = m_wiSession.GetAssociatedServicesURL("BIPlatform");

BusinessObjects.DSWS.BIPlatform.BIPlatform PlatformService= (BIPlatform)

m_wiSession.GetConsumer(“BIPlatform”,strURL[0]);

ResponseHolder respHolder = null;

GetOptions options = new GetOptions();

options.PageSize = 500;

ptions.PageSizeSpecified = true;

string strQuery = "query://{SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_KIND= „Webi‟ }"

respHolder = oBIP.Get(strQuery, options);

InfoObjects folders = respHolder.InfoObjects;

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 8

if (folders == null) { return; }

String DocId = folders.InfoObject[0].ID;

String session_token = oSI.DefaultToken;

String Dotnet_opendoc_URL = "http://" + “CMS IP address” +

":81/OpenDocument/opendoc/openDocument.aspx?iDocID=" + DocId + "&token=" + session_token;

//Here 81 is the port number

Response.redirect(Dotnet_opendoc_URL);

What is there in the sample application?

The sample code, SharePoint 2010 Solution for XI 3.1 Using BusinessObjects Web services, is available on SDN.

Example .NET project is having following functionalities:

Sample application was developed in windows 2008 machine and SharePoint 2010.

Project consumes above said web services binaries.

Project output binary type is 64-bit

SharePoint has two web parts: WebPart1 displays Login screen.

Once Login is done then URE (document listing).Left Pane of web part displays the folder and right

pane displays the reports under the folder

On double click of any report , it gets opened in new browser

aspx page are created and hosted on IIS for Login and URE page.

aspx pages are added to Web part in page viewer mode.

What are all config files used in the project?

The Web.config file has the following entry:

OpenDocURL is the URL of OpenDoc hosted on BOE, java/.Net Openddoc URLs are supported.

SharePointURL is the URL where SharePoint is hosted.

CMSHOSTNAME FQDN of cms hostname for SSO logon.

SSOEnabled is true for SSO logon & false for non SSL logon.

HideObjectOnFolderContent is key which contains all the object type which shouldn’t get displayed on URE right pane. When user clicks on any folder on Left pane of URE web part then right pane should displays content of the selected folder. With the setting of value in HideObjectOnFolderContent key means those kind of object will not get displayed in right pane.

10.193.4.162 is the CMS machine IP address and 120 is the port where OpenDoc is hosted. User need to change this.

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 9

The Dsws.config file has the following entry:

URL is the address where Session service is hosted on XI3.1 InfoView machine.

10.193.4.167 is the CMS machine IP address, and 8080 is the port. It is necessary to change this.

It is necessary to create the virtual directory for the aspx pages.

Sample login page screen

CMS server IP address should be mentioned in the Dsws.config file. It is necessary to enter the user Login/password information.

URE page screen

The user can configure the document kind to be displayed in the right pane of URE by setting the value under “HideObjectOnFolderContent” key in the Web.config file.

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 10

Document View page

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 11

Related Content

For more information, visit the Business Objects homepage.

Viewing Documents with Java Web Services in SharePoint 2010

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 12

Copyright

© Copyright 2011 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.