doUpdate = 0;
if ( StructKeyExists(request.params,"update") )
doUPDATE = 1;
== STANDARD CS CCAPI (Local) ==
Run the CCAPI populateCustomElement
config = {};
config.userid = "admin-commonspot";
config.password = "{password}";
config.site = "#request.site.url#";
config.subsiteID = 1;
config.pageid = 1900;
config.custElement = "Tags";
config.controlName = "ccapiTagsElement";
config.webserviceURL = "https://#Request.CGIVars.SERVER_NAME#:#Request.CGIVars.SERVER_PORT#/commonspot/webservice/cs_remote.cfc?wsdl";
//config.site = request.site.url;
//WriteDump(var=config,expand=false,label="config");
// create Web service object
// create object for the webService call
//ws = createObject("webservice", config.webserviceURL);
ws = createObject("component", "commonspot.webservice.cs_remote");
WriteDump(var=ws,expand=false,label="ws");
// call the login API
foo = ws.csLogin(
site = config.site,
csUserID = config.userID,
csPassword = config.password,
subSiteID = config.subsiteID
);
WriteOutput("Dump Foo: ");
WriteDump(var="#foo#",label="foo",expand="no");
WriteOutput("
");
Login Failed
Login -- SSID:[[ #ssid# ]]
sParams = {};
sParams.subsiteid = config.subsiteID;
sParams.pageID = config.pageid;
//sParams.controlID = 1929;
sParams.controlname = config.controlName;
sParams.submitChange = 1;
sParams.submitChange_comment = "Add New #config.custElement# Data Test";
sParams.data = {};
sParams.data.uniqueID = CreateUUID();
sParams.data.tag = "test-" & request.Site.IDMaster.getID();
sParams.data.contentID = CreateUUID();
sParams.data.parentContentID = 0;
sParams.data.active = 1;
UpdateResponse = StructNew();
if ( doUpdate )
UpdateResponse = ws.populateCustomElement(sParams=sParams,ssid=ssid);
else
UpdateResponse.Status = "populateCustomElement was not called. Use ?update=1 to test the function.";
// call the login API
foo = ws.cslogout(ssid);
Logout -- #foo#
STANDARD CS CCAPI ERROR
Dump of the "#config.custElement#" Custom Element Data: