|
208 | 208 | "root_folder = gis.content.folders.get()\n", |
209 | 209 | "# Loop through each file and publish it as a service\n", |
210 | 210 | "for current_sd_file in sd_file_list:\n", |
211 | | - " item = root_folder.add({\"title\": \"New Layer\", \"item_type\": \"Service Definition\"}, data_dir + current_sd_file).result() # .sd file is uploaded and a .sd file item is created\n", |
| 211 | + " item = root_folder.add({\"title\": \"New Layer\", \"type\": \"Service Definition\"}, data_dir + current_sd_file).result() # .sd file is uploaded and a .sd file item is created\n", |
212 | 212 | " if \"BuildCache\" not in current_sd_file:\n", |
213 | 213 | " published_item = item.publish() # .sd file item is published and a web layer item is created\n", |
214 | 214 | " else:\n", |
|
276 | 276 | ], |
277 | 277 | "source": [ |
278 | 278 | "proot_folder = p_gis.content.folders.get()\n", |
279 | | - "uploaded_file = proot_folder.add({\"title\": \"Nursing Home Location\", \"item_type\": \"Service Definition\"}, file=sd_file).result()\n", |
| 279 | + "uploaded_file = proot_folder.add({\"title\": \"Nursing Home Location\", \"type\": \"Service Definition\"}, file=sd_file).result()\n", |
280 | 280 | "uploaded_file.tags" |
281 | 281 | ] |
282 | 282 | }, |
|
387 | 387 | "outputs": [], |
388 | 388 | "source": [ |
389 | 389 | "data = \"data/power_pedestals_2012.zip\"\n", |
390 | | - "shpfile = root_folder.add({\"title\": \"power_pedestals_2012\", \"item_type\": \"Shapefile\"}, data).result()" |
| 390 | + "shpfile = root_folder.add({\"title\": \"power_pedestals_2012\", \"type\": \"Shapefile\"}, data).result()" |
391 | 391 | ] |
392 | 392 | }, |
393 | 393 | { |
|
556 | 556 | "outputs": [], |
557 | 557 | "source": [ |
558 | 558 | "csv_file = 'data/Chennai_precipitation.csv'\n", |
559 | | - "csv_item = root_folder.add({\"title\": \"Chennai Precipitation\", \"item_type\": \"CSV\"}, csv_file).result()" |
| 559 | + "csv_item = root_folder.add({\"title\": \"Chennai Precipitation\", \"type\": \"CSV\"}, csv_file).result()" |
560 | 560 | ] |
561 | 561 | }, |
562 | 562 | { |
|
652 | 652 | { |
653 | 653 | "cell_type": "markdown", |
654 | 654 | "metadata": { |
655 | | - "collapsed": true |
| 655 | + "collapsed": true, |
| 656 | + "jupyter": { |
| 657 | + "outputs_hidden": true |
| 658 | + } |
656 | 659 | }, |
657 | 660 | "source": [ |
658 | 661 | "### Create a new folder for the items\n", |
|
708 | 711 | { |
709 | 712 | "cell_type": "markdown", |
710 | 713 | "metadata": { |
711 | | - "collapsed": true |
| 714 | + "collapsed": true, |
| 715 | + "jupyter": { |
| 716 | + "outputs_hidden": true |
| 717 | + } |
712 | 718 | }, |
713 | 719 | "source": [ |
714 | 720 | "Now that the items are moved, we can request for the item's `ownerFolder` property and ensure it matches the `id` of the folder created in the previous step" |
|
739 | 745 | "notebookRuntimeVersion": "4.0" |
740 | 746 | }, |
741 | 747 | "kernelspec": { |
742 | | - "display_name": "Python 3", |
| 748 | + "display_name": "Python 3 (ipykernel)", |
743 | 749 | "language": "python", |
744 | 750 | "name": "python3" |
745 | 751 | }, |
|
753 | 759 | "name": "python", |
754 | 760 | "nbconvert_exporter": "python", |
755 | 761 | "pygments_lexer": "ipython3", |
756 | | - "version": "3.11.8" |
| 762 | + "version": "3.11.0" |
757 | 763 | }, |
758 | 764 | "toc": { |
759 | 765 | "base_numbering": 1, |
|
799 | 805 | } |
800 | 806 | }, |
801 | 807 | "nbformat": 4, |
802 | | - "nbformat_minor": 1 |
| 808 | + "nbformat_minor": 4 |
803 | 809 | } |
0 commit comments