Working with Repository Folders

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example describes working with repository folders. After starting the example the development environment console displays names of local and unloaded repository folders, or a message about their absence is displayed.

Source Code

Executing the example requires to place the following code in the body of the executeExample method of the ViewController class (see the Displaying of Express Report section):

// Get repository object
SPPLMetabase metabase = PPLMetabase::sharedMetabase(m_olapReportDescriptor->repositoryDescriptor());
NSMutableString *localFoldersName = [[NSMutableString string] mutableCopy];
// Get array of loaded folder descriptions
SNArray localFolderDescriptors = metabase->localFolderDescriptors();
for (int i = 0; i < localFolderDescriptors->count(); i++) {
    SPPLMetabaseRepositoryObjectDescriptor descriptor =
    localFolderDescriptors->objectAtIndex<PPLMetabaseRepositoryObjectDescriptor>(i);
    [localFoldersName appendString: descriptor->name()->nsString()];
    [localFoldersName appendString: @"\n"];
}
if (localFolderDescriptors->count() > 0) {
    NSLog(@"Local folders: \n %@", localFoldersName);
    } else {
    NSLog(@"No local folders \n");
}
// Get array of unloaded folder descriptions
SNArray remoteFolderDescriptors = metabase->remoteFolderDescriptors();
NSMutableString *remoteFoldersName = [[NSMutableString string] mutableCopy];
for (int i = 0; i < remoteFolderDescriptors->count(); i++) {
    SPPLMetabaseRepositoryObjectDescriptor descriptor =
    remoteFolderDescriptors->objectAtIndex<PPLMetabaseRepositoryObjectDescriptor>(i);
    [remoteFoldersName appendString: descriptor->name()->nsString()];
    [localFoldersName appendString: @"\n"];
}
if (remoteFolderDescriptors->count() > 0) {
    NSLog(@"Unloaded folders: \n %@", localFoldersName);
    } else {
    NSLog(@"No unloaded folders \n");
}

After executing the example the development environment console displays names of local and unloaded repository folders or a message about their absence is displayed:

Local folders:

 ExpressReports

No unloaded folders

See also:

Example of pplib++ Library Use