ParaWorld_Profile

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.

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/API/ParaworldAPI.lua");

Member Functions

!

create class commonlib.setfield("paraworld.profile", {});

[[

鐧诲綍鐢ㄦ埛淇敼銆佽缃叾鏈汉鐨凱rofile

msg = {

sessionKey = string (*) 鐢ㄦ埛蹇呴』鐧诲綍鎵嶈兘淇敼鏁版嵁锛屽苟涓旀殏鏃跺彧淇敼鑷繁鐨凱rofile

appKey = string(*) 淇敼鐨勬槸鍝釜App鐨凱rofile

profile = XmlElement (*) 鏌愪釜鐢ㄦ埛鐨凱rofile鐨凪CML琛ㄧず褰㈠紡銆傝嫢鏈彁渚汸rofile鎴朠rofile鍊间负String.Empty锛岃〃绀哄皢璇ユ潯鏁版嵁鍒犻櫎

}

msg = {

isSuccess = boolean 鎿嶄綔鏄惁鎴愬姛銆?

[ errorCode ] = int //閿欒鐮併€?锛氭棤寮傚父 500锛氭湭鐭ラ敊璇? 499锛氭彁渚涚殑鏁版嵁涓嶅畬鏁? 498锛氶潪娉曠殑璁块棶

[ info ] = string (鍙戠敓寮傚父鎴栦笉鑳芥甯告搷浣滄暟鎹椂鍒欒繑鍥炴鑺傜偣)

}

]] paraworld.CreateRESTJsonWrapper("paraworld.profile.SetMCML", "%MAIN%/Profile/SetMCML.ashx", paraworld.prepLoginRequried);

[[

鍙栧緱鎸囧畾鐢ㄦ埛鐨凱rofile鐨凪CML

msg = {

appKey = string, 鑾病鏈夋彁渚汚ppKey锛屽垯杩斿洖鎸囧畾鐢ㄦ埛鐨勬墍鏈塒rofile

uid = string (*)

}

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 //鍙戠敓寮傚父鏃舵湁姝よ妭鐐?

}

]] 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

function (self, msg, id, callbackFunc, callbackParams, postMsgTranslator) 

parameters

self  
msg  
id  
callbackFunc  
callbackParams  
postMsgTranslator  

!

Post Processor

syntax

function (self, msg, id,callbackFunc, callbackParams, postMsgTranslator, raw_msg, inputMsg)

parameters

self  
msg  
id  
callbackFunc  
callbackParams  
postMsgTranslator  
raw  
msg  
inputMsg  
Topic revision: r1 - 2008-02-29 - LiXizhi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 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