From a9d78707f75a16f6afa5aa68e329d85b22de58e5 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 8 May 2015 16:30:57 -0400 Subject: [PATCH] web api preso cont. Signed-off-by: Bill Erickson --- api_presentation/web_apis.asciidoc | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/api_presentation/web_apis.asciidoc b/api_presentation/web_apis.asciidoc index fb04a3f60..40cc26143 100644 --- a/api_presentation/web_apis.asciidoc +++ b/api_presentation/web_apis.asciidoc @@ -38,6 +38,31 @@ XML file which describes the structure of Evergreen classes. *** oils_persist:readonly="true" *** Effectively an inline database view +== IDL Sample + +[source,xml] +--------------------------------------------------------------------------- + + + + + + + + + + + +--------------------------------------------------------------------------- + == IDL Virtual SQL-driven Class [source,xml] @@ -60,6 +85,39 @@ XML file which describes the structure of Evergreen classes. name="transit" oils_persist:virtual="true" /> --------------------------------------------------------------------------- +== Scripting (pre-browser client) + +[source,js] +--------------------------------------------------------------------------- +var org = new fieldmapper.aou(); +org.name('foo'); + +var class_label = fieldmapper.IDL.fmclasses.aou.label; + +dojo.forEach(fieldmapper.IDL.classes.aou.fields, + function(field) { + console.log(field.name + ' ' + field.type + ' ' + field.label); + } +); +--------------------------------------------------------------------------- + + +== Scripting (browser client) + +[source,js] +--------------------------------------------------------------------------- +var org = new egCore.idl.aou(); +org.name('foo'); + +var class_label = egCore.idl.classes.aou.label; + +angular.forEach(egCore.idl.classes.aou.fields, + function(field) { + console.log(field.name + ' ' + field.type + ' ' + field.label); + } +); +--------------------------------------------------------------------------- + == Accessing the IDL * Source file /openils/conf/fm_IDL.xml -- 2.11.0