Show TOC

Querying Content with the AnalyzerLocate this document in the navigation structure

Use

You can use the OBN Analyzer to select portal content and check what iViews are valid implementations for the current user, and then find out the business objects and operations that these iViews implement.

You can specify portal content by supplying a set of folders or roles.

For example, you can specify a role and find out all the valid OBN links to content in that role for the current user.

To perform a query, you specify the following:

  • Scope: Specifies the roles or folders in which to search for valid OBN implementations.

  • Filter: Specifies a query filter. For example, you can specify that you only want the query to return context business objects, or only system business objects based on a specific system alias, or only operations with a specific name.

  • User: Only implementations to which the specified user has access are used to create the list of valid business objects and operations.

Procedure

The code below gets business objects with valid implementations for the current user.

Only the content in roles for the current user are checked, and only iViews that are implementations for one of the following:

  • An operation called operation_1 or operation_2

  • An operation for a system business object based on system alias systemAlias_1 or systemAlias_2

  • An operation for a context business object whose namespace is namespace_1

            // Get OBN service (valid for both technologies)
IOBNService.obnService = getOBNService();
// Get Analyzer handler for creating needed objects
IOBNAnalyzingHandler obnAnalyzingHandler = obnSrv.getOBNAnalyzingHandler();
   
try {
    // Set query filters
    IOBNAnalyzingBOFilter boFilter = obnAnalyzingHandler
        .createOBNAnalyzingBOFilter();
    boFilter.anyTypeBO().operations().add("operation_1");
    boFilter.anyTypeBO().operations().add("operation_2");
         
    boFilter.systemBO().system().add("systemAlias_1");
    boFilter.systemBO().system().add("systemAlias_2");
    
    boFilter.contextBO().namespace().add("namespace_1");
         
    // Set query scope
    IOBNAnalyzingScope scope = obnAnalyzingHandler
        .createOBNAnalysingScope();
    scope.addDirContextsOfUserRoles(user);
         
    // Perform query
    IOBNAnalyzingContainer cont = obnAnalyzingHandler
        .getAnalyzingContainer(scope, boFilter, user);
      
    // Gets the results
    List<IOBNResolvingContainer> resolvingContainers = 
        cont.getOBNResolvingContainers();
}
catch(OBNException e) {
   // Handle exceptions
}

         

The result is a list of IOBNResolvingContainer objects, each of which represents a business object with at least one valid implementation for the current user.