jsonB - JSON Browser App For iOS




What is jsonB ?


jsonB is a JSON Browser for iOS, an app for retrieving, presenting and traversing JSON dataset downloaded from any web server in the cloud. jsonB can interact with any "JSON over Http web service", including REST service.

The UI and user experience can be enriched using a JSON MetaData file following the minimapp data structure.

Compatible with iPhone, iPad and iPod.

jsonB


How does this work? Hello World


     
  1. Touch the Organize icon on the right in the top bar
  2. Touch The New Dataset option
  3. Enter the Name of the dataset,
  4. Enter The url that will return the JSON data
  5. Enter The url that will return the JSON metadata
  6. Touch the Ok button
  7. The JSON data is downloaded and stored locally
  8. You can now browse the data


Vegetable Catalog


Here is a jsonB dataset, interacting with a rest service in the cloud to pass orders.
The url http://fredericaltorres.jsonbdemos.jit.su/vegetables/data returns the data.
The url http://fredericaltorres.jsonbdemos.jit.su/vegetables/metadata returns the Metadata.


Json MetaData Commented

                                     {
                                        "Caption"       : "{{name}}", /* Template defining the caption of the object */
                                        "IDProperty"    : "name",     /* The property to use as the identifier       */
                                                                      /* The sections and the properties order. The character @ define section, the character # define an action to use as a button */
                                        "DisplayOrder"  : "name,Quantity,Unit,@Order,QuantityRequested,OrderID,OrderDate,DeviceID,#Order,@Product Information,Description,WebSite",
                                        "Sort"			: "name",     /* The property to use to sort the objects                            */
                                        "GroupBy"       : null,       /* The property to use to group the object into sections               */
                                        "NewProperties"	: [           /* Properties to add the first time or each time the object is opened */
                                                                    {
                                                                        "Name"			: "QuantityRequested",
                                                                        "Value"			: 0,
                                                                        "AutoReset"		: true /* Re initialize the value each time the dialog is opened */
                                                                    },
                                                                    {
                                                                        "Name"			: "DeviceName",
                                                                        "Value"			: "$DeviceName" /* $DeviceName macro        */
                                                                    },
                                                                    {
                                                                        "Name"			: "DeviceID",
                                                                        "Value"			: "$DeviceID"   /* $DeviceID macro          */
                                                                    },
                                                                    {
                                                                        "Name"			: "OrderDate",
                                                                        "Value"			: "$Now",       /* $Now macro               */
                                                                        "AutoReset"		: true
                                                                    },
                                                                    {
                                                                        "Name"			: "OrderID",
                                                                        "Value"			: "$Guid",      /* $Guid macro              */
                                                                        "AutoReset"		: true
                                                                    },
                                                                    {
                                                                        "Name"			: "WebSite",    /* Link to a website page   */
                                                                        "Value"			: "http://www.freebase.com/view/en/{{name.lower()}}"
                                                                    }
                                        ],
                                        "Actions"       : [
                                                                    {
                                                                        "Name"			: "Order",      /* Name of the action                       */
                                                                        "Type"          : "Button",     /* Button, ActionSheet(Default)             */
                                                                        "Method"		: "Post",       /* Http (Post, Get, Delete, Put) or EMail   */
                                                                        "Url"			: "http://fredericaltorres.jsonbdemos.jit.su/vegetables/update",
                                                                        "Parameters"	: "name={{name}}&QuantityRequested={{QuantityRequested}}&DeviceName={{DeviceName}}&DeviceID={{DeviceID}}&OrderID={{OrderID}}&OrderDate={{OrderDate}}",
                                                                        "ContentType"	: "application/x-www-form-urlencoded",
                                                                        "AutoPop"		: true,         /* Pop up back to the parent after the action is completed      */
                                                                        "AutoReload"    : "Data",       /* Reload after the action is completed: Data, MetaData, All.   */
                                                                        "Success"		: "{{QuantityRequested}} {{name}} ordered", /* Message to display after the action is completed successfully  */
                                                                        "Failure" 		: "Order failed"/* Message to display after the action failed                   */
                                                                    }
                                        ],
                                        "Properties"    : [     /* More info about the properties of the object */
                                                                    { "Name" : "name", 				"Attr":"READONLY", 	"Caption":"Name"				     },
                                                                    { "Name" : "Quantity", 			"Attr":"READONLY" 									     },
                                                                    { "Name" : "QuantityRequested", "Attr":"EDITABLE", 	"Range":[0, 100] 				     },
                                                                    { "Name" : "OrderDate", 		"Attr":"DATE", 		"Format":"MM/DD/YYYY HH:mm:SS" 	     },
                                                                    { "Name" : "WebSite", 			"Attr":"HTML", 		"Caption":"WebSite about {{name}}"   }
                                        ]
                                    }

                            

