Page Content Definition
Parsing the content definition start with the type key :
There are 4 macro categories :
text
{ type:"text", txt:"base64 encoded" }
name | type | description |
---|---|---|
type | string | text |
txt | string | base64 encoded string |
site
{ type:"site", url:"link url", open:"inside|outside" }
name | type | description |
---|---|---|
type | string | site |
url | string | link to show |
open | string | specifiy how to show the link :
|
cache | boolean | cache webview content |
autoscaling | boolean | (Apple) webview autoscaling |
backbtn_for_webview | boolean | should the back action be triggered in the webview |
xml
{ type:"xml", urltype:"audio|image|news|..." hideimg:true|false, addform:ID, form:ID, addformlabel:"string", cache:true|false, backbtn_for_webview:true|false }
name | type | description |
---|---|---|
type | string | xml |
urltype | string | type content of the feed
|
url | string | the feed url |
hideimg | boolean | specify if the img of the feed should be hidden If missing default is false (img visible) |
form | integer | id of the form to show prior to the feed request |
addform | integer | id of the form to show for add function |
addformlabel | string | the label to be displayed for addform button |
cache | boolean | cache webview content |
backbtn_for_webview | boolean | should the back action be triggered in the webview |
pid | int | the page ID, generated at creation time |
image
If the urltype is image the app should show a gallery
audio
If the urltype is image the app should show an audio player
feeds
if the urltype is feeds the feed contents should be interpreted as a categories contents.
The items key of the /wiki/spaces/IN/pages/3112999 returned is the value of the child key of the page hash
Anything Else
For all the others values the view should display all the content (title,description,img) using the selected layout. The view should check the key “hideimg” that specify that the img is hidden. When a item is selected the app should check the value of the key “show” that can have this value :
- link
In this case the app should open the value of the key “link” with an external call
- insidelink
In this case the app should open the value of the key “link” in a webview
- content
In this case the app should show the value of the key “content” in a webview In the “insidelink” and “content” case the app should slideshow of news with next/prev/share
special
In this case the app should check the value of the key “subtype” that can have these values :
contacts
In this case you should read the check the key “values” that is an array of hash with this structure :
type:"special", subtype:"contact", values :{ name:"", value:"", type:"" }
This list should be show in a list layout setting the title with the name and the description with the value and the img url build like
/images/default/category/+type+.png
When the row is selected the app should check the type key and do a call,sms,email, web browsing.
form
{ type:"form", form:FORMID }
empty
{ type:"empty" }