aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-04-23 22:13:57 +0000
committerJustin Clarke Casey2008-04-23 22:13:57 +0000
commit40176c12f94044527e82972cbb72cce8caa5ce2b (patch)
tree6d917c2688a039bcc1b64b9699808f62dce4edec
parent* Fixes lsl scripts with no state_entry event at all (diff)
downloadopensim-SC-40176c12f94044527e82972cbb72cce8caa5ce2b.zip
opensim-SC-40176c12f94044527e82972cbb72cce8caa5ce2b.tar.gz
opensim-SC-40176c12f94044527e82972cbb72cce8caa5ce2b.tar.bz2
opensim-SC-40176c12f94044527e82972cbb72cce8caa5ce2b.tar.xz
* Implement full grid mode Trash empty
* Now, emptying the trash should remove folders and the items they contain as well as items which were not in a subfolder. * This will only work once both the region and grid servers have reached this revision. * You may also need to clear your cache before this will work * Refactoring to follow.
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs9
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs13
-rw-r--r--OpenSim/Grid/InventoryServer/GridInventoryService.cs24
-rw-r--r--OpenSim/Grid/InventoryServer/Main.cs4
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs38
5 files changed, 62 insertions, 26 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 61ec483..1e3dbb6 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -523,14 +523,7 @@ namespace OpenSim.Framework.Communications.Cache
523 purgedBaseFolder.Type = purgedFolder.Type; 523 purgedBaseFolder.Type = purgedFolder.Type;
524 purgedBaseFolder.Version = purgedFolder.Version; 524 purgedBaseFolder.Version = purgedFolder.Version;
525 525
526 m_commsManager.InventoryService.PurgeInventoryFolder(remoteClient.AgentId, purgedBaseFolder); 526 m_commsManager.InventoryService.PurgeInventoryFolder(remoteClient.AgentId, purgedBaseFolder);
527
528 // XXX Remains temporarily so that we still delete items in the grid case.
529 List<InventoryItemBase> items = purgedFolder.RequestListOfItems();
530 foreach (InventoryItemBase item in items)
531 {
532 userProfile.DeleteItem(remoteClient.AgentId, item);
533 }
534 527
535 purgedFolder.Purge(); 528 purgedFolder.Purge();
536 } 529 }
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 5cbfcf9..0528b91 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -259,13 +259,12 @@ namespace OpenSim.Framework.Communications
259 } 259 }
260 } 260 }
261 261
262 // XXX Temporarily don't delete the items since UserProfileCacheService is still doing this 262 List<InventoryItemBase> items = RequestFolderItems(folder.ID);
263// List<InventoryItemBase> items = RequestFolderItems(folder.ID); 263
264// 264 foreach (InventoryItemBase item in items)
265// foreach (InventoryItemBase item : items) 265 {
266// { 266 DeleteItem(item);
267// DeleteItem(item); 267 }
268// }
269 } 268 }
270 269
271 private void AddNewInventorySet(UsersInventory inventory) 270 private void AddNewInventorySet(UsersInventory inventory)
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
index 016ecff..efa6a6e 100644
--- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs
+++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
@@ -198,6 +198,11 @@ namespace OpenSim.Grid.InventoryServer
198 { 198 {
199 MoveFolder(folder); 199 MoveFolder(folder);
200 } 200 }
201
202 public override void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder)
203 {
204 PurgeFolder(folder);
205 }
201 206
202 public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) 207 public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
203 { 208 {
@@ -207,7 +212,8 @@ namespace OpenSim.Grid.InventoryServer
207 public bool AddInventoryFolder(InventoryFolderBase folder) 212 public bool AddInventoryFolder(InventoryFolderBase folder)
208 { 213 {
209 // Right now, this actions act more like an update/insert combination than a simple create. 214 // Right now, this actions act more like an update/insert combination than a simple create.
210 m_log.InfoFormat("[GRID AGENT INVENTORY]: Creating folder {0} {1} in folder {2}", folder.Name, folder.ID, folder.ParentID); 215 m_log.InfoFormat(
216 "[GRID AGENT INVENTORY]: Creating folder {0} {1} in folder {2}", folder.Name, folder.ID, folder.ParentID);
211 217
212 AddNewInventoryFolder(folder.Owner, folder); 218 AddNewInventoryFolder(folder.Owner, folder);
213 return true; 219 return true;
@@ -215,20 +221,20 @@ namespace OpenSim.Grid.InventoryServer
215 221
216 public bool MoveInventoryFolder(InventoryFolderBase folder) 222 public bool MoveInventoryFolder(InventoryFolderBase folder)
217 { 223 {
218 m_log.InfoFormat("[GRID AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); 224 m_log.InfoFormat(
225 "[GRID AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
219 226
220 MoveExistingInventoryFolder(folder); 227 MoveExistingInventoryFolder(folder);
221 return true; 228 return true;
222 } 229 }
223 230
224 /// <summary> 231 public bool PurgeInventoryFolder(InventoryFolderBase folder)
225 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
226 /// </summary>
227 /// <param name="userID"></param>
228 /// <param name="folder"></param>
229 public override void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder)
230 { 232 {
231 // XXX No implementation yet (temporarily)! 233 m_log.InfoFormat(
234 "[GRID AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID);
235
236 PurgeInventoryFolder(folder.Owner, folder);
237 return true;
232 } 238 }
233 239
234 public bool AddInventoryItem(InventoryItemBase item) 240 public bool AddInventoryItem(InventoryItemBase item)
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 85d9ba5..870997b 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -100,6 +100,10 @@ namespace OpenSim.Grid.InventoryServer
100 m_httpServer.AddStreamHandler( 100 m_httpServer.AddStreamHandler(
101 new RestDeserialisehandler<InventoryFolderBase, bool>( 101 new RestDeserialisehandler<InventoryFolderBase, bool>(
102 "POST", "/MoveFolder/", m_inventoryService.MoveInventoryFolder)); 102 "POST", "/MoveFolder/", m_inventoryService.MoveInventoryFolder));
103
104 m_httpServer.AddStreamHandler(
105 new RestDeserialisehandler<InventoryFolderBase, bool>(
106 "POST", "/PurgeFolder/", m_inventoryService.PurgeInventoryFolder));
103 107
104 m_httpServer.AddStreamHandler( 108 m_httpServer.AddStreamHandler(
105 new RestDeserialisehandler<InventoryItemBase, bool>( 109 new RestDeserialisehandler<InventoryItemBase, bool>(
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 8c27cb1..65f3ee3 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -53,7 +53,11 @@ namespace OpenSim.Region.Communications.OGS1
53 53
54 #region IInventoryServices Members 54 #region IInventoryServices Members
55 55
56 // See IInventoryServices 56 /// <summary>
57 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
58 /// </summary>
59 /// <param name="userID"></param>
60 /// <param name="callback"></param>
57 public void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) 61 public void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback)
58 { 62 {
59 if (!m_RequestingInventory.ContainsKey(userID)) 63 if (!m_RequestingInventory.ContainsKey(userID))
@@ -148,6 +152,11 @@ namespace OpenSim.Region.Communications.OGS1
148 } 152 }
149 } 153 }
150 154
155 /// <summary>
156 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
157 /// </summary>
158 /// <param name="userID"></param>
159 /// <param name="folder"></param>
151 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) 160 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
152 { 161 {
153 try 162 try
@@ -162,6 +171,11 @@ namespace OpenSim.Region.Communications.OGS1
162 } 171 }
163 } 172 }
164 173
174 /// <summary>
175 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
176 /// </summary>
177 /// <param name="userID"></param>
178 /// <param name="folder"></param>
165 public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) 179 public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder)
166 { 180 {
167 try 181 try
@@ -181,11 +195,26 @@ namespace OpenSim.Region.Communications.OGS1
181 /// </summary> 195 /// </summary>
182 /// <param name="userID"></param> 196 /// <param name="userID"></param>
183 /// <param name="folder"></param> 197 /// <param name="folder"></param>
198 /// <returns></returns>
184 public void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder) 199 public void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder)
185 { 200 {
186 // XXX No implementation yet (temporarily)! 201 try
202 {
203 SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
204 "POST", _inventoryServerUrl + "/PurgeFolder/", folder);
205 }
206 catch (WebException e)
207 {
208 m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Move inventory folder operation failed, {0} {1}",
209 e.Source, e.Message);
210 }
187 } 211 }
188 212
213 /// <summary>
214 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
215 /// </summary>
216 /// <param name="userID"></param>
217 /// <param name="folder"></param>
189 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) 218 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
190 { 219 {
191 try 220 try
@@ -200,6 +229,11 @@ namespace OpenSim.Region.Communications.OGS1
200 } 229 }
201 } 230 }
202 231
232 /// <summary>
233 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
234 /// </summary>
235 /// <param name="userID"></param>
236 /// <param name="folder"></param>
203 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) 237 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
204 { 238 {
205 try 239 try