diff options
Diffstat (limited to 'OpenSim/Services')
6 files changed, 67 insertions, 4 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs index 45e921a..1004fb9 100644 --- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs | |||
@@ -201,6 +201,19 @@ namespace OpenSim.Services.Connectors.Inventory | |||
201 | return false; | 201 | return false; |
202 | } | 202 | } |
203 | 203 | ||
204 | public bool DeleteFolders(string id, List<UUID> folders, UUID sessionID) | ||
205 | { | ||
206 | string url = string.Empty; | ||
207 | string userID = string.Empty; | ||
208 | |||
209 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
210 | { | ||
211 | ISessionAuthInventoryService connector = GetConnector(url); | ||
212 | return connector.DeleteFolders(userID, folders, sessionID); | ||
213 | } | ||
214 | return false; | ||
215 | } | ||
216 | |||
204 | public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID) | 217 | public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID) |
205 | { | 218 | { |
206 | string url = string.Empty; | 219 | string url = string.Empty; |
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs index c89c9b7..da8c7e2 100644 --- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs +++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs | |||
@@ -89,6 +89,11 @@ namespace OpenSim.Services.Connectors | |||
89 | bool MoveFolder(string userID, InventoryFolderBase folder, UUID session_id); | 89 | bool MoveFolder(string userID, InventoryFolderBase folder, UUID session_id); |
90 | 90 | ||
91 | /// <summary> | 91 | /// <summary> |
92 | /// Delete a list of inventory folders (from trash) | ||
93 | /// </summary> | ||
94 | bool DeleteFolders(string userID, List<UUID> folders, UUID session_id); | ||
95 | |||
96 | /// <summary> | ||
92 | /// Purge an inventory folder of all its items and subfolders. | 97 | /// Purge an inventory folder of all its items and subfolders. |
93 | /// </summary> | 98 | /// </summary> |
94 | /// <param name="folder"></param> | 99 | /// <param name="folder"></param> |
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index 7c35bde..423ca75 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -308,6 +308,25 @@ namespace OpenSim.Services.Connectors | |||
308 | return false; | 308 | return false; |
309 | } | 309 | } |
310 | 310 | ||
311 | public bool DeleteFolders(string userID, List<UUID> folderIDs, UUID sessionID) | ||
312 | { | ||
313 | try | ||
314 | { | ||
315 | List<Guid> guids = new List<Guid>(); | ||
316 | foreach (UUID u in folderIDs) | ||
317 | guids.Add(u.Guid); | ||
318 | return SynchronousRestSessionObjectPoster<List<Guid>, bool>.BeginPostObject( | ||
319 | "POST", m_ServerURI + "/DeleteFolders/", guids, sessionID.ToString(), userID); | ||
320 | } | ||
321 | catch (Exception e) | ||
322 | { | ||
323 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: Delete inventory folders operation failed, {0} {1}", | ||
324 | e.Source, e.Message); | ||
325 | } | ||
326 | |||
327 | return false; | ||
328 | } | ||
329 | |||
311 | public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID) | 330 | public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID) |
312 | { | 331 | { |
313 | try | 332 | try |
@@ -481,12 +500,12 @@ namespace OpenSim.Services.Connectors | |||
481 | return null; | 500 | return null; |
482 | } | 501 | } |
483 | 502 | ||
484 | public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID sessionID) | 503 | public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase folder, UUID sessionID) |
485 | { | 504 | { |
486 | try | 505 | try |
487 | { | 506 | { |
488 | return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject( | 507 | return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject( |
489 | "POST", m_ServerURI + "/QueryFolder/", item, sessionID.ToString(), item.Owner.ToString()); | 508 | "POST", m_ServerURI + "/QueryFolder/", folder, sessionID.ToString(), userID); |
490 | } | 509 | } |
491 | catch (Exception e) | 510 | catch (Exception e) |
492 | { | 511 | { |
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs index cd283ff..a7aa138 100644 --- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs | |||
@@ -136,6 +136,12 @@ namespace OpenSim.Services.Connectors | |||
136 | return false; | 136 | return false; |
137 | } | 137 | } |
138 | 138 | ||
139 | public bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
140 | { | ||
141 | return false; | ||
142 | } | ||
143 | |||
144 | |||
139 | public bool PurgeFolder(InventoryFolderBase folder) | 145 | public bool PurgeFolder(InventoryFolderBase folder) |
140 | { | 146 | { |
141 | return false; | 147 | return false; |
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index ebdb09a..c775090 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs | |||
@@ -122,6 +122,14 @@ namespace OpenSim.Services.Interfaces | |||
122 | bool MoveFolder(InventoryFolderBase folder); | 122 | bool MoveFolder(InventoryFolderBase folder); |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// Delete an item from the user's inventory | ||
126 | /// </summary> | ||
127 | /// <param name="item"></param> | ||
128 | /// <returns>true if the item was successfully deleted</returns> | ||
129 | //bool DeleteItem(InventoryItemBase item); | ||
130 | bool DeleteFolders(UUID userID, List<UUID> folderIDs); | ||
131 | |||
132 | /// <summary> | ||
125 | /// Purge an inventory folder of all its items and subfolders. | 133 | /// Purge an inventory folder of all its items and subfolders. |
126 | /// </summary> | 134 | /// </summary> |
127 | /// <param name="folder"></param> | 135 | /// <param name="folder"></param> |
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 45bbd37..19b1fd8 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -425,15 +425,27 @@ namespace OpenSim.Services.InventoryService | |||
425 | return null; | 425 | return null; |
426 | } | 426 | } |
427 | 427 | ||
428 | public virtual InventoryFolderBase GetFolder(InventoryFolderBase item) | 428 | public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) |
429 | { | 429 | { |
430 | InventoryFolderBase result = m_Database.getInventoryFolder(item.ID); | 430 | InventoryFolderBase result = m_Database.getInventoryFolder(folder.ID); |
431 | if (result != null) | 431 | if (result != null) |
432 | return result; | 432 | return result; |
433 | 433 | ||
434 | m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folder.ID); | ||
434 | return null; | 435 | return null; |
435 | } | 436 | } |
436 | 437 | ||
438 | public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
439 | { | ||
440 | foreach (UUID id in folderIDs) | ||
441 | { | ||
442 | InventoryFolderBase folder = new InventoryFolderBase(id, ownerID); | ||
443 | PurgeFolder(folder); | ||
444 | m_Database.deleteInventoryFolder(id); | ||
445 | } | ||
446 | return true; | ||
447 | } | ||
448 | |||
437 | /// <summary> | 449 | /// <summary> |
438 | /// Purge a folder of all items items and subfolders. | 450 | /// Purge a folder of all items items and subfolders. |
439 | /// | 451 | /// |