IBM FileNet P8, Version 5.2.1            

Querying for Summary Data

The following Java™ and C# examples query for summary data objects that are associated with all document version series. The code prints document and summary data properties from the result set.

Java Example

// Create a SearchSQL instance and specify the SQL statement (using the helper methods).
SearchSQL sqlObject = new SearchSQL();
sqlObject.setSelectList("T1.DocumentTitle, T2.ClbRecommendationCount, "
    + "T2.ClbCommentCount, T2.ClbDownloadCount, T2.ClbSummaryVersionSeries");
sqlObject.setFromClauseInitialValue("Document", "T1", true); // retrieve subclasses
sqlObject.setFromClauseAdditionalJoin(JoinOperator.LEFT_OUTER,"ClbSummaryData","T2",
    "T1.VersionSeries", JoinComparison.EQUAL, "T2.ClbSummaryVersionSeries", false);
sqlObject.setOrderByClause("T2.ClbRecommendationCount DESC");
sqlObject.setDistinct(); // suppress redundant rows
                
// Create a SearchScope instance. (Assumes you have the object store object.)
SearchScope search = new SearchScope(os);
        
// Execute the fetchRows method using the specified parameters.
Boolean continuable = new Boolean(true);
RepositoryRowSet myRows = search.fetchRows(sqlObject, null, null, continuable);
        
// Iterate the collection of rows to access the properties.
Iterator iter = myRows.iterator();
while (iter.hasNext()) 
{
    RepositoryRow row = (RepositoryRow) iter.next();
    // Print properties from the result set.
    System.out.print("\nDocumentTitle: " + row.getProperties().get("DocumentTitle").getStringValue() +
         "\nNo. Recommendations: " + row.getProperties().get("ClbRecommendationCount").getInteger32Value() +
         "\nNo. Comments: " + row.getProperties().get("ClbCommentCount").getInteger32Value() + 
         "\nNo. Downloads: " + row.getProperties().get("ClbDownloadCount").getInteger32Value() + "\n" );
}

C# Example

// Create a SearchSQL instance and specify the SQL statement (using the helper methods).
SearchSQL sqlObject = new SearchSQL();
    sqlObject.SetSelectList("T1.DocumentTitle, T2.ClbRecommendationCount, "
         + "T2.ClbCommentCount, T2.ClbDownloadCount, T2.ClbSummaryVersionSeries");
sqlObject.SetFromClauseInitialValue("Document", "T1", true); // retrieve subclasses
sqlObject.SetFromClauseAdditionalJoin(JoinOperator.LEFT_OUTER,"ClbSummaryData","T2",
          "T1.VersionSeries", JoinComparison.EQUAL, "T2.ClbSummaryVersionSeries", false);
sqlObject.SetOrderByClause("T2.ClbRecommendationCount DESC");
sqlObject.SetDistinct(); // supress redundant rows
 
// Create a SearchScope instance. (Assumes you have the object store object.)
SearchScope search = new SearchScope(os);
            
// Execute the fetchRows method using the specified parameters.
bool continuable = true;
IRepositoryRowSet myRows = search.FetchRows(sqlObject, null, null, continuable);
             
// Iterate the collection of rows to access the properties.
foreach (IRepositoryRow row in myRows)
{
     // Print properties from the result set.
     System.Console.WriteLine("\nDocumentTitle: " + row.Properties.GetProperty("DocumentTitle").GetStringValue() +
         "\nNo. Recommendations: " + row.Properties.GetProperty("ClbRecommendationCount").GetInteger32Value() +
         "\nNo. Comments: " + row.Properties.GetProperty("ClbCommentCount").GetInteger32Value() + 
         "\nNo. Downloads: " + row.Properties.GetProperty("ClbDownloadCount").GetInteger32Value() + "\n" );
}


Last updated: October 2015
socialCollab_summary_snip1.htm

© Copyright IBM Corporation 2015.