diff options
author | Arthur Valadares | 2009-08-25 10:28:22 -0300 |
---|---|---|
committer | Arthur Valadares | 2009-08-25 10:28:22 -0300 |
commit | 9c9fa51b0f005f570df2e3e3b84dfa3974935995 (patch) | |
tree | 49553fb3d3513f826f360eb426e1be7242a92aaf /OpenSim/Services | |
parent | Adds osDrawPolygon to OSSL. Works a little different then other OS Drawing fu... (diff) | |
parent | Closed the web request and stream in SynchronousRestSessionObjectPoster -- ma... (diff) | |
download | opensim-SC_OLD-9c9fa51b0f005f570df2e3e3b84dfa3974935995.zip opensim-SC_OLD-9c9fa51b0f005f570df2e3e3b84dfa3974935995.tar.gz opensim-SC_OLD-9c9fa51b0f005f570df2e3e3b84dfa3974935995.tar.bz2 opensim-SC_OLD-9c9fa51b0f005f570df2e3e3b84dfa3974935995.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into arthursv
Diffstat (limited to 'OpenSim/Services')
6 files changed, 90 insertions, 7 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 b573a06..a2261ba 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -229,6 +229,11 @@ namespace OpenSim.Services.Connectors | |||
229 | return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject( | 229 | return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject( |
230 | "POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString()); | 230 | "POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString()); |
231 | } | 231 | } |
232 | catch (TimeoutException e) | ||
233 | { | ||
234 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderContent operation to {0} timed out {0} {1}.", m_ServerURI, | ||
235 | e.Source, e.Message); | ||
236 | } | ||
232 | catch (Exception e) | 237 | catch (Exception e) |
233 | { | 238 | { |
234 | // Maybe we're talking to an old inventory server. Try this other thing. | 239 | // Maybe we're talking to an old inventory server. Try this other thing. |
@@ -308,6 +313,25 @@ namespace OpenSim.Services.Connectors | |||
308 | return false; | 313 | return false; |
309 | } | 314 | } |
310 | 315 | ||
316 | public bool DeleteFolders(string userID, List<UUID> folderIDs, UUID sessionID) | ||
317 | { | ||
318 | try | ||
319 | { | ||
320 | List<Guid> guids = new List<Guid>(); | ||
321 | foreach (UUID u in folderIDs) | ||
322 | guids.Add(u.Guid); | ||
323 | return SynchronousRestSessionObjectPoster<List<Guid>, bool>.BeginPostObject( | ||
324 | "POST", m_ServerURI + "/DeleteFolders/", guids, sessionID.ToString(), userID); | ||
325 | } | ||
326 | catch (Exception e) | ||
327 | { | ||
328 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: Delete inventory folders operation failed, {0} {1}", | ||
329 | e.Source, e.Message); | ||
330 | } | ||
331 | |||
332 | return false; | ||
333 | } | ||
334 | |||
311 | public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID) | 335 | public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID) |
312 | { | 336 | { |
313 | try | 337 | try |
@@ -397,13 +421,28 @@ namespace OpenSim.Services.Connectors | |||
397 | 421 | ||
398 | private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID) | 422 | private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID) |
399 | { | 423 | { |
424 | if (items == null) | ||
425 | { | ||
426 | m_log.WarnFormat("[INVENTORY CONNECTOR]: request to move items got a null list."); | ||
427 | return; | ||
428 | } | ||
429 | |||
400 | try | 430 | try |
401 | { | 431 | { |
402 | SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject( | 432 | //SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject( |
403 | "POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString()); | 433 | // "POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString()); |
434 | |||
435 | //// Success | ||
436 | //return; | ||
437 | string uri = m_ServerURI + "/inventory/" + userID; | ||
438 | if (SynchronousRestObjectRequester. | ||
439 | MakeRequest<List<InventoryItemBase>, bool>("PUT", uri, items)) | ||
440 | m_log.DebugFormat("[INVENTORY CONNECTOR]: move {0} items poster succeeded {1}", items.Count, uri); | ||
441 | else | ||
442 | m_log.DebugFormat("[INVENTORY CONNECTOR]: move {0} items poster failed {1}", items.Count, uri); ; | ||
404 | 443 | ||
405 | // Success | ||
406 | return; | 444 | return; |
445 | |||
407 | } | 446 | } |
408 | catch (Exception e) | 447 | catch (Exception e) |
409 | { | 448 | { |
@@ -466,12 +505,12 @@ namespace OpenSim.Services.Connectors | |||
466 | return null; | 505 | return null; |
467 | } | 506 | } |
468 | 507 | ||
469 | public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID sessionID) | 508 | public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase folder, UUID sessionID) |
470 | { | 509 | { |
471 | try | 510 | try |
472 | { | 511 | { |
473 | return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject( | 512 | return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject( |
474 | "POST", m_ServerURI + "/QueryFolder/", item, sessionID.ToString(), item.Owner.ToString()); | 513 | "POST", m_ServerURI + "/QueryFolder/", folder, sessionID.ToString(), userID); |
475 | } | 514 | } |
476 | catch (Exception e) | 515 | catch (Exception e) |
477 | { | 516 | { |
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 | /// |