diff options
author | Diva Canto | 2010-01-31 11:10:57 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-31 11:10:57 -0800 |
commit | 40d8e91008b7d76ce6b9398484c591eb51c85bdb (patch) | |
tree | 7851807bee519bcae508f77e11107c7ed1e99ae9 /OpenSim/Services/InventoryService | |
parent | Added missing file. (diff) | |
download | opensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.zip opensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.tar.gz opensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.tar.bz2 opensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.tar.xz |
* Added a few files that were missing in the repo.
* New HGInventoryService which allows restricted access to inventory while outside
Diffstat (limited to 'OpenSim/Services/InventoryService')
-rw-r--r-- | OpenSim/Services/InventoryService/HGInventoryService.cs | 302 | ||||
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 50 |
2 files changed, 327 insertions, 25 deletions
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs new file mode 100644 index 0000000..85f3bfc --- /dev/null +++ b/OpenSim/Services/InventoryService/HGInventoryService.cs | |||
@@ -0,0 +1,302 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using System.Reflection; | ||
34 | using OpenSim.Services.Base; | ||
35 | using OpenSim.Services.Interfaces; | ||
36 | using OpenSim.Data; | ||
37 | using OpenSim.Framework; | ||
38 | |||
39 | namespace OpenSim.Services.InventoryService | ||
40 | { | ||
41 | public class HGInventoryService : XInventoryService, IInventoryService | ||
42 | { | ||
43 | private static readonly ILog m_log = | ||
44 | LogManager.GetLogger( | ||
45 | MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
47 | protected IXInventoryData m_Database; | ||
48 | |||
49 | public HGInventoryService(IConfigSource config) | ||
50 | : base(config) | ||
51 | { | ||
52 | string dllName = String.Empty; | ||
53 | string connString = String.Empty; | ||
54 | //string realm = "Inventory"; // OSG version doesn't use this | ||
55 | |||
56 | // | ||
57 | // Try reading the [DatabaseService] section, if it exists | ||
58 | // | ||
59 | IConfig dbConfig = config.Configs["DatabaseService"]; | ||
60 | if (dbConfig != null) | ||
61 | { | ||
62 | if (dllName == String.Empty) | ||
63 | dllName = dbConfig.GetString("StorageProvider", String.Empty); | ||
64 | if (connString == String.Empty) | ||
65 | connString = dbConfig.GetString("ConnectionString", String.Empty); | ||
66 | } | ||
67 | |||
68 | // | ||
69 | // Try reading the [InventoryService] section, if it exists | ||
70 | // | ||
71 | IConfig authConfig = config.Configs["InventoryService"]; | ||
72 | if (authConfig != null) | ||
73 | { | ||
74 | dllName = authConfig.GetString("StorageProvider", dllName); | ||
75 | connString = authConfig.GetString("ConnectionString", connString); | ||
76 | // realm = authConfig.GetString("Realm", realm); | ||
77 | } | ||
78 | |||
79 | // | ||
80 | // We tried, but this doesn't exist. We can't proceed. | ||
81 | // | ||
82 | if (dllName == String.Empty) | ||
83 | throw new Exception("No StorageProvider configured"); | ||
84 | |||
85 | m_Database = LoadPlugin<IXInventoryData>(dllName, | ||
86 | new Object[] {connString, String.Empty}); | ||
87 | if (m_Database == null) | ||
88 | throw new Exception("Could not find a storage interface in the given module"); | ||
89 | |||
90 | m_log.Debug("[HG INVENTORY SERVVICE]: Starting..."); | ||
91 | } | ||
92 | |||
93 | public override bool CreateUserInventory(UUID principalID) | ||
94 | { | ||
95 | // NOGO | ||
96 | return false; | ||
97 | } | ||
98 | |||
99 | |||
100 | public override List<InventoryFolderBase> GetInventorySkeleton(UUID principalID) | ||
101 | { | ||
102 | // NOGO for this inventory service | ||
103 | return new List<InventoryFolderBase>(); | ||
104 | } | ||
105 | |||
106 | public override InventoryFolderBase GetRootFolder(UUID principalID) | ||
107 | { | ||
108 | // Warp! Root folder for travelers | ||
109 | XInventoryFolder[] folders = m_Database.GetFolders( | ||
110 | new string[] { "agentID", "folderName"}, | ||
111 | new string[] { principalID.ToString(), "Suitcase" }); | ||
112 | |||
113 | if (folders.Length > 0) | ||
114 | return ConvertToOpenSim(folders[0]); | ||
115 | |||
116 | // make one | ||
117 | XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "Suitcase"); | ||
118 | return ConvertToOpenSim(suitcase); | ||
119 | } | ||
120 | |||
121 | //private bool CreateSystemFolders(UUID principalID, XInventoryFolder suitcase) | ||
122 | //{ | ||
123 | |||
124 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Animation, "Animations"); | ||
125 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Bodypart, "Body Parts"); | ||
126 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.CallingCard, "Calling Cards"); | ||
127 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Clothing, "Clothing"); | ||
128 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Gesture, "Gestures"); | ||
129 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Landmark, "Landmarks"); | ||
130 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.LostAndFoundFolder, "Lost And Found"); | ||
131 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Notecard, "Notecards"); | ||
132 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Object, "Objects"); | ||
133 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.SnapshotFolder, "Photo Album"); | ||
134 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.LSLText, "Scripts"); | ||
135 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Sound, "Sounds"); | ||
136 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.Texture, "Textures"); | ||
137 | // CreateFolder(principalID, suitcase.folderID, (int)AssetType.TrashFolder, "Trash"); | ||
138 | |||
139 | // return true; | ||
140 | //} | ||
141 | |||
142 | |||
143 | public override InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | ||
144 | { | ||
145 | return GetRootFolder(principalID); | ||
146 | } | ||
147 | |||
148 | // | ||
149 | // Use the inherited methods | ||
150 | // | ||
151 | //public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) | ||
152 | //{ | ||
153 | //} | ||
154 | |||
155 | //public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | ||
156 | //{ | ||
157 | //} | ||
158 | |||
159 | //public override bool AddFolder(InventoryFolderBase folder) | ||
160 | //{ | ||
161 | // // Check if it's under the Suitcase folder | ||
162 | // List<InventoryFolderBase> skel = base.GetInventorySkeleton(folder.Owner); | ||
163 | // InventoryFolderBase suitcase = GetRootFolder(folder.Owner); | ||
164 | // List<InventoryFolderBase> suitDescendents = GetDescendents(skel, suitcase.ID); | ||
165 | |||
166 | // foreach (InventoryFolderBase f in suitDescendents) | ||
167 | // if (folder.ParentID == f.ID) | ||
168 | // { | ||
169 | // XInventoryFolder xFolder = ConvertFromOpenSim(folder); | ||
170 | // return m_Database.StoreFolder(xFolder); | ||
171 | // } | ||
172 | // return false; | ||
173 | //} | ||
174 | |||
175 | private List<InventoryFolderBase> GetDescendents(List<InventoryFolderBase> lst, UUID root) | ||
176 | { | ||
177 | List<InventoryFolderBase> direct = lst.FindAll(delegate(InventoryFolderBase f) { return f.ParentID == root; }); | ||
178 | if (direct == null) | ||
179 | return new List<InventoryFolderBase>(); | ||
180 | |||
181 | List<InventoryFolderBase> indirect = new List<InventoryFolderBase>(); | ||
182 | foreach (InventoryFolderBase f in direct) | ||
183 | indirect.AddRange(GetDescendents(lst, f.ID)); | ||
184 | |||
185 | direct.AddRange(indirect); | ||
186 | return direct; | ||
187 | } | ||
188 | |||
189 | // Use inherited method | ||
190 | //public bool UpdateFolder(InventoryFolderBase folder) | ||
191 | //{ | ||
192 | //} | ||
193 | |||
194 | //public override bool MoveFolder(InventoryFolderBase folder) | ||
195 | //{ | ||
196 | // XInventoryFolder[] x = m_Database.GetFolders( | ||
197 | // new string[] { "folderID" }, | ||
198 | // new string[] { folder.ID.ToString() }); | ||
199 | |||
200 | // if (x.Length == 0) | ||
201 | // return false; | ||
202 | |||
203 | // // Check if it's under the Suitcase folder | ||
204 | // List<InventoryFolderBase> skel = base.GetInventorySkeleton(folder.Owner); | ||
205 | // InventoryFolderBase suitcase = GetRootFolder(folder.Owner); | ||
206 | // List<InventoryFolderBase> suitDescendents = GetDescendents(skel, suitcase.ID); | ||
207 | |||
208 | // foreach (InventoryFolderBase f in suitDescendents) | ||
209 | // if (folder.ParentID == f.ID) | ||
210 | // { | ||
211 | // x[0].parentFolderID = folder.ParentID; | ||
212 | // return m_Database.StoreFolder(x[0]); | ||
213 | // } | ||
214 | |||
215 | // return false; | ||
216 | //} | ||
217 | |||
218 | public override bool DeleteFolders(UUID principalID, List<UUID> folderIDs) | ||
219 | { | ||
220 | // NOGO | ||
221 | return false; | ||
222 | } | ||
223 | |||
224 | public override bool PurgeFolder(InventoryFolderBase folder) | ||
225 | { | ||
226 | // NOGO | ||
227 | return false; | ||
228 | } | ||
229 | |||
230 | // Unfortunately we need to use the inherited method because of how DeRez works. | ||
231 | // The viewer sends the folderID hard-wired in the derez message | ||
232 | //public override bool AddItem(InventoryItemBase item) | ||
233 | //{ | ||
234 | // // Check if it's under the Suitcase folder | ||
235 | // List<InventoryFolderBase> skel = base.GetInventorySkeleton(item.Owner); | ||
236 | // InventoryFolderBase suitcase = GetRootFolder(item.Owner); | ||
237 | // List<InventoryFolderBase> suitDescendents = GetDescendents(skel, suitcase.ID); | ||
238 | |||
239 | // foreach (InventoryFolderBase f in suitDescendents) | ||
240 | // if (item.Folder == f.ID) | ||
241 | // return m_Database.StoreItem(ConvertFromOpenSim(item)); | ||
242 | |||
243 | // return false; | ||
244 | //} | ||
245 | |||
246 | //public override bool UpdateItem(InventoryItemBase item) | ||
247 | //{ | ||
248 | // // Check if it's under the Suitcase folder | ||
249 | // List<InventoryFolderBase> skel = base.GetInventorySkeleton(item.Owner); | ||
250 | // InventoryFolderBase suitcase = GetRootFolder(item.Owner); | ||
251 | // List<InventoryFolderBase> suitDescendents = GetDescendents(skel, suitcase.ID); | ||
252 | |||
253 | // foreach (InventoryFolderBase f in suitDescendents) | ||
254 | // if (item.Folder == f.ID) | ||
255 | // return m_Database.StoreItem(ConvertFromOpenSim(item)); | ||
256 | |||
257 | // return false; | ||
258 | //} | ||
259 | |||
260 | //public override bool MoveItems(UUID principalID, List<InventoryItemBase> items) | ||
261 | //{ | ||
262 | // // Principal is b0rked. *sigh* | ||
263 | // // | ||
264 | // // Let's assume they all have the same principal | ||
265 | // // Check if it's under the Suitcase folder | ||
266 | // List<InventoryFolderBase> skel = base.GetInventorySkeleton(items[0].Owner); | ||
267 | // InventoryFolderBase suitcase = GetRootFolder(items[0].Owner); | ||
268 | // List<InventoryFolderBase> suitDescendents = GetDescendents(skel, suitcase.ID); | ||
269 | |||
270 | // foreach (InventoryItemBase i in items) | ||
271 | // { | ||
272 | // foreach (InventoryFolderBase f in suitDescendents) | ||
273 | // if (i.Folder == f.ID) | ||
274 | // m_Database.MoveItem(i.ID.ToString(), i.Folder.ToString()); | ||
275 | // } | ||
276 | |||
277 | // return true; | ||
278 | //} | ||
279 | |||
280 | // Let these pass. Use inherited methods. | ||
281 | //public bool DeleteItems(UUID principalID, List<UUID> itemIDs) | ||
282 | //{ | ||
283 | //} | ||
284 | |||
285 | //public InventoryItemBase GetItem(InventoryItemBase item) | ||
286 | //{ | ||
287 | //} | ||
288 | |||
289 | //public InventoryFolderBase GetFolder(InventoryFolderBase folder) | ||
290 | //{ | ||
291 | //} | ||
292 | |||
293 | //public List<InventoryItemBase> GetActiveGestures(UUID principalID) | ||
294 | //{ | ||
295 | //} | ||
296 | |||
297 | //public int GetAssetPermissions(UUID principalID, UUID assetID) | ||
298 | //{ | ||
299 | //} | ||
300 | |||
301 | } | ||
302 | } | ||
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 2c79c77..2fb6a56 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Services.InventoryService | |||
87 | throw new Exception("Could not find a storage interface in the given module"); | 87 | throw new Exception("Could not find a storage interface in the given module"); |
88 | } | 88 | } |
89 | 89 | ||
90 | public bool CreateUserInventory(UUID principalID) | 90 | public virtual bool CreateUserInventory(UUID principalID) |
91 | { | 91 | { |
92 | // This is braindeaad. We can't ever communicate that we fixed | 92 | // This is braindeaad. We can't ever communicate that we fixed |
93 | // an existing inventory. Well, just return root folder status, | 93 | // an existing inventory. Well, just return root folder status, |
@@ -137,7 +137,7 @@ namespace OpenSim.Services.InventoryService | |||
137 | return result; | 137 | return result; |
138 | } | 138 | } |
139 | 139 | ||
140 | private XInventoryFolder CreateFolder(UUID principalID, UUID parentID, int type, string name) | 140 | protected XInventoryFolder CreateFolder(UUID principalID, UUID parentID, int type, string name) |
141 | { | 141 | { |
142 | XInventoryFolder newFolder = new XInventoryFolder(); | 142 | XInventoryFolder newFolder = new XInventoryFolder(); |
143 | 143 | ||
@@ -153,7 +153,7 @@ namespace OpenSim.Services.InventoryService | |||
153 | return newFolder; | 153 | return newFolder; |
154 | } | 154 | } |
155 | 155 | ||
156 | private XInventoryFolder[] GetSystemFolders(UUID principalID) | 156 | protected virtual XInventoryFolder[] GetSystemFolders(UUID principalID) |
157 | { | 157 | { |
158 | XInventoryFolder[] allFolders = m_Database.GetFolders( | 158 | XInventoryFolder[] allFolders = m_Database.GetFolders( |
159 | new string[] { "agentID" }, | 159 | new string[] { "agentID" }, |
@@ -171,7 +171,7 @@ namespace OpenSim.Services.InventoryService | |||
171 | return sysFolders; | 171 | return sysFolders; |
172 | } | 172 | } |
173 | 173 | ||
174 | public List<InventoryFolderBase> GetInventorySkeleton(UUID principalID) | 174 | public virtual List<InventoryFolderBase> GetInventorySkeleton(UUID principalID) |
175 | { | 175 | { |
176 | XInventoryFolder[] allFolders = m_Database.GetFolders( | 176 | XInventoryFolder[] allFolders = m_Database.GetFolders( |
177 | new string[] { "agentID" }, | 177 | new string[] { "agentID" }, |
@@ -191,7 +191,7 @@ namespace OpenSim.Services.InventoryService | |||
191 | return folders; | 191 | return folders; |
192 | } | 192 | } |
193 | 193 | ||
194 | public InventoryFolderBase GetRootFolder(UUID principalID) | 194 | public virtual InventoryFolderBase GetRootFolder(UUID principalID) |
195 | { | 195 | { |
196 | XInventoryFolder[] folders = m_Database.GetFolders( | 196 | XInventoryFolder[] folders = m_Database.GetFolders( |
197 | new string[] { "agentID", "parentFolderID"}, | 197 | new string[] { "agentID", "parentFolderID"}, |
@@ -203,7 +203,7 @@ namespace OpenSim.Services.InventoryService | |||
203 | return ConvertToOpenSim(folders[0]); | 203 | return ConvertToOpenSim(folders[0]); |
204 | } | 204 | } |
205 | 205 | ||
206 | public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 206 | public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) |
207 | { | 207 | { |
208 | XInventoryFolder[] folders = m_Database.GetFolders( | 208 | XInventoryFolder[] folders = m_Database.GetFolders( |
209 | new string[] { "agentID", "type"}, | 209 | new string[] { "agentID", "type"}, |
@@ -215,7 +215,7 @@ namespace OpenSim.Services.InventoryService | |||
215 | return ConvertToOpenSim(folders[0]); | 215 | return ConvertToOpenSim(folders[0]); |
216 | } | 216 | } |
217 | 217 | ||
218 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) | 218 | public virtual InventoryCollection GetFolderContent(UUID principalID, UUID folderID) |
219 | { | 219 | { |
220 | // This method doesn't receive a valud principal id from the | 220 | // This method doesn't receive a valud principal id from the |
221 | // connector. So we disregard the principal and look | 221 | // connector. So we disregard the principal and look |
@@ -250,7 +250,7 @@ namespace OpenSim.Services.InventoryService | |||
250 | return inventory; | 250 | return inventory; |
251 | } | 251 | } |
252 | 252 | ||
253 | public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | 253 | public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) |
254 | { | 254 | { |
255 | // Since we probably don't get a valid principal here, either ... | 255 | // Since we probably don't get a valid principal here, either ... |
256 | // | 256 | // |
@@ -266,18 +266,18 @@ namespace OpenSim.Services.InventoryService | |||
266 | return invItems; | 266 | return invItems; |
267 | } | 267 | } |
268 | 268 | ||
269 | public bool AddFolder(InventoryFolderBase folder) | 269 | public virtual bool AddFolder(InventoryFolderBase folder) |
270 | { | 270 | { |
271 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); | 271 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); |
272 | return m_Database.StoreFolder(xFolder); | 272 | return m_Database.StoreFolder(xFolder); |
273 | } | 273 | } |
274 | 274 | ||
275 | public bool UpdateFolder(InventoryFolderBase folder) | 275 | public virtual bool UpdateFolder(InventoryFolderBase folder) |
276 | { | 276 | { |
277 | return AddFolder(folder); | 277 | return AddFolder(folder); |
278 | } | 278 | } |
279 | 279 | ||
280 | public bool MoveFolder(InventoryFolderBase folder) | 280 | public virtual bool MoveFolder(InventoryFolderBase folder) |
281 | { | 281 | { |
282 | XInventoryFolder[] x = m_Database.GetFolders( | 282 | XInventoryFolder[] x = m_Database.GetFolders( |
283 | new string[] { "folderID" }, | 283 | new string[] { "folderID" }, |
@@ -293,7 +293,7 @@ namespace OpenSim.Services.InventoryService | |||
293 | 293 | ||
294 | // We don't check the principal's ID here | 294 | // We don't check the principal's ID here |
295 | // | 295 | // |
296 | public bool DeleteFolders(UUID principalID, List<UUID> folderIDs) | 296 | public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) |
297 | { | 297 | { |
298 | // Ignore principal ID, it's bogus at connector level | 298 | // Ignore principal ID, it's bogus at connector level |
299 | // | 299 | // |
@@ -308,7 +308,7 @@ namespace OpenSim.Services.InventoryService | |||
308 | return true; | 308 | return true; |
309 | } | 309 | } |
310 | 310 | ||
311 | public bool PurgeFolder(InventoryFolderBase folder) | 311 | public virtual bool PurgeFolder(InventoryFolderBase folder) |
312 | { | 312 | { |
313 | XInventoryFolder[] subFolders = m_Database.GetFolders( | 313 | XInventoryFolder[] subFolders = m_Database.GetFolders( |
314 | new string[] { "parentFolderID" }, | 314 | new string[] { "parentFolderID" }, |
@@ -325,17 +325,17 @@ namespace OpenSim.Services.InventoryService | |||
325 | return true; | 325 | return true; |
326 | } | 326 | } |
327 | 327 | ||
328 | public bool AddItem(InventoryItemBase item) | 328 | public virtual bool AddItem(InventoryItemBase item) |
329 | { | 329 | { |
330 | return m_Database.StoreItem(ConvertFromOpenSim(item)); | 330 | return m_Database.StoreItem(ConvertFromOpenSim(item)); |
331 | } | 331 | } |
332 | 332 | ||
333 | public bool UpdateItem(InventoryItemBase item) | 333 | public virtual bool UpdateItem(InventoryItemBase item) |
334 | { | 334 | { |
335 | return m_Database.StoreItem(ConvertFromOpenSim(item)); | 335 | return m_Database.StoreItem(ConvertFromOpenSim(item)); |
336 | } | 336 | } |
337 | 337 | ||
338 | public bool MoveItems(UUID principalID, List<InventoryItemBase> items) | 338 | public virtual bool MoveItems(UUID principalID, List<InventoryItemBase> items) |
339 | { | 339 | { |
340 | // Principal is b0rked. *sigh* | 340 | // Principal is b0rked. *sigh* |
341 | // | 341 | // |
@@ -347,7 +347,7 @@ namespace OpenSim.Services.InventoryService | |||
347 | return true; | 347 | return true; |
348 | } | 348 | } |
349 | 349 | ||
350 | public bool DeleteItems(UUID principalID, List<UUID> itemIDs) | 350 | public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) |
351 | { | 351 | { |
352 | // Just use the ID... *facepalms* | 352 | // Just use the ID... *facepalms* |
353 | // | 353 | // |
@@ -357,7 +357,7 @@ namespace OpenSim.Services.InventoryService | |||
357 | return true; | 357 | return true; |
358 | } | 358 | } |
359 | 359 | ||
360 | public InventoryItemBase GetItem(InventoryItemBase item) | 360 | public virtual InventoryItemBase GetItem(InventoryItemBase item) |
361 | { | 361 | { |
362 | XInventoryItem[] items = m_Database.GetItems( | 362 | XInventoryItem[] items = m_Database.GetItems( |
363 | new string[] { "inventoryID" }, | 363 | new string[] { "inventoryID" }, |
@@ -369,7 +369,7 @@ namespace OpenSim.Services.InventoryService | |||
369 | return ConvertToOpenSim(items[0]); | 369 | return ConvertToOpenSim(items[0]); |
370 | } | 370 | } |
371 | 371 | ||
372 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 372 | public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) |
373 | { | 373 | { |
374 | XInventoryFolder[] folders = m_Database.GetFolders( | 374 | XInventoryFolder[] folders = m_Database.GetFolders( |
375 | new string[] { "folderID"}, | 375 | new string[] { "folderID"}, |
@@ -381,7 +381,7 @@ namespace OpenSim.Services.InventoryService | |||
381 | return ConvertToOpenSim(folders[0]); | 381 | return ConvertToOpenSim(folders[0]); |
382 | } | 382 | } |
383 | 383 | ||
384 | public List<InventoryItemBase> GetActiveGestures(UUID principalID) | 384 | public virtual List<InventoryItemBase> GetActiveGestures(UUID principalID) |
385 | { | 385 | { |
386 | XInventoryItem[] items = m_Database.GetActiveGestures(principalID); | 386 | XInventoryItem[] items = m_Database.GetActiveGestures(principalID); |
387 | 387 | ||
@@ -396,7 +396,7 @@ namespace OpenSim.Services.InventoryService | |||
396 | return ret; | 396 | return ret; |
397 | } | 397 | } |
398 | 398 | ||
399 | public int GetAssetPermissions(UUID principalID, UUID assetID) | 399 | public virtual int GetAssetPermissions(UUID principalID, UUID assetID) |
400 | { | 400 | { |
401 | return m_Database.GetAssetPermissions(principalID, assetID); | 401 | return m_Database.GetAssetPermissions(principalID, assetID); |
402 | } | 402 | } |
@@ -421,7 +421,7 @@ namespace OpenSim.Services.InventoryService | |||
421 | 421 | ||
422 | // CM Helpers | 422 | // CM Helpers |
423 | // | 423 | // |
424 | private InventoryFolderBase ConvertToOpenSim(XInventoryFolder folder) | 424 | protected InventoryFolderBase ConvertToOpenSim(XInventoryFolder folder) |
425 | { | 425 | { |
426 | InventoryFolderBase newFolder = new InventoryFolderBase(); | 426 | InventoryFolderBase newFolder = new InventoryFolderBase(); |
427 | 427 | ||
@@ -435,7 +435,7 @@ namespace OpenSim.Services.InventoryService | |||
435 | return newFolder; | 435 | return newFolder; |
436 | } | 436 | } |
437 | 437 | ||
438 | private XInventoryFolder ConvertFromOpenSim(InventoryFolderBase folder) | 438 | protected XInventoryFolder ConvertFromOpenSim(InventoryFolderBase folder) |
439 | { | 439 | { |
440 | XInventoryFolder newFolder = new XInventoryFolder(); | 440 | XInventoryFolder newFolder = new XInventoryFolder(); |
441 | 441 | ||
@@ -449,7 +449,7 @@ namespace OpenSim.Services.InventoryService | |||
449 | return newFolder; | 449 | return newFolder; |
450 | } | 450 | } |
451 | 451 | ||
452 | private InventoryItemBase ConvertToOpenSim(XInventoryItem item) | 452 | protected InventoryItemBase ConvertToOpenSim(XInventoryItem item) |
453 | { | 453 | { |
454 | InventoryItemBase newItem = new InventoryItemBase(); | 454 | InventoryItemBase newItem = new InventoryItemBase(); |
455 | 455 | ||
@@ -477,7 +477,7 @@ namespace OpenSim.Services.InventoryService | |||
477 | return newItem; | 477 | return newItem; |
478 | } | 478 | } |
479 | 479 | ||
480 | private XInventoryItem ConvertFromOpenSim(InventoryItemBase item) | 480 | protected XInventoryItem ConvertFromOpenSim(InventoryItemBase item) |
481 | { | 481 | { |
482 | XInventoryItem newItem = new XInventoryItem(); | 482 | XInventoryItem newItem = new XInventoryItem(); |
483 | 483 | ||