Import JSON file, not cut and paste in UI


#1

I have been generating bpml files (XML format) using Python. I have metadata stores that I use to generate screen mockups (I am talking about large numbers of forms, 100+ ).

I have to switch to v3 to avail of features not available in older versions.I have switched to generating JSON dictionaries, but have not found a way to import the JSON but for the cut and paste in the UI import menu. This is not a viable option.

Do you have plan and a timeline for allowing the programmatic import of JSON dictionaries?

Thank


#2

Hi @yvesdotcoupezatpolar, we don’t have a command-line way to import JSON files. Can you please tell me more about what your end goal is? Do you want people to import your JSONs in existing projects or just open them and view them? Maybe you could generate an entire BMPR file instead of multiple JSON files?


#3

The objective is to create BMPR files for viewing. The system is entirely metadata driven. The mockups are used to visualise the data structure hierarchies as well as the forms used to view/enter the data. One run of the generator creates about a 100+ mockup (.bmml - XML) files that the users/implementors can use as a base line.

In moving to v3 I need to somehow achieve the same result: a number of mockus that can be viewed individually.

You say: “Maybe you could generate an entire BMPR file instead of multiple JSON files”. I have not seen a reference to the BMPR file structure. Is it possible to create a BMPR (other that using Balsamiq)?


#4

Hi again. We haven’t published the spec for the BMPR format yet because it’s still a bit in flux (we’re adding features pretty quickly these days) but you should be able to generate a BMPR pretty easily anyways.

The format is based on SQLlite: try opening any bmpr files with a sqllite viewer and you’ll see the internal format, it’s only a few tables. Let us know if it’s not self-explanatory enough and we’ll try to help!


#5

Ok. Go the idea.

At 5,000 feet level dumping the JSON structure in the DATA of RESOURCES table where BRANCHID=Master should do the trick.

A bit of a learning curve to create SQLLite structures - “Old way” was simpler

Thanks for your help


#6

ps: any chance of getting the “Create Table” statements?


Balsamiq format
#7

These might change in the future, but for right now, these should work:

CREATE TABLE INFO (NAME VARCHAR(255) PRIMARY KEY, VALUE TEXT);
CREATE TABLE BRANCHES (ID VARCHAR(255) PRIMARY KEY, ATTRIBUTES TEXT);
CREATE TABLE RESOURCES (ID VARCHAR(255), BRANCHID VARCHAR(255), ATTRIBUTES TEXT, DATA LONGTEXT, PRIMARY KEY (ID, BRANCHID), FOREIGN KEY (BRANCHID) REFERENCES BRANCHES(ID));
CREATE TABLE THUMBNAILS (ID VARCHAR(255) PRIMARY KEY, ATTRIBUTES MEDIUMTEXT);
INSERT INTO BRANCHES (ID, ATTRIBUTES) VALUES ("Master", "{}");
INSERT INTO INFO (NAME, VALUE) VALUES ("SchemaVersion", "1.2"), ("ArchiveRevision", "0"), ("ArchiveFormat", "bmpr"), ("ArchiveRevisionUUID", "");