diff options
author | Diva Canto | 2009-08-11 12:30:28 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-11 12:30:28 -0700 |
commit | e3dbd0e049e96c30660155584d034d8b550f9063 (patch) | |
tree | f627211d00e82dbac0c0497da23e075f42bee729 /OpenSim/Server/Handlers | |
parent | Merged with origin, and resolved one conflict in LoginServiceTests.cs (diff) | |
download | opensim-SC_OLD-e3dbd0e049e96c30660155584d034d8b550f9063.zip opensim-SC_OLD-e3dbd0e049e96c30660155584d034d8b550f9063.tar.gz opensim-SC_OLD-e3dbd0e049e96c30660155584d034d8b550f9063.tar.bz2 opensim-SC_OLD-e3dbd0e049e96c30660155584d034d8b550f9063.tar.xz |
Added http handlers for the two new inventory operations.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 3354b84..c74c431 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | |||
@@ -85,6 +85,14 @@ namespace OpenSim.Server.Handlers.Inventory | |||
85 | "POST", "/GetInventory/", GetUserInventory, CheckAuthSession)); | 85 | "POST", "/GetInventory/", GetUserInventory, CheckAuthSession)); |
86 | 86 | ||
87 | m_httpServer.AddStreamHandler( | 87 | m_httpServer.AddStreamHandler( |
88 | new RestDeserialiseSecureHandler<Guid, Dictionary<AssetType, InventoryFolderBase>>( | ||
89 | "GET", "/SystemFolders/", GetSystemFolders, CheckAuthSession)); | ||
90 | |||
91 | m_httpServer.AddStreamHandler( | ||
92 | new RestDeserialiseSecureHandler<Guid, InventoryCollection>( | ||
93 | "POST", "/GetFolderContent/", GetFolderContent, CheckAuthSession)); | ||
94 | |||
95 | m_httpServer.AddStreamHandler( | ||
88 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( | 96 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( |
89 | "POST", "/UpdateFolder/", m_InventoryService.UpdateFolder, CheckAuthSession)); | 97 | "POST", "/UpdateFolder/", m_InventoryService.UpdateFolder, CheckAuthSession)); |
90 | 98 | ||
@@ -155,6 +163,40 @@ namespace OpenSim.Server.Handlers.Inventory | |||
155 | return m_InventoryService.GetUserInventory(userID); | 163 | return m_InventoryService.GetUserInventory(userID); |
156 | } | 164 | } |
157 | 165 | ||
166 | public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(Guid guid) | ||
167 | { | ||
168 | UUID userID = new UUID(guid); | ||
169 | return GetSystemFolders(userID); | ||
170 | } | ||
171 | |||
172 | // This shouldn't be here, it should be in the inventory service. | ||
173 | // But I don't want to deal with types and dependencies for now. | ||
174 | private Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | ||
175 | { | ||
176 | InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); | ||
177 | if (root != null) | ||
178 | { | ||
179 | InventoryCollection content = m_InventoryService.GetFolderContent(userID, root.ID); | ||
180 | if (content != null) | ||
181 | { | ||
182 | Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>(); | ||
183 | foreach (InventoryFolderBase folder in content.Folders) | ||
184 | { | ||
185 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | ||
186 | folders[(AssetType)folder.Type] = folder; | ||
187 | } | ||
188 | return folders; | ||
189 | } | ||
190 | } | ||
191 | m_log.WarnFormat("[INVENTORY SERVICE]: System folders for {0} not found", userID); | ||
192 | return new Dictionary<AssetType, InventoryFolderBase>(); | ||
193 | } | ||
194 | |||
195 | public InventoryCollection GetFolderContent(Guid guid) | ||
196 | { | ||
197 | return m_InventoryService.GetFolderContent(UUID.Zero, new UUID(guid)); | ||
198 | } | ||
199 | |||
158 | public List<InventoryItemBase> GetFolderItems(Guid folderID) | 200 | public List<InventoryItemBase> GetFolderItems(Guid folderID) |
159 | { | 201 | { |
160 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); | 202 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); |