Skip to content

Commit 6616a7c

Browse files
thumbnail added, notes regarding groups.clone and GroupMigrationManager added
1 parent bbfb8de commit 6616a7c

1 file changed

Lines changed: 25 additions & 9 deletions

File tree

samples/03_org_administrators/clone_a_group.ipynb

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
{
2828
"cell_type": "code",
29-
"execution_count": 2,
29+
"execution_count": 4,
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
@@ -46,7 +46,7 @@
4646
},
4747
{
4848
"cell_type": "code",
49-
"execution_count": 4,
49+
"execution_count": 7,
5050
"metadata": {},
5151
"outputs": [],
5252
"source": [
@@ -67,7 +67,7 @@
6767
},
6868
{
6969
"cell_type": "code",
70-
"execution_count": 5,
70+
"execution_count": 3,
7171
"metadata": {},
7272
"outputs": [
7373
{
@@ -79,7 +79,7 @@
7979
" <Group title:\"Vector Basemaps (for Export)\" owner:esri>]"
8080
]
8181
},
82-
"execution_count": 5,
82+
"execution_count": 3,
8383
"metadata": {},
8484
"output_type": "execute_result"
8585
}
@@ -91,7 +91,7 @@
9191
},
9292
{
9393
"cell_type": "code",
94-
"execution_count": 6,
94+
"execution_count": 4,
9595
"metadata": {},
9696
"outputs": [
9797
{
@@ -121,7 +121,7 @@
121121
"<Group title:\"Vector Basemaps\" owner:esri>"
122122
]
123123
},
124-
"execution_count": 6,
124+
"execution_count": 4,
125125
"metadata": {},
126126
"output_type": "execute_result"
127127
}
@@ -140,7 +140,7 @@
140140
},
141141
{
142142
"cell_type": "code",
143-
"execution_count": 9,
143+
"execution_count": 5,
144144
"metadata": {},
145145
"outputs": [
146146
{
@@ -149,7 +149,7 @@
149149
"[<Item title:\"Colored Pencil Map\" type:Web Map owner:esri>]"
150150
]
151151
},
152-
"execution_count": 9,
152+
"execution_count": 5,
153153
"metadata": {},
154154
"output_type": "execute_result"
155155
}
@@ -273,6 +273,13 @@
273273
" break\n"
274274
]
275275
},
276+
{
277+
"cell_type": "markdown",
278+
"metadata": {},
279+
"source": [
280+
"**Note:** The [GroupManager.clone()](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.GroupManager.clone) doesn't clone the group’s items, it only recreates groups from site A to site B. "
281+
]
282+
},
276283
{
277284
"cell_type": "markdown",
278285
"metadata": {},
@@ -317,12 +324,14 @@
317324
"#cloning all items that were not present on the portal before\n",
318325
"for item in items_to_be_cloned: \n",
319326
" try:\n",
327+
" thumbnail_file = item.download_thumbnail()\n",
320328
" target_item_properties = ItemProperties(title=item.title,\n",
321329
" tags=item.tags,\n",
322330
" text=item.get_data(try_json=True),\n",
323331
" item_type=item.type,\n",
324332
" snippet=item.snippet,\n",
325-
" description=item.description) \n",
333+
" description=item.description,\n",
334+
" thumbnail=thumbnail_file) \n",
326335
" #create an item\n",
327336
" root_folder = target.content.folders.get()\n",
328337
" job = root_folder.add(item_properties=target_item_properties, item_id=item.id)\n",
@@ -339,6 +348,13 @@
339348
" print('Item {} could not be created in the target portal'.format(item.title))\n",
340349
" print(e)"
341350
]
351+
},
352+
{
353+
"cell_type": "markdown",
354+
"metadata": {},
355+
"source": [
356+
"Please see [GroupMigrationManager](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#groupmigrationmanager) for offline exporting of group items"
357+
]
342358
}
343359
],
344360
"metadata": {

0 commit comments

Comments
 (0)