Category Archives: Xcelsius

BusinessObjects Xcelsius

How to retrieve SQL query of QaaWS using BO Java RE SDK

QaaWS is stored as Webi document on the server

To check that QaaWS is represented as Webi document, you can open Query Builder and run the following SQL:

SELECT * FROM CI_APPOBJECTS WHERE SI_KIND='QaaWS'

The property SI_FILES describes the location of the files corresponding to QaaWS and it is actually the WID file:

The following code prints queries for all QaaWS found in CMS:

IInfoObjects objs = infoStore.query("SELECT * FROM CI_APPOBJECTS WHERE SI_KIND='QaaWS'");
System.out.println("Number of QaaWS found: " + objs.size());
for (Object obj : objs) {
   IInfoObject infoObj = (IInfoObject)obj;
   System.out.println("------ " + infoObj.getTitle() + " ------");
   DocumentInstance widoc = wiRepEngine.openDocument(infoObj.getID());
   printQuery(widoc);
   widoc.closeDocument();
}

The function printing SQL of Webi document

public static void printQuery(DocumentInstance widoc) {
   DataProviders dps = widoc.getDataProviders();
   for (int i = 0; i < dps.getCount(); ++i) {
      DataProvider dp = (DataProvider)dps.getItem(i);
      if (dp instanceof SQLDataProvider) {
         SQLDataProvider sdp = (SQLDataProvider)dp;
         ArrayList<TreeNode> nodes = getListOfTreeNodes(sdp.getSQLContainer(), true);
         for (TreeNode node : nodes) {
            if (node instanceof SQLSelectStatement) {
               SQLSelectStatement query = (SQLSelectStatement)node;
               System.out.println(query.getSQL());
            }
         }
      }
   }
}

Auxiliary functions

The following function finds the list of all nodes in the tree. It might be more convenient then writing recursion:

public static ArrayList<TreeNode> getListOfTreeNodes(TreeNode root, boolean onlyLeaves) {
   ArrayList<TreeNode> nodes = new ArrayList<TreeNode>();
   treeNodeTraversal(root, nodes, onlyLeaves);
   return nodes;
}

private static void treeNodeTraversal(TreeNode node,
   ArrayList<TreeNode> nodes,
   boolean onlyLeaves)
{
   if (!onlyLeaves || node.isLeaf()) {
      nodes.add(node);
   }
   for (int i = 0; i < node.getChildCount(); ++i) {
      treeNodeTraversal(node.getChildAt(i), nodes, onlyLeaves);
   }
}

Source Code

localhost in QaaWS for Xcelsius dashboards

To allow easy migration of QaaWS from one server to another it is recommended to use localhost instead of server name in QaaWS and in Xcelsius dashboard connection to QaaWS.

This however complicates the job of Xcelsius dashboard developer, because reference to localhost will not work for QaaWS connection if he works from his PC and not on the server.

You should either install Xcelsius on the server and develop dashboards there (probably via remote desktop). Or the dashboards should be developed with hardcoded server name and when the development finished, the connections should be rebuild with localhost as server name. This could be very tedious task.

As a workaround, you can add localhost with IP of the server to C:\Windows\System32\drivers\etc\hosts, e.g.

172.20.30.3 	localhost