PEDN> Main Web>ParaWorldAPI>WebServiceConstants (2008-02-29, LiXizhi) Change language en zh-cn? EditAttach

Web Service Constants

constants used by web services, such as return values

Title constants used by web services, such as return values
Author(s) LiXizhi
Date 2008/1/21
File script/kids/3DMapSystemApp/API/webservice_constants.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemApp/API/webservice_constants.lua");
log(paraworld.TranslateURL("%MAIN%/CheckvVersion.asmx"))

Member Functions

paraworld.TranslateURL

 url that contains the left part in the mapping will be replaced by the right part. 
 _note_: EDIT THIS TO CHANGE SERVER

NPL.load("(gl)script/IDE/rulemapping.lua");
local urlMapping = CommonCtrl.rulemapping:new({
   -- an optional regular expression. If this is present, the value must match this test string, in order for any output replaceables to be applied. 
   replaceables_test = "%%",

   -- output path replaceables, multiples replaceables may appear in the same output
   replaceables = {
      --["%%MAIN%%"] = "http://192.168.0.221",
      ["%%MAIN%%"] = "http://test.api.pala5.com",
      --["%%AUTH%%"] = "http://192.168.0.221",
      ["%%AUTH%%"] = "http://test.api.pala5.com",
      --["%%MAP%%"] = "http://192.168.0.221:81/",
      ["%%MAP%%"] = "http://test.api.pala5.com:81/",
      ["%%INVENTORY%%"] = "http://test.api.pala5.com:85/",
      --["%%PROFILE%%"] = "http://202.104.149.47",
      ["%%PROFILE%%"] = "http://test.api.pala5.com",
      --CYF
      --["%%APP%%"] = "http://192.168.0.221:82",
      ["%%APP%%"] = "http://test.api.pala5.com:82",
      --["%%FILE%%"] = "http://192.168.0.221:81/UserFile",
      ["%%FILE%%"] = "http://test.api.pala5.com:81/UserFile",
      --["%%MQL%%"] = "http://192.168.0.221/MQL",
      ["%%MQL%%"] = "http://test.api.pala5.com/MQL",
      --["%%ACTIONFEED%%"] = "http://192.168.0.221/ActionFeed",
      ["%%ACTIONFEED%%"] = "http://test.api.pala5.com/ActionFeed",
      --["%%LOBBY%%"] = "http://192.168.0.221:84",
      ["%%LOBBY%%"] = "http://test.api.pala5.com:84",
      --End CYF
      -- wiki root path: e.g. "%WIKI%/Main/ParaWorldFrontPageMCML"
      ["%%WIKI%%"] = "http://pedn.paraengine.com/twiki/bin/view",
      -- chat domain
      ["%%CHATDOMAIN%%"] = "pala5.cn",
      -- if this is nil, IP is dynamically resolved from CHATDOMAIN. 
      -- I provide it here just to ensure testing via a local test server. 
      ["%%CHATDOMAINIP%%"] = "jabber.pala5.com", 
   },
   
   -- an optional regular expression. If this is present, the input must match this test string, in order for any general rules to be applied. 
   general_test = nil,
   
   -- general rules are evaluated in the order given below
   general = nil,
   
   -- special rules are strict mapping using hash find.
   special = nil,
}
)

tranlation url containing paraworld.URL_parameters e.g. paraworld.TranslateURL("%MAIN%/CheckvVersion.asmx") will return the full url by replacing %MAIN% with the one defined in paraworld.URL_parameters

  • return url :.

syntax

function paraworld.TranslateURL(url)

parameters

url  
return .
Topic revision: r1 - 2008-02-29 - 15:26:12 - LiXizhi
 

ParaEngine Developer Network

This site is powered by the TWiki collaboration platformCopyright © 2004-2008 ParaEngine Corporation
Ideas, requests, problems regarding ParaEngine platform Send feedback