Skip to content

Commit

Permalink
Sample Server 7 10.8.1 Changes (#856)
Browse files Browse the repository at this point in the history
Changed URLs for Sample Server 7.
Added authentication code for Utility network samples.
  • Loading branch information
ZackAllen authored Mar 31, 2021
1 parent 6fc6dcd commit b0c4769
Show file tree
Hide file tree
Showing 88 changed files with 837 additions and 231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@
</AndroidResource>
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\PerformValveIsolationTrace.axml">
<AndroidResource Include="Resources\layout\PerformValveIsolationTrace.xml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateGeneratedFiles</Generator>
</AndroidResource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private async Task Initialize()
{
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
string sampleServer7User = "editor01";
string sampleServer7Pass = "editor01.password";
string sampleServer7Pass = "S7#i2LWmYH75";
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
}
catch (Exception ex)
Expand All @@ -100,7 +100,7 @@ private async Task Initialize()
_protectionSpinner.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleSpinnerItem, _accessLevels.Select(l => Enum.GetName(typeof(VersionAccess), l)).ToList());

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

// When the service geodatabase has loaded get the default version name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected override void OnCreate(Bundle bundle)
private async Task Initialize()
{
// Create a raster layer using an image service.
_imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/arcgis/rest/services/amberg_germany/ImageServer"));
_imageServiceRaster = new ImageServiceRaster(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/amberg_germany/ImageServer"));
RasterLayer rasterLayer = new RasterLayer(_imageServiceRaster);
await rasterLayer.LoadAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ When the rasters are loaded, choose from a list of preset mosaic rules to apply

## About the data

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.
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.

## Additional information

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Esri.
// Copyright 2021 Esri.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -14,9 +14,11 @@
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Security;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI.Controls;
using System;
using System.Diagnostics;

namespace ArcGISRuntimeXamarin.Samples.DisplaySubtypeFeatureLayer
{
Expand Down Expand Up @@ -59,6 +61,23 @@ protected override void OnCreate(Bundle bundle)

private async void Initialize()
{
// 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.
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
try
{
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
string sampleServer7User = "viewer01";
string sampleServer7Pass = "I68VGU^nMurF";
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
return null;
}
});

try
{
// Starting viewpoint for the map view.
Expand All @@ -68,7 +87,7 @@ private async void Initialize()
_myMapView.Map = new Map(BasemapStyle.ArcGISStreetsNight) { InitialViewpoint = _startingViewpoint };

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

// Select sublayer to control.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ The sample loads with the sublayer visible on the map. Change the sublayer's vis

## About the data

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.
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.

## Additional information

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).

## Tags

asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range
asset group, feature layer, labeling, sublayer, subtype, symbology, utility network, visible scale range
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ The data in this sample shows the roads and trails in the Canyonlands National P

## Tags

offline, preplanned, pre-planned, synchronize, update
offline, preplanned, pre-planned, synchronize, update
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ For more information about offline workflows, see [Offline maps, scenes, and dat

## Tags

map area, offline, pre-planned, preplanned
map area, offline, pre-planned, preplanned
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Esri.
// Copyright 2021 Esri.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -15,6 +15,7 @@
using Android.Widget;
using ArcGISRuntime;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Security;
using Esri.ArcGISRuntime.UtilityNetworks;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -45,7 +46,7 @@ public class ConfigureSubnetworkTrace : Activity
private View _mainView;

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

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

private async void Initialize()
{
// 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.
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
try
{
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
string sampleServer7User = "viewer01";
string sampleServer7Pass = "I68VGU^nMurF";
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
return null;
}
});

try
{
// Disable interaction until the data is loaded.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ Example barrier conditions for the default dataset:

## About the data

The [Naperville electrical](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample.
The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online, contains a utility network used to run the subnetwork-based trace shown in this sample.

## Additional information

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).

## Tags

category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency
category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Esri.
// Copyright 2021 Esri.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -13,6 +13,7 @@
using Esri.ArcGISRuntime;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Security;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
Expand Down Expand Up @@ -41,7 +42,7 @@ public class DisplayUtilityAssociations : Activity
private ImageView _attachmentImageView;

// Feature server for the utility network.
private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer";
private const string FeatureServerUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer";

// This viewpoint shows several associations clearly in the utility network.
private readonly Viewpoint InitialViewpoint = new Viewpoint(new MapPoint(-9812697.41544719, 5131928.28213524, SpatialReferences.WebMercator), 73.4352610787649);
Expand All @@ -67,6 +68,24 @@ protected override void OnCreate(Bundle bundle)

private async void Initialize()
{
// 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.
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
try
{
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
string sampleServer7User = "viewer01";
string sampleServer7Pass = "I68VGU^nMurF";

return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
return null;
}
});

try
{
// Create the utility network.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ Pan and zoom around the map. Observe graphics that show utility associations bet

## About the data

The [feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace.
The [feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace.

## Additional information

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).

## Tags

associating, association, attachment, connectivity, containment, relationships
associating, association, attachment, connectivity, containment, relationships
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Security;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
Expand All @@ -31,7 +32,7 @@ namespace ArcGISRuntimeXamarin.Samples.PerformValveIsolationTrace
description: "Run a filtered trace to locate operable features that will isolate an area from the flow of network resources.",
instructions: "Create and set the configuration's filter barriers by selecting a category. Check or uncheck 'Include Isolated Features'. Tap 'Trace' to run a subnetwork-based isolation trace.",
tags: new[] { "category comparison", "condition barriers", "isolated features", "network analysis", "subnetwork trace", "trace configuration", "trace filter", "utility network" })]
[ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("PerformValveIsolationTrace.axml")]
[ArcGISRuntime.Samples.Shared.Attributes.AndroidLayout("PerformValveIsolationTrace.xml")]
public class PerformValveIsolationTrace : Activity
{
// Hold references to the UI controls.
Expand All @@ -42,7 +43,7 @@ public class PerformValveIsolationTrace : Activity
private ProgressBar _loadingBar;

// Feature service for an electric utility network in Naperville, Illinois.
private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer";
private const string FeatureServiceUrl = "https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer";
private const int LineLayerId = 3;
private const int DeviceLayerId = 0;
private UtilityNetwork _utilityNetwork;
Expand Down Expand Up @@ -73,6 +74,24 @@ protected override void OnCreate(Bundle bundle)

private async void Initialize()
{
// 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.
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
try
{
// WARNING: Never hardcode login information in a production application. This is done solely for the sake of the sample.
string sampleServer7User = "viewer01";
string sampleServer7Pass = "I68VGU^nMurF";

return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, sampleServer7User, sampleServer7Pass);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
return null;
}
});

try
{
// Disable the UI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ Create and set the configuration's filter barriers by selecting a category. Chec

## About the data

The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample.
The [Naperville gas network feature service](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGas/FeatureServer), hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample.

## Additional information

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).

## Tags

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"UtilityTraceType"
],
"snippets": [
"../../../Resources/layout/PerformValveIsolationTrace.axml",
"../../../Resources/layout/PerformValveIsolationTrace.xml",
"PerformValveIsolationTrace.cs"
],
"title": "Perform valve isolation trace"
Expand Down
Loading

0 comments on commit b0c4769

Please sign in to comment.