Domino view is displayed in json format, dominojson
Currently, it is necessary to integrate ajax elements into web development. If you haven't used ajax in your domino web development, you can quickly find the material to supplement it (My csdn has uploaded a demo ), ajax data transmission is also popular in json format (xml, of course ).
View columns are displayed in json format. json format is generated at the front end for ls, java, and ssjs calls, which is applicable to the json format requirements of various front-end controls. Here {"name": "value" },{……...} is displayed "},{.......}, To [{},...] And other formats.
Why does the view directly convert to the json format instead of the json format generated in the proxy ls, java, and xagent (ssjs? The essence is fast, please read this test article http://www.lotuschina.net/club/thread-3377-1-1.html
* 1) if there are too many domains (found on the Internet), put the undesired domain in _ exclude.
Http://openntf.org/XSnippets.nsf/snippet.xsp? Id = use-transform-to-build-json-and-consume-the-output-in-an-xagent
_ Exclude: = "$ FILE": "$ Fonts": "Form": "$ UpdatedBy": "$ Revisions": "ID": "ModifiedBy": "AddressInvoiceAppartment ";
_ Category: = @ Trim (@ ReplaceSubstring (@ DocFields; _ exclude; @ Nothing ));
"{\" @ Unid \":\""
+ @ Text (@ DocumentUniqueID) + "\","
+ @ Implode (
@ Transform (
_ Blank; "_ fn"; "\" "+ _ fn +" \ ": \" "+ @ Text (@ GetField (_ fn )) + "\" ");", ") +
"},"
* 2) if the number of domains is small, (changed according to 1)
_ Blank: = "F_riqi": "F_shijian": "F_shoufeizhan ";
"{" + @ Implode (@ Transform (_ Transform; "_ fn"; "\" "+ _ fn + "\": \ "" + @ Text (@ GetField (_ fn) + "\" ");", ") +", \ "@ unid \": \ "" + @ Text (@ DocumentUniqueID) + "\"},"
* 3) This solves the problem of including special symbols. We recommend that you use
_ Parameters: = "code": "Quantity": "ITEMNAME ";
Json: = "";
M: = 1;
@ While (m <= @ Elements (_ Elements );
Temp: = @ Text (@ Implode (@ Trim (@ GetField (_ partition [m]); ",");
X: = "";
N: = 0;
@ While (n <= @ Length (temp );
@ Do (
Y: = @ Middle (temp; n; 1 );
X: = x + @ If (y = @ Char (8); "\" + @ Char (8 );
Y = @ Char (9); "\" + @ Char (9 );
Y = @ Char (10); "\" + @ Char (10 );
Y = @ Char (12); "\" + @ Char (12 );
Y = @ Char (13); "\" + @ Char (13 );
Y = @ Char (34); "\" + @ Char (34 );
Y = @ Char (39); "\" + @ Char (39 );
Y = @ Char (47); "\" + @ Char (47 );
Y = @ Char (92); "\" + @ Char (92 );
Y)
);
N: = n + 1 );
Json: = json + "\" "+ _ bytes [m] +" \ ": \" "+ x + "\",";
M: = m + 1 );
"{" + Json + "\" UID \ ": \" "+ @ Text (@ DocumentUniqueID) + "\"}"