wakanda#3
DESCRIPTION
sample solution and database posted on GitHub: https://github.com/miyako/4d-training-wakanda-3TRANSCRIPT
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
agenda
remote procedure call
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
agenda
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
JSON-RPC
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
agenda
remote procedure call
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
agenda
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
JSON-RPC
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
agenda
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
JSON-RPC
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Executing-Code-on-the-Server300-575371jahtml
JSON-RPC
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
wakanda application framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript+
WAF datasource (widgets)+
WAF dataprovider (REST)
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
no framework
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
method echo params [Hello JSON-RPC] id 1
result Hello JSON-RPC error null id 1
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
About-JSON-RPC-Services-in-Wakanda300-306542jahtml
JSON-RPC
remote procedure call
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
JSON-RPChttpenwikipediaorgwikiJSON-RPC
commonJShttpwwwcommonjsorg
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
commonJS
場所 projectFolderModulesmyRPCJS (サブフォルダーでも良い)
構成 1 filemodule n functionsmodule
javascript not just for browsers any more
httpwwwcommonjsorgspecsmodules10
戻り値 必須 (null でも良い)
アクセス権 module毎 function毎
JSON-RPC
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
regular
function add (a b) return (a + b)
exportsadd = function add (a b) return (a + b)
commonJS
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
notExposedVarはエクスポートされない
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
commonJS
require(myRPC)add()
他のサーバーサイドJavaScriptからモジュールを呼び出すとき
var notExposedVar = foo
exportsCONSTANT_1 = hello
exportsadd = function add (a b) return (a + b)
ModulesmyRPCjs
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
Set as RPC
ltxml version=10 encoding=UTF-8gtltpermissionsgt ltallow type=module resource=myRPC action=executeFromClientgtltpermissionsgt
projectFolderpermissionswaPerm
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
permission
attribute value remarks
type modulefuntion
resource modulePathmodulePathfuntionName
action executeFromClientpromote promote アクセス権を昇格して実行
groupID group UUID default no authentication
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Assigning-Group-Permissions200-725897jahtml
projectFolderprojectNamewaSettings
publish
ltxml version=10 encoding=UTF-8gtltsettingsgt ltprojectgt lthttpgt ltservice name=webApp modulePath=serviceswebApp enabled=true autoStart=truegt ltservice name=rpc modulePath=servicesrpc enabled=true autoStart=true proxyPattern=^rpc-proxy publishInClientGlobalNamespace=falsegt ltservice name=dataStore modulePath=servicesdataStore enabled=true autoStart=truegt ltservice name=upload modulePath=servicesupload enabled=true autoStart=truegt ltservice name=Git HTTP Service modulePath=serviceswaf-gitwaf-GitService enabled=truegt ltresourcesgt ltjavaScriptgtltsettingsgt
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
syntax1
var mathTools = sine function () cos function () atan function ()
var mathTools = mathToolssine= function () mathToolscos = function () mathToolsatan = function ()
syntax2
【参考】
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
error handling
code message remarks
-32601 Method not found
-32603 Internal error while throw カスタムエラー
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
button1click = function button1_click (event)
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(emessage)
ecode エラーコードemessage エラーメッセージ
error handling
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result) catch (e) consolelog(edata)
ecode エラーコードemessage エラーメッセージ
error handling
edata エラーメッセージオブジェクト
button1click = function button1_click (event)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
ModulesmyRPCjs
exportsadd = function add (a b) if ((alength) ampamp (blength)) return (a + b) else throw new UserException(Arguments cant be empty 1)
function UserException(message code) thismoduleName = myRPC thismessage = message thiscode = code
error handling
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
synchronous call
try var a = $$(textField1)getValue() var b = $$ (textField2)getValue() var result = myRPCadd(ab) $$(richText1)setValue(result)catch (e) consolelog(emessage)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$ (textField1)getValue() $$(textField2)getValue())
Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
myRPCaddAsync( function (result) $$(richText1)setValue(result) $$(textField1)getValue() $$(textField2)getValue())
コールバックメソッド(成功時のみ)Async 非同期モードRPCのsuffix
パラメーター(そのまま列挙)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Calling-Methods-from-the-Client-Side300-306631jahtml
button1click = function button1_click (event)
asynchronous call
var result = myRPCaddAsync( onSuccess function (result) $$(richText1)setValue(result) onError function (error) consolelog(edata) params [$$(textField1)getValue() $$(textField2)getValue()] )
パラメーター(配列)コールバックメソッド(成功時失敗時)
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Configuring-CommonJS-Modules-for-RPC300-306585jahtml
namespace
indexwaPageindexhtml
ltmeta name=WAFconfigrpcfile content=rpc-proxymyRPCnamespace=myRPCgt
ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt
any html
デフォルト名前空間 RPCモジュールjsのファイル名
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
plainhtml
ltDOCTYPE htmlgtlthtmlgt ltheadgt lttitlegtplainlttitlegt ltmeta http-equiv=Content-Type content=texthtml charset=UTF-8 gt ltscript type=textjavascript src=rpc-proxymyRPCnamespace=myRPCgtltscriptgt ltheadgt ltbodygt lth1gt ltinput type=text id=textInput1 value=Hello gtltinputgt ltinput type=text id=textInput2 value=World gtltinputgt ltbutton onclick=documentgetElementById(textInput3)value = myRPCadd(documentgetElementById(textInput1)value documentgetElementById(textInput2)value)gtmyRPCadd()ltbuttongt ltinput type=text id=textInput3 readOnly=true gtltinputgt lth1gt ltbodygtlthtmlgt
synchronous call
JSON-RPC
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-JSON-RPC-ServicesError-Handling300-306655jahtml
synchronous call
JSON-RPC
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
HTTP request handler
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
HTTP request handler
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
client Side JavaScript
no framework
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no JavaScript
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTPHTTP200-803294jahtml
HTTP request handler
browsers server
NoSQL object datastore+
web server+
Server Side JavaScript
HTTP client
no server restart
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
add handler
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
httpwwwicu-projectorguserguideregexphtml
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
ファイル名
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Global-ApplicationApplicationaddHttpRequestHandler301-636268jahtml
HTTP request handler
addHttpRequestHandler( (i)^demo$ myRequestHandlerjs do_demo )
リクエストURLパターン ICU正規表現
add handler
関数名ファイル名
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Introduction-to-HTTP-Request-Handlers200-803294jahtml
HTTP request handler
function do_demo(request response) return Hello world
handler function
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTP-Request-HandlersHTTPRequest201-803366jahtml
HTTP request handler
HTTPRequest
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTP-Request-HandlersHTTPResponse201-805902jahtml
HTTP request handler
HTTPResponse
body - String | Image | Blob requestLine - String isSSL - Boolean
contentType - String url - String
method - String rawURL - String parts - MIMEMessage
host - String urlPath - String headers - HTTPRequestHeader
version - String urlQuery - String statusCode - Number
user - String remoteAddress - String remotePort - Number
password - String localAddress - String localPort - Number
allowCache() allowCompression()
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Executing-Code-on-the-Server300-575371enhtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
remote procedure call
JSON-RPC HttpRequestHandler Datastore
タイプ サービス リクエストハンドラー クラスメソッド
再起動不要 no yes no
クライアント JavaScript HTTP JavaScript
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
scope
client server derived class class
public OK OK OK OK
public on server OK OK OK
protected OK OK
private OK
datastore class method
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datasource
indexwaPageindexhtml
var result = sourcesmyClassmyMethod()
datastore class method
dataSource名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
dataprovider
indexwaPageindexhtml
datastore class method
var result =dsMyClassmyMethod()
class名の大文字小文字に注意
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Using-Datastore-Class-Methods200-878615jahtml
datastore class method
datasourcedataprovider
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
REST
GET http1270018081restMyClassmyMethod
POST http1270018081restMyClassmyMethod
datastore class method
class method名の大文字小文字に注意
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
HTTP-RESTManipulating-DatadatastoreClassmethod303-814342jahtml
datastore class method
REST
GET http1270018081restMyClassmyMethod(abc)
POST http1270018081restMyClassmyMethod
body [abc]
resultabc
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by
Shibuya Tokyo
Wakanda勉強会 32013-08-20
presented by