cancel
Showing results for 
Search instead for 
Did you mean: 

List of all objects for a webi report in BO XI 4.1

naveen_kumar29091984
Participant
0 Kudos

Hi Team,

Is there any sample code available which can fetch all objects for webi report and also if user select object name it should fetch all reports associated with that object?



Please let me know.


Regards,

NK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naveen,

I believe there is no readymade sample code present on this through RESTful web services.

Also we can fetch all objects of a webi report through RESTful Web services SDKs, however I don't think there is a way to fetch all reports associated with that/any object-name.

However you can develop your own code by implementing the below RESTful call sequences in your program:

Step 1 - Get the list of Webi documents (This request will list you out the webi document present in your repository)

               URL: http://<server-name>:6405/biprws/raylight/v1/documents

               Method: GET

               Headers: Content-Type: application/xml

                                 X-SAP-LogonToken: "<Your Logon token within double quotes>"

The response of above request will list you the Webi documents along with their SI_ID, SI_CUID, SI_NAME, SI_FOLDERID & its state.

Step 2 - Get the list of data providers of a specific Webi document (This request will list you out the data providers that a webi document is using)

               URL: http://<server-name>:6405/biprws/raylight/v1/documents/{SI_ID-of-a-Webi-document}/dataproviders

               Method: GET

               Headers: Content-Type: application/xml

               X-SAP-LogonToken: "<Your Logon token within double quotes>"

The response of the above request will list out the number of dataproviders i.e. query bound to Webi document. The above request also shows the ID of all dataproviders, name of the dataprovider/query & its last updated time.

Step 3 - Get the list of objects used in dataprovider (This request will list you out all the objects used for that particular query)

               URL: http://<server-name>:6405/biprws/raylight/v1/documents/{SI_ID-of-a-Webi-document}/dataproviders/{data-provider-ID}

               Method: GET

               Headers: Content-Type: application/xml

                                 X-SAP-LogonToken: "<Your Logon token within double quotes>"

The response of above request will provide you data provider id, name, dataSourceId, data source type(i.e. unx, unv, bex, excel, or fhsql), data source prefix(used as prefix for data source object IDs of .unv universes only), last updated time(the date and time of the last update), rowCount(the number of rows) & each semantic object dictionary with their id, name, description, data source object ID, formula language Id, used as key for data filters. The dataType, qualification, and high precision of objects are present as attributes of expression.

Step 2 & Step 3 are iterative as Step 1 will gives you the list of Webi document.

Step 2 should run number of times, depends on the count of the Webi report. Step 3 should run number of times, depends on the count of data provider of a Webi document.

Hope the above information helps you.

Thanks,

Shailendra

naveen_kumar29091984
Participant
0 Kudos

Hi

Many thanks for your reply

I am BO resource,

I am looking for

Requirement

1.If user select any specific report--All Objects should populate (code required)

and

2.If user select any specific object--All reports should populate(code required).

Regards,

NK

Former Member
0 Kudos

Hi Naveen,

I have given a try to code your requirement using RESTful Web services SDKs.

The attached sample code will show you objects used in Webi document & will give you an idea, how to use Web Intelligence RESTful Web Services SDK with Java, so that you can write your own code according to your requirement.

The helper API "Bo4Connection.java", is very simple and contains a constructor and 3 functions: connect(username, password, auth), disconnect(), and query(method, link, format).

The constructor's parameter is the link to web services.

Bo4Connection connection = new Bo4Connection("http://<Your-BO-Server-Name>:6405/biprws");

The call to web services is performed with function query. For instance, to get list of documents we send a GET request to /documents, and we want to get result in json format.

connection.query("GET", "/documents", "application/json");

To get the list of all possible request, please refer to RESTful Web Services SDK Developer Guides.

The attached file is a zip file & contains two java files. Kindly download the attachment & convert its extension to zip & then unzip the zip file to get the source code. Provide the necessary credentials & run the attached code.

Hope this helps.

Thanks,

Shailendra

eric_festinger
Contributor
0 Kudos

hi Shailendra,

If you use your Bo4Connection.java for other purposes than just this SCN thread, you'd better also read conn.getErrorStream() before throwing the exception on line 62

Regards,

eric

Former Member
0 Kudos

Hi Eric,

Thanks for providing the feedback, will be trying to fix the code if i get some time.

I was just trying to built a simple & easy sample code which provides Webi report objects & wanted to give an idea to Naveen, how to start programming with RESTful web services.

Many Thanks,

Shailendra

eric_festinger
Contributor
0 Kudos

hi Shailendra,

You're welcome The idea of reading the error stream in case of HTTP code different from 200 is that we (try to) return useful information in it in case something does not work as expected. Moreover, in case of something we didn't anticipate, the stack trace (in case you activated it through the CMC) will also be returned there.

Best regards,

eric

Answers (0)