---++!! !ParaWorld_Profile %TOC{title="Contents:"}% %STARTINCLUDE% ---++ App profile management API | *Title* | App profile management API | | *Author(s)* | LiXizhi,CYF | | *Date* | 2008/1/21 | | *File* | script/kids/3DMapSystemApp/API/paraworld.profile.lua | ---+++ Description get a given or all application profiles of a given user; set a given application's profile for the current user or any user(needs providing application signature) LocalServer is used for caching, so the GetMCML function can be used offline. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua"); </verbatim> ---+++ Member Functions ---++++ ! create class commonlib.setfield("paraworld.profile", {}); [[ <summary> 鐧诲綍鐢ㄦ埛淇敼銆佽缃叾鏈汉鐨凱rofile </summary> <param name="msg"> msg = { sessionKey = string (*) 鐢ㄦ埛蹇呴』鐧诲綍鎵嶈兘淇敼鏁版嵁锛屽苟涓旀殏鏃跺彧淇敼鑷繁鐨凱rofile appKey = string(*) 淇敼鐨勬槸鍝釜App鐨凱rofile profile = XmlElement (*) 鏌愪釜鐢ㄦ埛鐨凱rofile鐨凪CML琛ㄧず褰㈠紡銆傝嫢鏈彁渚汸rofile鎴朠rofile鍊间负String.Empty锛岃〃绀哄皢璇ユ潯鏁版嵁鍒犻櫎 } </param> <returns> msg = { isSuccess = boolean 鎿嶄綔鏄惁鎴愬姛銆? [ errorCode ] = int //閿欒鐮併€?锛氭棤寮傚父 500锛氭湭鐭ラ敊璇? 499锛氭彁渚涚殑鏁版嵁涓嶅畬鏁? 498锛氶潪娉曠殑璁块棶 [ info ] = string (鍙戠敓寮傚父鎴栦笉鑳芥甯告搷浣滄暟鎹椂鍒欒繑鍥炴鑺傜偣) } </returns> ]] paraworld.CreateRESTJsonWrapper("paraworld.profile.SetMCML", "%MAIN%/Profile/SetMCML.ashx", paraworld.prepLoginRequried); [[ <summary> 鍙栧緱鎸囧畾鐢ㄦ埛鐨凱rofile鐨凪CML </summary> <param name="msg"> msg = { appKey = string, 鑾病鏈夋彁渚汚ppKey锛屽垯杩斿洖鎸囧畾鐢ㄦ埛鐨勬墍鏈塒rofile uid = string (*) } </param> <returns> msg = { uid = string 瀹㈡埛绔紶杩囨潵鐨勭敤鎴稩D appKey = string 瀹㈡埛绔紶杩囨潵鐨凙pp Key apps = list{ appKey = string profile = string } profile = string, for single app, data may be here. one need to check both msg.profile and msg.apps[appKey] for max compatibilities. [ errorCode ] = int //閿欒鐮併€? 鏈煡鐨勯敊璇?= 500, 鎻愪緵鐨勬暟鎹笉瀹屾暣 = 499, 闈炴硶鐨勮闂?= 498, 鏁版嵁涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎 = 497, 鏈櫥褰曟垨娌℃湁鏉冮檺 = 496 [ info ] = string //鍙戠敓寮傚父鏃舵湁姝よ妭鐐? } </returns> ]] getMCML with modified preprocessor and postprocessor and local server cache policy the local server will cache each app MCML entry, if caller queries for multiple entries at one call, they are saved in local server as multiple entries. _Note_: if appKey is nil, local server is not used. if appKey is not nil, local server is used and expired result, if any, will be returned followed by an unexpired or latest result. local GetMCML_cache_policy = Map3DSystem.localserver.CachePolicy:new("access plus 2 hours"); paraworld.CreateRESTJsonWrapper("paraworld.profile.GetMCML", "%MAIN%/Profile/GetMCML.ashx", PreProcessor __syntax__ <verbatim>function (self, msg, id, callbackFunc, callbackParams, postMsgTranslator) </verbatim> __parameters__ | *self* | | | *msg* | | | *id* | | | *callbackFunc* | | | *callbackParams* | | | *postMsgTranslator* | | ---++++ ! Post Processor __syntax__ <verbatim>function (self, msg, id,callbackFunc, callbackParams, postMsgTranslator, raw_msg, inputMsg)</verbatim> __parameters__ | *self* | | | *msg* | | | *id* | | | *callbackFunc* | | | *callbackParams* | | | *postMsgTranslator* | | | *raw* | | | *msg* | | | *inputMsg* | | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback