EsriEduNL / veldwerk2.0

WebApp to use ArcGIS Online Organization account for student field trips
GNU General Public License v2.0
1 stars 0 forks source link

Deal with user limit from REST API #55

Closed dhunink closed 8 years ago

dhunink commented 9 years ago

The REST API allows to retrieve only 100 portal users at once (http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Users/02r30000009q000000/). This is an issue, since several functions need a complete list of all users. Furthermore, this is blocking the addUsersToGroupFromExcel functionality, since no complete list of all users is available

http://www.programask.com/question_31051860_jquery-deferred-loop might be helpful

mulderniels commented 9 years ago

I think i have solved it for now:) But the code (especial the loop) is not very elegant

for (var i = 0; i < 10; i++) {
    currDef = currDef.then (function(response) {
        ...
        if(response.nextStart < 0) {
            return users;
        }
        else {
            return inLoop(response.nextStart);
        }
    });
}
dhunink commented 9 years ago

Looks like currently only 100 are actually added to the UI, which makes the scripts fail. Could you have a look asap?

mvanhulzen commented 9 years ago

There is no other way than a loop to get more... This is by design (just as with features in a featureservice, or content, or groups...etc..

dhunink commented 9 years ago

I know. The problem whoever is the loop itself: it isn't performing the way it should right now. Making to many calls and (more important) returning the result of the first call, instead of returning the result off all calls

Met vriendelijke groet,

Dennis Hunink

Op 16 jun. 2015 om 08:37 heeft M van Hulzen notifications@github.com het volgende geschreven:

There is no other way than a loop to get more... This is by design (just as with features in a featureservice, or content, or groups...etc..

— Reply to this email directly or view it on GitHub.

dhunink commented 8 years ago

Fixed in commit 965847917199ab088a78e213e2345058702ef5d9