Patient Visits


Here is a jsonB dataset, interacting with a rest service in the cloud allowing to get a list of scheduled patient visits and to comminicate to the server the new visit's status (scheduled, started, done).

The url http://fredericaltorres.jsonbdemos.jit.su/patientvisits/data returns the data.
The url http://fredericaltorres.jsonbdemos.jit.su/patientvisits/metadata returns the Metadata.


Json MetaData Commented

{
    "Caption"             : "{{PatientName}} - {{VisitStatus}}", /* Template defining the caption of the object */
    "IDProperty"          : "ID",                                /* The property to use as the identifier       */
                                                                  /* The sections and the properties order.      */
    "DisplayOrder"        : "Sexe,Age,@Visit,ScheduledTime,StartTime,EndTime,VisitStatus,@Address,Address,Location",
    "Sort"			   	   : "ScheduledTime",                     /* The property to use to sort the objects     */
    "NewProperties"	   : [                                    /* Properties to add the first time or each time the dialog is opened */
                                {
                                    "Name"			: "StartTime",/* Set this property with the current time */
                                    "Value"			: "$Now",     /* the first time the object is displayed  */
                                    "AutoReset"		: false
                                },
                                {
                                    "Name"			: "EndTime",/* Set this property with the current time */
                                    "Value"			: "$Now",   /* every time the object is displayed      */
                                    "AutoReset"		: true
                                }
          
                             ],
    "Actions"             : [
                                {
                                    "Name"			      : "Start",                        /* Name of the action                     */
                                    "Visible"             : "$.VisitStatus=='Scheduled'",   /* Rule defining if the button is visible */
                                    "Method"		      : "Post",                         /* Http method                            */
                                    "Url"			      : "http://fredericaltorres.jsonbdemos.jit.su/patientvisits/update", /* Url  */
                                                                                            /* Http post body                         */
                                    "Parameters"	      : "ID={{ID}}&StartTime={{StartTime}}&EndTime={{EndTime}}&VisitStatus=Started", 
                                    "ContentType"	      : "application/x-www-form-urlencoded", /* Expected content type                                         */
                                    "AutoPop"		      : true,                                /* Pop up back to the parent after the action is completed       */
                                    "AutoReload"          : "Data",                              /* Reload after the action is completed                          */
                                    "Success"		      : null,                                /* Message to display after the action is completed successfully */
                                    "Failure" 		      : "Operation Failed\n{{$HttpResponse}}"/* Message to display after the action failed                    */
                                 }, 
                                 {
                                    "Name"			      : "Done",
                                    "Visible"             : "$.VisitStatus=='Started'",
                                    "Method"		      : "Post",
                                    "Url"			      : "http://fredericaltorres.jsonbdemos.jit.su/patientvisits/update",
                                    "Parameters"	      : "ID={{ID}}&StartTime={{StartTime}}&EndTime={{EndTime}}&VisitStatus=Done",
                                    "ContentType"	      : "application/x-www-form-urlencoded",
                                    "AutoPop"		      : true,
                                    "AutoReload"          : "Data", 
                                    "Success"		      : null,
                                    "Failure" 		      : "Operation Failed\n{{$HttpResponse}}"
                                } 
                             ],
    "Properties" :         [        /* More info about the properties of the object */
                                    { "Name":"ScheduledTime",   "Attr":",DATE", "Format": "DAY DD-MM HH:mm"  },
                                    { "Name":"StartTime",       "Attr":"DATE",  "Format": "DAY DD-MM HH:mm" },
                                    { "Name":"EndTime",         "Attr":"DATE",  "Format": "DAY DD-MM HH:mm"  },
                                    { "Name":"Sexe",            "Attr":"EDITABLE,MONOSELECT", "Values":["Male", "Female"] },
                                    { "Name":"Phone",           "Attr":"PHONE" },
                                    { "Name":"Location",        "Attr":"GEOLOCATION", "Caption":"Map" },
                                    { "Name":"Comment",         "Attr":"EDITABLE" },
                                    { "Name":"VisitStatus",     "Attr":"READONLY", "Caption":"Status" }
                            ]
}