xowiki::Page instproc as_json (public)
<instance of xowiki::Page> as_json [ -pretty on|off ]
Defined in /var/www/openacs/packages/xowiki/tcl/json-procs.tcl
Serialize all non-transient attributes, using form metadata for instance attributes. Use -pretty true for indented JSON output.
- Switches:
- -pretty (optional, boolean, defaults to
"false")- Whether to indent the generated JSON.
- Returns:
- JSON object string. Requires ns_json support.
- Testcases:
- No testcase defined.
Source code: if {![::acs::icanuse "ns_json"]} { error "JSON export requires ns_json support" } set options {} if {$pretty} { lappend options -pretty } return [ns_json value -type object {*}$options [:json_data]]XQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)