POST
|
Thanks, anyway Robert! I don't know what can be happening, but with enterprise users works as expected, but it doesn't with AGOL ones. Probably is not something regarding to the request, maybe is related with the function queryItems that is not creating the object fine.
... View more
10-29-2015
08:02 AM
|
0
|
0
|
264
|
POST
|
Hi Robert, Yes, I am initialising it as follows: this.portal = portalUtils.getPortal(this.appConfig.portalUrl); the portal URL is: http://eea.maps.arcgis.com/ And the this.portal object has been created properly.
... View more
10-29-2015
07:11 AM
|
0
|
2
|
1226
|
POST
|
Sorry Robert, this is the complete function /*------------------------------------*/
// Query arcgis items
/*------------------------------------*/
queryArcGISGroupItems: function (obj) {
// default values
var settings = {
// set group id for web maps
id_group: '',
// type of item
searchType: this.config.searchType,
// filter these items
filterType: '',
// access type
searchAccess: '',
// format
dataType: 'json',
// sorting column: The allowed field names are title, modified, type, owner, avgRating, numRatings, numComments and numViews.
sortField: this.config.sortField,
// sorting order: Values: asc | desc
sortOrder: this.config.sortOrder,
// if pagination
pagination: true,
// how many links to show on each side of pagination
paginationSize: 1,
// show first and last links on pagination
paginationShowFirstLast: true,
// show previous and next links
paginationShowPrevNext: true,
// search limit
perPage: '',
// maps per row
perRow: '',
// offset
searchStart: 0,
// search keywords
keywords: '',
// style of layout for the results
layout: 'grid',
// callback function with object
callback: null
};
// If options exist, lets merge them with our default settings
if (obj) {
dojo.mixin(settings, obj);
}
var q = '';
q += 'group:"' + settings.id_group + '"';
if (settings.keywords) {
q += ' AND (';
q += ' title:"' + settings.keywords + '"';
q += ' OR tags:"' + settings.keywords + '"';
q += ' OR typeKeywords:"' + settings.keywords + '"';
q += ' OR snippet:"' + settings.keywords + '"';
q += ' ) ';
}
if (settings.searchType) {
q += ' AND typekeywords:"' + settings.searchType + '"';
}
if (settings.searchType && settings.filterType) {
q += ' -type:"' + settings.filterType + '"';
}
if (settings.searchAccess) {
q += ' AND access:"' + settings.searchAccess + '"';
}
var params = {
q: q,
v: this.config.arcgisRestVersion,
f: settings.dataType
};
if (settings.sortField) {
params.sortField = settings.sortField;
}
if (settings.sortOrder) {
params.sortOrder = settings.sortOrder;
}
// TODO FOR UPDATE:
// MANAGE PAGINATION OF RESULTS
if (settings.perPage) {
//params.num = settings.perPage;
params.num = 100;
} else {
params.num = 100;
}
if (settings.searchStart > 1) {
params.start = (((settings.searchStart - 1) * settings.perPage) + 1);
}
this.portal.queryItems(params).then(function (data) {
if (typeof settings.callback === 'function') {
// call callback function with settings and data
settings.callback.call(this, settings, data);
}
});
}
... View more
10-29-2015
01:04 AM
|
0
|
4
|
1226
|
POST
|
Hi Robert, No it is not a Portal instance, it is an AGOL site: http://eea.maps.arcgis.com/ The code is the one above, we are only querying the site. this ---> is the widget object portal --> params -->
... View more
10-28-2015
07:53 AM
|
0
|
8
|
1226
|
POST
|
I am working on a custom widget. One of the things I need to do is to query a group item from AGOL. To do this I use the query items methods as below with the required parameters. When I work authenticated with an enterprise login, it all worked as it was expected. But when I authenticated with an AGOL user I receive an error: Uncaught RangeError: Maximum call stack size exceeded. It was that when the request that is shown above was done, ArcGIS javascript API was generating an object with a circular reference and the widget crashes. The request is a search (sharing/rest/search) request and the parameters are the following: f=json&q=group%3A"6264b2c574414393886a3bcb43dd8fba"&sortField=modified&sortOrder=DESC&num=100&token=<token> If we look at the network tab of the developers tools, the response to this request is correct. So, that this response suffers some changes before arriving to the callback function. Once inside the callback function the data parameter has been modified. Inside each result has a portal object, that contains a user object inside, that references the previous portal oblect again and so on. This only happens when you are logged in with an AGOL user. It might also be worth mentioning that in our case all AGOL items are inside an enterprise site. Has this happen to any of you? Have you any solution besides deleting the circular reference objects? Thanks in advance
... View more
10-28-2015
12:57 AM
|
0
|
10
|
3869
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|