Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 80

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
03/02/14 04:36 AM (10 years ago)

Please bear with me... Newbie with Data URL

Scenario... ---------------------- Started using the Checklist plugin. Sweet. Everything looks great. Plugging away at my data entry. Uh-oh... control panel says I have hit my limit of 300 items. Wait... there's physically only 147. Huh? Ok, I still have more data to go anyways... so let's nip this in the bud. Time to learn how to use the Data URL (been meaning to anyway)... read, read, read, read, smugs script, read, read, read, read.... ok, I think I can stumble my way through it. BANG! I was wrong. The Mission... ---------------------- Create a csv file for use with the checklist plugin, then use smugs child item creator to turn the csv into a .txt file that I can use in my data URL My attempt... ---------------------- A noticed that the existing item entries had 4 json entries, so I created my csv file with those columns... but wait... one of them is "ItemID". Doesn't that only get generated after it's added to the control panel? Maybe if I leave that blank it gets assigned by the CP? And what about the other things, like the categories, checklist titles, etc? Hmmmm.... time to post for help on the BT forum! Here is the json that I got... but like I said, the item ID is blank and no idea where to put the other stuff. Here's a sample: {"childItems":[{"itemId":"","itemType":"CR_ITEM","itemName":"Despicable Me","categoryGuid":"EBF6E4BC0C230389F4CF4D3"}, {"itemId":"","itemType":"CR_ITEM","itemName":"Disaster!","categoryGuid":"EBF6E4BC0C230389F4CF4D3"}, {"itemId":"","itemType":"CR_ITEM","itemName":"E.T. Adventure","categoryGuid":"EBF6E4BC0C230389F4CF4D3"}, I'm totally lost, lol. Could someone post like a 3 line sample of CSV rows that I would need? That way I can continue creating the CSV file, then when finished I can convert to JSON (I think I've got that part down). I don't need a fancy php script to handle it, just a plain JSON txt file is fine (I think). Or... since I only need like 50 more entries... is there a work around to the 300 item limit in the checklist plugin?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/02/14 04:58 AM (10 years ago)
you can make up the itemId… just make sure it's unique and different than any of the other childItems… If you're using excel or some other spreadsheet, you can just 'fill down' a sequence of numbers and that should do the trick. You'll also need to take care that you paste the correct 'categoryGuid' for each record/item. Cheers! -- Smug
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
03/02/14 05:00 AM (10 years ago)
Yeah... tried that. Still not working. My format isn't correct. Theres more fields than what I have... just not sure where they go. Even though my items in my CP only show those 4 fields, Chris1's example JSON on the plugins homepage shows many many more. Not sure how it all ties together :(
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/02/14 05:13 AM (10 years ago)
No, I see that now. It's a rather complex json childItem format… not typical. It allows multiple data types (checklists, items, and categories) to be stored in the same childItem file for easy plugin delivery, and it's parsed within the plugin. But that also means you may run to the limit sooner than expected, as is the case. Not sure what to do about that; you may need to call Chris for an executive session. Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/02/14 08:19 AM (10 years ago)
Yup - this is one of the most complicated plugins on the market from this perspective. (Fair amount of code to make the whole thing work too!). Frankly, my suggestion is to try your hand at the dataURL concept on a menu screen first until you're pretty comfortable with how the whole process works, then analyze the Json for the checklist plugin. Haven't used Smugs tool before, but it should work fine. The trick is how the child items cross reference each other in this plugin. https://buzz-tools.com
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
03/02/14 09:38 AM (10 years ago)
Lol, leave it to me to pick the hardest one that I could to learn on ;) Ok, I think I'll break up my checklists into a few different screen instances for now, so at least I'll be able to get all of my items accounted for, and tie them together with a nice little carrousel menu. Thanks for popping in on this one Chris :) Not sure if you seen my other checklist question yet... can the items be sorted? Alphabetically or otherwise?
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
03/02/14 10:45 AM (10 years ago)
Just for reference's sake, our The Big Game app had 30,000+ lines of JSON in the main BT_config.txt file. The app worked just fine on a real device such as iPhone 4S and iPhone 5. I should try on an iPhone 4 though. Yet for each minor update to the Control Panel resulted in a re-download and re-parse of the entire data set. I broke each major set of screens into their own data files and used dataURL to retrieve the information. Woosh! The main config file shrank to 3000 lines of JSON! ;-) I also modified my plugin to accept another parameter, localDataFileName. Now I can use data files that are stored within the bundle (in the Xcode project). That way the downloading of data for that screen can be avoided. That sidestepped the "loading" indicator that we all hate. I gave preference to dataURL so that I can always update a Screen's data via remote control, even if it originally had been fed by a Local File. That was a fun coding exercise and I learned a few more of the built-in "tools" within the BuzzTouch framework! -- Niraj
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
03/02/14 10:48 AM (10 years ago)
Thats a pretty cool approach Niraj. I like the idea of bundled data sets too. I have to be careful with my file size as well though... I've shrunk my images as far as I possibly can, only have the necessities bundled with the code (the rest reside online, but load quick due to small file size), and I'm not sure what the app will weigh in at, but I'm only about 1/2 to 3/4 the way done and my project folder is 100mb already. <eek!> I know the packaged version will be smaller, but only time will tell by how much.
 

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.