This is what I wrote to Gus earlier for those that stumbled on this page: The first step, IMO, is to examine the DMX data model and get to grips with it. The central table is DMX_Entries. This is where all folders and files are stored (that is: their metadata). There are 3 important columns that govern the tree structure: EntryId, which is the auto incremented ID field of the record, (2) CollectionId, which points to the EntryId of the parent record, and (3) LastVersionId which points to the EntryId of the last version of this record. Note there is a trigger on this table to ensure its consistency. Notably it governs LastModified, Path (which is a string with EntryIds leading to this entry) and FileSize which for folders is the size of content below. Second thing to note is that Entry stores the "key" to the actual file. If you're using the file based storage (StorageProviderID=1) then it is a relative path to the file. Most other fields are self-explanatory. Once you've gotten to grips with DMX_Entries there are a number of satellite tables to consider. The most important is DMX_EntryPermissions. This governs permissions. It either binds an entry to a role ID or a user ID. It works just like DNN's module/tab permissions.
|