Search code examples
business-objectsbusiness-objects-sdk

How to list BO XIR2 universe objects used in a webi report?


How to list universe objects from a webi report using the Business Objects SDK for XIR2?
Is there is an automated way to do it without the sdk?

With the SDK I've been able iterate through webi report and universe collections but do not see a native way to retrieve either the query objects or the report query.


Solution

  • There is a way to achieve this using BO 4.0 SDK :

    // Get the list of webi documents
    IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("InfoStore");
    String query = "select SI_NAME, SI_ID from CI_INFOOBJECTS "
          + "where SI_KIND = 'Webi' and SI_INSTANCE=0";
    IInfoObjects infoObjects = (IInfoObjects) infoStore.query(query);
    
    for (Object object : infoObjects) {
        IInfoObject infoObject = (IInfoObject) object;
        if (getInfoObjectPathAndTitle(infoObject).startsWith("/")) {
          System.out.println("REPORT: " + infoObject.getTitle());
    
          IDocumentInstance doc = documentInstanceManagementService
              .openDocument(context, infoObject.getID());
    
          List list = ReportDictionaryHelper
              .getDictionaryObjectsFlatList(context, doc);
          if (list.size() > 0) {
            System.out.println("OBJECTS:");
            for (DictionaryExpression expr:list) {
              System.out.println(expr.getName());
            }
          }
    
          List vars = ReportDictionaryHelper.getDocumentVariables(context,doc);
          if (vars.size() > 0) {
            System.out.println("VARIABLES:");
            for (Variable var:vars) {
              System.out.println(var.getName());
            }
          }
    
          documentInstanceManagementService.closeDocument(context, doc);
          System.out.println();
    }
    

    But I am looking for a way to do this using BO XI R2 SDK. It does not contains needed apis.