Convert uComponents MultiNodeTreePicker data from csv to xml
hi
i have about 1000 documents which have a property which uses the uComponents MultiNodeTreePicker with CSV data format.
what i would like to do, for consistency with other document types, is convert from csv to xml.
i am happy to add a new property to help with this, but i was hoping someone might have a bit of code lying around which will help me to transform from csv to xml.
i am under the cosh time-wise so would appreciate any help, sql, .net anything would be great.
I would have thoght that the easiest way to do this would be a SQL script to chnage the format of the data, followed by a site republish to regenerate the XML file so the data is in the new format. I'm guessing you may need to update a few macros as well to account for the new format!
I'm not 100% on the exact query that you'd need to write, but the tables that you're interested in are cmsPropertyType and cmsPropertyData. The second contains the actual property data. It goes without saying that you should take a copy of your database and test this on the copy of the database rather than doing this kid of thing directly on the live database!
You can use the cmsPropertyType table to find the properties to change by their alias, and then join that to the cmsPropertyData table to get the value that you'll need to replace.
Convert uComponents MultiNodeTreePicker data from csv to xml
hi
i have about 1000 documents which have a property which uses the uComponents MultiNodeTreePicker with CSV data format.
what i would like to do, for consistency with other document types, is convert from csv to xml.
i am happy to add a new property to help with this, but i was hoping someone might have a bit of code lying around which will help me to transform from csv to xml.
i am under the cosh time-wise so would appreciate any help, sql, .net anything would be great.
thanks
I would have thoght that the easiest way to do this would be a SQL script to chnage the format of the data, followed by a site republish to regenerate the XML file so the data is in the new format. I'm guessing you may need to update a few macros as well to account for the new format!
I'm not 100% on the exact query that you'd need to write, but the tables that you're interested in are cmsPropertyType and cmsPropertyData. The second contains the actual property data. It goes without saying that you should take a copy of your database and test this on the copy of the database rather than doing this kid of thing directly on the live database!
You can use the cmsPropertyType table to find the properties to change by their alias, and then join that to the cmsPropertyData table to get the value that you'll need to replace.
Hope that helps!
thanks Tim, i may have to try something like that.
In the meantime, i have cobbled together the following [DOES NOT WORK!]
i am not a coder and cannot work out why this does not work, or what i should do - can anyone help??
{{{DocumentType dt = DocumentType.GetByAlias("DocumentXXX");{var sectorFilterCSV = doc.getProperty("sectorFilter").ToString();string[] splitCSV = sectorFilterCSV.Split(',');{doc.getProperty("sectorFilterXML").Value = sectorFilterXML;Finally, managed to find various posts/code/etc that helped with this.
the code i ended up with, which did work for me is:
{{{var type = DocumentType.GetByAlias("Document");{var sectorFilterCSV = content.getProperty("sectorFilter").Value.ToString();string[] splitCSV = sectorFilterCSV.Split(',');{content.getProperty("sectorFilterXML").Value = sectorFilterXML.ToString();content.getProperty("test").Value = sectorFilterXML.ToString();is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.