I am working on a project which requires me to export the data contained in several TVs into a single table with several fields. This might also become a bounty (if I manage to sell this to the client) to develop a module to automate such an export (not immediate need but I try to look forward...). I’ll also probably need to work on importing custom DB tables into TVs but let’s talk about this later
This will take some work from me as I am not a MySQL wizard (though I have started toying more and more with MySQL, importing data from other systems and custom tables into modx_site_content with success), and
before I start I’d like either some feedback from people who did it and possibly advice about the process.
I am surprised this has never has been raised (or at last, I didn’t find the threads !)
The first thing I plan to do is graphically "map" the fields I need in the custom DB table to the MODx fields which contains the data. Of course, given the way TVs are stored, it will mean mapping fields from several tables (modx_site_content, modx_site_tmplvar_contentvalues for content, and ) with fields from a single table with each field representing a TV.
From modx_site_tmplvar_contentvalues, I need those fields :
tmplvarid -> that’s the value I need to tie TVs to the fields I’ll create in the custom table
contentid -> that’s the value I need to tie modx_site_tmplvar_contentvalues to modx_site_content
value -> that’s the content I’ll need to move from TVs to the fields I’ll create in the custom table
From modx_site_content, I need those fields :
id -> that’s the value I need to tie modx_site_content to modx_site_tmplvar_contentvalues
pagetitle -> that’s the content I’ll need to import into the title field of my custom table
parent -> that’s the field I’ll need to sort which documents I need to "extract" from the MODx DB
content -> not used in my case, all the data I need is stored in TVs.