Skip to content

Commit b0c4769

Browse files
authored
Sample Server 7 10.8.1 Changes (#856)
Changed URLs for Sample Server 7. Added authentication code for Utility network samples.
1 parent 6fc6dcd commit b0c4769

File tree

88 files changed

+837
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+837
-231
lines changed

src/Android/Xamarin.Android/ArcGISRuntime.Xamarin.Samples.Android.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@
718718
</AndroidResource>
719719
</ItemGroup>
720720
<ItemGroup>
721-
<AndroidResource Include="Resources\layout\PerformValveIsolationTrace.axml">
721+
<AndroidResource Include="Resources\layout\PerformValveIsolationTrace.xml">
722722
<SubType>Designer</SubType>
723723
<Generator>MSBuild:UpdateGeneratedFiles</Generator>
724724
</AndroidResource>

src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.axml renamed to src/Android/Xamarin.Android/Resources/layout/PerformValveIsolationTrace.xml

File renamed without changes.

src/Android/Xamarin.Android/Samples/Data/EditBranchVersioning/EditBranchVersioning.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private async Task Initialize()
8181
{
8282
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
8383
string sampleServer7User = "editor01";
84-
string sampleServer7Pass = "editor01.password";
84+
string sampleServer7Pass = "S7#i2LWmYH75";
8585
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
8686
}
8787
catch (Exception ex)
@@ -100,7 +100,7 @@ private async Task Initialize()
100100
_protectionSpinner.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleSpinnerItem, _accessLevels.Select(l => Enum.GetName(typeof(VersionAccess), l)).ToList());
101101

102102
// Create and load a service geodatabase.
103-
_serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0"));
103+
_serviceGeodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/DamageAssessment/FeatureServer/0"));
104104
await _serviceGeodatabase.LoadAsync();
105105

106106
// When the service geodatabase has loaded get the default version name.

src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/ApplyMosaicRule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected override void OnCreate(Bundle bundle)
6060
private async Task Initialize()
6161
{
6262
// Create a raster layer using an image service.
63-
_imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer"));
63+
_imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer"));
6464
RasterLayer rasterLayer = new RasterLayer(_imageServiceRaster);
6565
await rasterLayer.LoadAsync();
6666

src/Android/Xamarin.Android/Samples/Layers/ApplyMosaicRule/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ When the rasters are loaded, choose from a list of preset mosaic rules to apply
3232

3333
## About the data
3434

35-
This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany.
35+
This sample uses a [raster image service](https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer) hosted on *ArcGIS Online* that shows aerial images of Amberg, Germany.
3636

3737
## Additional information
3838

src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/DisplaySubtypeFeatureLayer.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Esri.
1+
// Copyright 2021 Esri.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
44
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
@@ -14,9 +14,11 @@
1414
using Esri.ArcGISRuntime.Data;
1515
using Esri.ArcGISRuntime.Geometry;
1616
using Esri.ArcGISRuntime.Mapping;
17+
using Esri.ArcGISRuntime.Security;
1718
using Esri.ArcGISRuntime.Symbology;
1819
using Esri.ArcGISRuntime.UI.Controls;
1920
using System;
21+
using System.Diagnostics;
2022

2123
namespace ArcGISRuntimeXamarin.Samples.DisplaySubtypeFeatureLayer
2224
{
@@ -59,6 +61,23 @@ protected override void OnCreate(Bundle bundle)
5961

6062
private async void Initialize()
6163
{
64+
// As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations.
65+
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
66+
{
67+
try
68+
{
69+
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
70+
string sampleServer7User = "viewer01";
71+
string sampleServer7Pass = "I68VGU^nMurF";
72+
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
73+
}
74+
catch (Exception ex)
75+
{
76+
System.Diagnostics.Debug.WriteLine(ex.Message);
77+
return null;
78+
}
79+
});
80+
6281
try
6382
{
6483
// Starting viewpoint for the map view.
@@ -68,7 +87,7 @@ private async void Initialize()
6887
_myMapView.Map = new Map(BasemapStyle.ArcGISStreetsNight) { InitialViewpoint = _startingViewpoint };
6988

7089
// NOTE: This layer supports any ArcGIS Feature Table that define subtypes.
71-
SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100")));
90+
SubtypeFeatureLayer subtypeFeatureLayer = new SubtypeFeatureLayer(new ServiceFeatureTable(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0")));
7291
_myMapView.Map.OperationalLayers.Add(subtypeFeatureLayer);
7392

7493
// Select sublayer to control.

src/Android/Xamarin.Android/Samples/Layers/DisplaySubtypeFeatureLayer/readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis
3030

3131
## About the data
3232

33-
The [feature service layer](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/100) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices.
33+
The [feature service layer](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer/0) in this sample represents an electric network in Naperville, Illinois, which contains a utility network with asset classification for different devices.
34+
35+
## Additional information
36+
37+
Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm).
3438

3539
## Tags
3640

37-
asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range
41+
asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range

src/Android/Xamarin.Android/Samples/Map/ApplyScheduledUpdates/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ The data in this sample shows the roads and trails in the Canyonlands National P
5050

5151
## Tags
5252

53-
offline, preplanned, pre-planned, synchronize, update
53+
offline, preplanned, pre-planned, synchronize, update

src/Android/Xamarin.Android/Samples/Map/DownloadPreplannedMap/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ For more information about offline workflows, see [Offline maps, scenes, and dat
4949

5050
## Tags
5151

52-
map area, offline, pre-planned, preplanned
52+
map area, offline, pre-planned, preplanned

src/Android/Xamarin.Android/Samples/Utility network/ConfigureSubnetworkTrace/ConfigureSubnetworkTrace.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Esri.
1+
// Copyright 2021 Esri.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
44
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
@@ -15,6 +15,7 @@
1515
using Android.Widget;
1616
using ArcGISRuntime;
1717
using Esri.ArcGISRuntime.Data;
18+
using Esri.ArcGISRuntime.Security;
1819
using Esri.ArcGISRuntime.UtilityNetworks;
1920
using System;
2021
using System.Collections.Generic;
@@ -45,7 +46,7 @@ public class ConfigureSubnetworkTrace : Activity
4546
private View _mainView;
4647

4748
// Feature service for an electric utility network in Naperville, Illinois.
48-
private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer";
49+
private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer";
4950
private UtilityNetwork _utilityNetwork;
5051

5152
// For creating the default starting location.
@@ -90,6 +91,23 @@ protected override void OnCreate(Bundle bundle)
9091

9192
private async void Initialize()
9293
{
94+
// As of ArcGIS Enterprise 10.8.1, using utility network functionality requires a licensed user. The following login for the sample server is licensed to perform utility network operations.
95+
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
96+
{
97+
try
98+
{
99+
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
100+
string sampleServer7User = "viewer01";
101+
string sampleServer7Pass = "I68VGU^nMurF";
102+
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
103+
}
104+
catch (Exception ex)
105+
{
106+
System.Diagnostics.Debug.WriteLine(ex.Message);
107+
return null;
108+
}
109+
});
110+
93111
try
94112
{
95113
// Disable interaction until the data is loaded.

0 commit comments

Comments
 (0)