Discussion Forums  >  Self Hosted Control Panels

Replies: 12    Views: 170

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
12/28/13 12:59 AM (11 years ago)

Json childItem creator script available. And free.

Available in Mr. VanBeveren's marketplace: https://buzztouchmods.com/market.php The Smug Json childItem File creator. Backstory: for an upcoming plugin I'm designing, I'm not going to use childItems 'in the control panel'. A developer must supply their own childItem file, either by database connection or by file. I scoured the net for a cool csv to json utility, and found that Shan Carter had created this really slick open source csv to json converter. I modified it to include the 'childItem:{}' json to make it BT friendly, and to act nice within the BT Self Hosted environment. Thanks to David VanBeveren for stress testing it for me. He copied and pasted thousands of records from an excel spreadsheet, and other than a noticable delay, it performed flawlessly. Merely paste your data into the text box, and it will convert it into BT Friendly json ChildItem files. Copy and paste that into an empty text file, and you have your childItems all ready to go online or in the bundle. It's free, handy, and available for download at David's place. If you have questions, read the read me. If you still have questions, read the read me again. If you *still* have questions, then I'll try and help. Cheers! -- Smug Kind regards to David VanBeveren for hosting the mod :)
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
12/28/13 09:25 AM (11 years ago)
Thanks Smug Thanks David
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
12/28/13 10:36 AM (11 years ago)
Cool. Can you share what's the primary reason for not letting child items be created through the control panel? (or is it top-secret until your plugin is released?)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/28/13 02:58 PM (11 years ago)
Chris, Nothing Top Secret about it. I'm just tired of typing in childItems in a control panel, when I can use a childItem file that's easy to manipulate, update, alter etc... Things are easier to change outside of the control panel. It's just my opinion. Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
12/28/13 03:36 PM (11 years ago)
ah.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/28/13 09:27 PM (11 years ago)
Amen -- keystrokes and search-replace beat mouse movements any day of the week! Thank you, Smug! I assume the rendered JSON can then be copied-pasted into the JSON section of a plugin? -- Niraj
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/28/13 10:21 PM (11 years ago)
It can be placed anywhere childItems are used. :) The output is in the form of: {"childItems":[ (your child items here) ] } And the childItems can be anything; you basically just need the first row to be your json/db fieldnames, and then each row of data. There is sample data available 'built into the page' and can be accessed by a link so you can see what it wants and what it does. Cheers! -- Smug
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/10/14 04:01 PM (11 years ago)
For those who want to simply use this converter on their own Computer, here are the steps to bypass the need for a server-based PHP: 1. Follow the read me (you're reading this right?!) 2. Change sjcon.php to sjcon.html filename 3. Double-click on sjcon.html to start using the Converter! Next time we will try to optimize the installation by reducing the quantity of steps by 33%. Where else can you get service with a smile with less hassle? :-) Thank you Smug for letting us stand on your shoulders! -- Niraj
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/10/14 04:25 PM (11 years ago)
Just don't wear your golf or baseball shoes :) Cheers! -- Smug
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/22/14 09:27 PM (11 years ago)
Hey Smug -- Using your built-in sample data within the tool, the numbers were not surrounded by quotes. Do you get the same effect? Such an example is: Wrong (as generated by the utility): "itemId" : 50 Right: "itemId" : "50" ---------------- However, if I change any other field to a number, it gets surrounded by quotes. Also, if I change itemId to be an alphanumeric string, then the Tool surrounds it with quotes. I looked briefly at the converter.js file and could not find any hard-coding for itemId.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/22/14 09:42 PM (11 years ago)
Hmm… I'll take a look. What's happening is it's turning numbers into json integers. It's probably by design, but I'll see if I can't figure out where it does that and make a change. I'll let you know what comes of it. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/22/14 11:21 PM (11 years ago)
Hey Niraj, I found the correct place in code, and made the changes. 'everything' gets returned as a string now, the way it should be. new link same as the old link; just replace what you've got, or if you're just going to replace one file, make sure 'DataGridRenderer.js' is the file you update. https://dl.dropboxusercontent.com/u/115208762/sjcon.zip Cheers! -- Smug
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/23/14 01:39 AM (11 years ago)
Yeehaw! Thanks a bunch, Smug! Happy man makes for a happy day :-) -- Niraj
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.