UIXv2: IShellItems.GetObjectVersionsAndProperties does not return more than 50 objects

In UIX v1 we had the IShellItems.GetObjectVersionsAndProperties method which would return OVAPs for all objects in the respective view (listing).

In UIX v2 the identically named method IShellItems.GetObjectVersionsAndProperties appears to return max. 50 objects, even for views with hundreds of objects (tested with views containing 200 and 500 objects). It seems those are the objects visible on the first "page" of the listing.

We call from UIXv2 dashboard code is as follows:

shellFrame.ActiveListing.Items.GetObjectVersionsAndProperties().then(allItems => { /* further processing */ });

For Kanbanoo we need a way to get the OVAPs for all objects in a given view (the current listing). Is there a method or parameter to achieve that?

Background: Kanbanoo operates as UIX Dashboard that replaces the Listing view. Customers are expecting to manage hundreds of cards in a board.

Parents Reply Children
  • Ok, so I got it work to retrieve all 200 or 500 objects, depending on the view. I'm calling GetFolderContents then massage the search results and call GetObjectDataOfMultipleObjects to retrieve the OVAPs (i.e. inluding M-Files properties) as follows:

    
    
    // retrieve all obj_ver of the current view
    // then use that result to retrieve all OVAPs
    vault.SearchOperations.GetFolderContents({
        call_importance: 2 /* Enum: CallImportance */,
        path: shellFrame.CurrentFolder /* Array of Folder */,
        limit: 0    // no limit
    }).then(searchResults => {

        if (searchResults.objects) {
            // build request to retrieve OVAPs
            var request = {
                obj_vers: [] /* Array of requested ObjVer */,
                data_request: {
                    required_data_flags: {
                        all: false,
                        object_version: true,
                        properties: true,
                        acl: false,
                        current_user_permissions: false,
                        properties_for_display: false,
                        relationships: false,
                        collection_member_relationships: false,
                        object_activities: false
                    },
                    error_tolerance: 1 /* Enum: ObjectVersionDataRequestErrorTolerance */,
                    identity_type: 1 /* Enum: ObjectVersionDataRequestIdentityType */,
                    object_activities_parameters: {
                        category_filter: {
                            all: false,
                            metadata: false,
                            file_content: false,
                            comments: true
                        },
                        limit: 0,
                        offset_obj_ver_version: {
                            type: 7 /* Enum: ObjVerVersionType */,
                            internal_version: 0,
                            external_repository_version: "",
                            external_repository_sort_key: 0,
                        },
                    },
                },
            };
            // map SearchResultsItem[] to ObjVer[]
            request.obj_vers = searchResults.objects.map(resItem => ({
                obj_id: resItem.object.object_info.obj_id,
                version: resItem.object.version_info.version
            }));

            // chain the call to retrieve the OVAPs:
            return vault.ObjectOperations.GetObjectDataOfMultipleObjects(request);
        } else {
            // we did not get valid searchResults, view empty, server offline?
            callback([]);
        }
    }).then((ObjectVersionDataResult) => {
        
        if (ObjectVersionDataResult && ObjectVersionDataResult.results) {
            // convert to M-Files COM OVAPs
            var OVAPs = makeObjectVersionAndPropertiesFromMultObjResults(ObjectVersionDataResult.results);
            callback(OVAPs);
        } else
            callback([]);
        
    }).catch((reason) => {
        console.error("failed. reason=", reason);
    });

    Not sure whether my error handling is water-tight here though.