on 08-17-2016 5:02 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.