|
314 | 314 | ],
|
315 | 315 | "source": [
|
316 | 316 | "# conversely, we can grab a dependent item and see what items immediately contain it and need it to exist\n",
|
317 |
| - "result_form = graph.get_item(\"41dd3cca32914cc7ae8fd3a727f44e17\")\n", |
318 |
| - "result_form.item" |
| 317 | + "result_flayer = graph.get_item(\"41dd3cca32914cc7ae8fd3a727f44e17\")\n", |
| 318 | + "result_flayer.item" |
319 | 319 | ]
|
320 | 320 | },
|
321 | 321 | {
|
|
338 | 338 | ],
|
339 | 339 | "source": [
|
340 | 340 | "# contained_by() = items in the graph that immediately use/reference this feature layer item\n",
|
341 |
| - "result_form.contained_by()" |
| 341 | + "result_flayer.contained_by()" |
342 | 342 | ]
|
343 | 343 | },
|
344 | 344 | {
|
|
362 | 362 | ],
|
363 | 363 | "source": [
|
364 | 364 | "# required_by() = every item in the graph that needs this feature layer item to exist\n",
|
365 |
| - "result_form.required_by()" |
| 365 | + "result_flayer.required_by()" |
366 | 366 | ]
|
367 | 367 | },
|
368 | 368 | {
|
|
384 | 384 | "\n",
|
385 | 385 | "[The documentation for this function can be found here.](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.remap_data)\n",
|
386 | 386 | "\n",
|
387 |
| - "We've covered functionality that can identify items contained within other items- now let's take a look at functionality that can automate replacement of those items, or fix other parts of an application's structure. `remap_data()` is a powerful tool for working with your JSON-based applications in the ArcGIS system. At its core, it allows you to swap out data sources within your apps. Say you have multiple layers in a webmap you want to swap out, or a map present in a StoryMap- all you have to do is construct a replacement dictionary mapping your old item ID's to your new ones, and it will replace them, both in the draft and published versions of your app.\n", |
| 387 | + "We've covered functionality that can identify items contained within other items- now let's take a look at functionality that can automate replacement of those items, or fix other parts of an application's structure. `remap_data()` is a powerful tool for working with your JSON-based applications in the ArcGIS system. At its core, it allows you to swap out data sources within your item's JSON structure. Say you have multiple layers in a webmap you want to swap out, or a map present in a StoryMap- all you have to do is construct a replacement dictionary mapping your old item ID's to your new ones, and it will replace them, both in the draft and published versions of your app.\n", |
388 | 388 | "\n",
|
389 |
| - "When the `force` parameter is set to `False` (the default), some validation occurs under the hood. The function ensures that both items exist in the GIS organization, and that they're of the same type, so nothing gets messed up in the application. However, setting `Force` to `True` gives you more power, at the risk of altering the underlying structure without validation. You can use it to replace item ID's that no longer exist in the organization, change the name of something throughout the app, fix a typo, etc. It uses a regular expression to identify and replace instances of strings, so it will pick things up wherever they are in the structure.\n", |
| 389 | + "When the `force` parameter is set to `False` (the default), some validation occurs under the hood. The function ensures that both items exist in the GIS organization, and that they're of the same type, to retain a valid configuration of the application. However, setting `Force` to `True` gives you more power, at the risk of altering the underlying structure without validation. You can use it to replace item ID's that no longer exist in the organization, change the name of something throughout the app, fix a typo, etc. It uses a regular expression to identify and replace instances of strings, so it will pick things up wherever they are in the structure.\n", |
390 | 390 | "\n",
|
391 | 391 | "Let's look at a basic example of it in action. We'll examine the JSON of an application we're working with to note the effects."
|
392 | 392 | ]
|
|
729 | 729 | "source": [
|
730 | 730 | "### Putting it Together\n",
|
731 | 731 | "\n",
|
732 |
| - "Now that we've seen how these things work, let's see how we can use them to speed up what might be an otherwise tedious workflow.\n", |
| 732 | + "Now that we've seen how these things work, let's see how we can use them to speed up what might be an otherwise time-consuming workflow.\n", |
733 | 733 | "\n",
|
734 | 734 | "Put yourself in the shoes of an admin that has been tasked with the process of migrating items to a new portal. Before migrating, you want to ensure that all of your items (such as your complex apps) are rendering correctly and not missing any data sources, but don't want to manually click through each one and/or their drafts. How can we more efficiently find out what's missing?\n",
|
735 | 735 | "\n",
|
|
0 commit comments