|
POST
|
Could you post or attach the rest of the code. What is shown is not enough to determine the problem.
... View more
02-19-2020
06:22 AM
|
0
|
2
|
1503
|
|
POST
|
Robert Scheitlin, GISP Something weird I have seen. On our HA portal configuration the images from the default jimu.js location are not found (error 404). On our single server dev env. things work as expected. Seems something with the relative path and a NLB url is out of whack. Cheers -Joe
... View more
02-06-2020
11:22 AM
|
0
|
1
|
4084
|
|
POST
|
Hi, I came across this myself and what I found is that it seems the problem occurs when two different widgets use the same path to a feature action. So if I have two widgets and both have a feature action name located in a folder with the same name. So we have: widget1/featureActions/myAction widget2/featureActions/myAction The failure occurs with the second widget. If I do a rename so have.. widget1/featureActions/myAction widget2/actions/myAction everything works fine.
... View more
02-06-2020
09:00 AM
|
1
|
0
|
806
|
|
POST
|
Back in 100.3 in changed to the static method (I could not recall the version this changed). In 100.6 it has changed back to an instance method. GeodatabaseSyncTask constructors are internal. The CreateAsync method requires a Uri, which does not accept an empty string and from quick testing will fail with fake Url or if offline. This fails.... var st = await GeodatabaseSyncTask.CreateAsync(new Uri("http://nothing"));
... View more
02-03-2020
12:44 PM
|
0
|
2
|
1548
|
|
POST
|
So in 100.7 the static GeodatabaseSyncTask.ImportGeodatabaseDeltaAsync method is obsolete. The replacement method is now a class method so requires a GeodatabaseSyncTask object, which in turn requires a Uri of a service to Create. This makes no sense, having made this a static method was the correct move a few iterations ago. Why should one need to Create a GeodatabaseSyncTask object? This method should be available offline, there is no reason to need a connection to the underlying service to merge deltas from an already downloaded delta database into an already offline database. What is the driver behind this? Why would you change something back to the previous less robust approach? Guess I am rolling back to 100.6 Morten Nielsen Michael Branscomb Edit: Would appear this change occurred at 100.6, so rolling back to 100.5.
... View more
02-03-2020
11:37 AM
|
0
|
4
|
1611
|
|
POST
|
Hopefully this helps someone in the future. We had to make the changes by hand 6+ months ago
... View more
01-18-2020
05:34 AM
|
0
|
0
|
1691
|
|
POST
|
Robert Scheitlin, GISP, Rebecca Strauch, GISP Any idea on why they have still not updated the default API for WAB 2D widgets. 4x has been out for a while and one would think esri would have made the effort (started laughing as I typed that) to bring things into the current API
... View more
01-16-2020
12:02 PM
|
0
|
1
|
3430
|
|
POST
|
So what I found is that a call to Portal.signIn method Portal (legacy) | API Reference | ArcGIS API for JavaScript 3.31 is required (don't ask me why). Because it is IWA there is no request for credentials made. So my previous method becomes: getUserName: function(item) {
var deferred = new Deferred();
var portal = portalUtils.getPortal(item.portalUrl);
if (portal == null ) deferred.resolve('Cannot Get Portal');
portal.signIn().then(function(portalUser){
console.log(portalUser.userId);
deferred.resolve(portalUser.userId);
}, function(err){
console.log(err);
deferred.resolve('No User');
});
return deferred.promise
}, This does make things more complex because signIn returns a deferred so my calling method needs to use the Deferred: this.getUserName(item).then(lang.hitch(this, function(username){
//code that needed user name
}));
... View more
01-15-2020
09:10 AM
|
0
|
0
|
1507
|
|
POST
|
I am trying to retrieve the currently logged in user for a widget when the portal uses IWA. I have seen the following posts How can I retrieve the portal user name in a custom WAB widget? a programmatic way to get Portal groups and Portal members info within WAB So I have the following getUserName: function(item) {
var portal = portalUtils.getPortal(item.portalUrl);
if (portal == null ) return "Cannot Get Portal";
if ( portal.user == null ) return "No User";
let username = user.username;
return username;
}, This approach seems like it works. The behavior I see is that the user that created the Web Application everything works as expected, the IWA logged in user is returned. However, if anyone else uses the widget the value returned is the "No User" string. We have tested with different people. If I create the Web Application and run things it works. But another system uses the widget and the portal.user is returning null. If another user creates the Web Application it works for them, but if I run it (or anyone else) we are getting null for portal.user. Anyone know what be might going on? Is something specific needed because of the IWA configuration? Thanks -Joe
... View more
01-13-2020
01:49 PM
|
0
|
1
|
1627
|
|
POST
|
There is no reason to call the downloadGeodatabaseForLayers. Basically you are taking the map offline which will create a package that includes the tiles from the basemap and the data from the service (inside the defined boundary). Inside the setup of taking the the takeMapOffline you define the parameter: parameters.returnSchemaOnlyForEditableLayers = true So you are not returning data from the feature service. Not 100% sure on your error, unless possibly testOfflineServiceUrl may not be correct as Cory Davis mentioned
... View more
01-08-2020
06:45 AM
|
1
|
2
|
3931
|
|
POST
|
Don't really have a way to package up a working sample but basically have a View that has the Text boxes and a button to launch command. When that executes you create a Credential using the passed in username and password. Below is a ViewModel bound to the view (this is in Xamarin not WPF - and also uses Prism Framework). LoginCommand is bound to the button. Basically checks to make sure the user entered the username and password and then tries to connect using the IPortalManager service - Code below). public class LoginPopupPageViewModel : ViewModelBase
{
private readonly IPageDialogService _pageDialogService;
private readonly IPortalManager _portalManager;
#region Private Backing Fields
private string _userName;
private string _password;
private bool _useDevAgol;
private string _navigateToPage;
private string _message;
#endregion
public LoginPopupPageViewModel(IPageDialogService pageDialogService, IPortalManager portalManager, IEventAggregator eventAggregator) : base(eventAggregator)
{
_pageDialogService = pageDialogService;
_portalManager = portalManager;
Title = "Peoples As-Built";
_useDevAgol = false;
}
#region Bound Properties
public bool UseDevAgol
{
get => _useDevAgol;
set => SetProperty(ref _useDevAgol, value);
}
public string UserName
{
get => _userName;
set => SetProperty(ref _userName, value);
}
public string Password
{
get => _password;
set => SetProperty(ref _password, value);
}
public string Message
{
get => _message;
set => SetProperty(ref _message, value);
}
#endregion
#region LoginCommand
public DelegateCommand LoginCommand => new DelegateCommand(ExecuteLogin);
public async void ExecuteLogin()
{
try
{
if (UserName == null)
{
await _pageDialogService.DisplayAlertAsync("User Name", "You need to enter a User Name", "Close");
return;
}
if (Password == null)
{
await _pageDialogService.DisplayAlertAsync("Password", "You need to enter a Password", "Close");
return;
}
Settings.UserName = UserName;
Settings.Password = Password;
Settings.UseDevAgol = UseDevAgol;
await NavigationService.NavigateAsync("BusyPopupPage", new NavigationParameters("?message=Logging into ArcGIS Online"));
//TODO: Check for connection - See Xamarin Essentials
await _portalManager.OpenPortalAsync();
await NavigationService.GoBackAsync(new NavigationParameters("?source=busy"));
if ( _portalManager.ConnectionStatus == ConnectionStatus.InvalidUser )
{
await _pageDialogService.DisplayAlertAsync("Login failed", "Login failed. Please retry", "Close");
UserName = Password = null;
return;
}
// Integrated this so that we can direct to different end destinations after login
if (_navigateToPage != null)
{
await NavigationService.NavigateAsync(_navigateToPage);
}
else
{
//return to calling page
await NavigationService.GoBackAsync();
}
}
catch (Exception)
{
await _pageDialogService.DisplayAlertAsync("Login failed", "Login failed. Please retry", "Close");
}
}
#endregion
#region CancelCommand
public ICommand CancelCommand => new DelegateCommand<object>(ExecuteCancel);
private async void ExecuteCancel(object obj)
{
await NavigationService.GoBackAsync();
}
#endregion
} PortalManager: One of the things that is needed is in the AuthenticationManager.Current.GenerateCredentialAsync method you need to use the sharing Url = https://arcgis.com/sharing/rest public class PortalManager : IPortalManager
{
private ArcGISPortal _portal;
private TokenCredential _credential;
private readonly ILogger _log;
public PortalManager(ILogManager logManager)
{
_log = logManager.GetLog();
ConnectionStatus = ConnectionStatus.NotConnected;
PortalUser = null;
}
public async Task<ArcGISPortal> OpenPortalAsync(bool refresh = false)
{
if (_portal != null && !refresh) return _portal;
try
{
var credential = await Credential(true);
//public static Uri AgolUrl => new Uri("https://arcgis.com");
_portal = await ArcGISPortal.CreateAsync(Constants.AgolUrl, credential, CancellationToken.None);
ConnectionStatus = ConnectionStatus.Connected;
PortalUser = _portal.User;
return _portal;
}
catch (ArcGISWebException)
{
ConnectionStatus = ConnectionStatus.InvalidUser;
return null;
}
catch (InvalidOperationException)
{
ConnectionStatus = ConnectionStatus.UnableToConnect;
return null;
}
catch (Exception)
{
ConnectionStatus = ConnectionStatus.UnableToConnect;
return null;
}
}
public async Task<TokenCredential> Credential(bool refresh)
{
if (_credential != null && !refresh) return _credential;
// public static Uri AgolSharingUri = new Uri("https://arcgis.com/sharing/rest");
_credential = await AuthenticationManager.Current.GenerateCredentialAsync(Constants.AgolSharingUri, Settings.UserName, Settings.Password);
return _credential;
}
public void SignOut()
{
_portal = null;
_credential = null;
PortalUser = null;
}
public ConnectionStatus ConnectionStatus { get; private set; }
public PortalUser PortalUser { get; private set; }
} Hope that helps -Joe
... View more
01-06-2020
07:34 AM
|
0
|
0
|
916
|
|
POST
|
What would be nice is if there was a way that one could set the condition of these edits as having been synced. That way of you had to do a manual sync of edits you could make the database know they has synced externally. Just a thought
... View more
12-20-2019
02:33 PM
|
0
|
0
|
1325
|
|
POST
|
Just kicking the tires with this one. Perhaps you could use Sqlite API directly to query the parent layers, build out the definition expression and then apply to the layer.
... View more
12-03-2019
09:01 AM
|
0
|
1
|
1226
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-11-2026 09:07 AM | |
| 1 | 10-23-2025 12:16 PM | |
| 1 | 10-19-2022 01:08 PM | |
| 1 | 09-03-2025 09:25 AM | |
| 1 | 04-16-2025 12:37 PM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|