CCAPITestScript

From ADF Docs
Revision as of 16:40, 6 October 2010 by Rkahn (talk | contribs)
Jump to: navigation, search

This script goes into the individual subsite's customcf folder and is ran directly.

<verbatim> <cfscript> userid = "admin-commonspot"; password = "password"; webserviceURL = "http://myserver/commonspot/webservice/cs_service.cfc?wsdl"; site = "http://myserver/sitename"; datadir = ""; // the full path to the location of your source uploaded documents/images (requires trailiing slash) </cfscript>



<cfoutput>

Time at beginning of CCAPI login process: #now()#

</cfoutput>

<cfobject webservice="#webserviceURL#" name = "ws">

<cfinvoke webservice = "#ws#" method ="cslogin" site = "#site#" csuserid="#userid#" cspassword="#password#" subsiteid="1" subsiteurl="/" returnVariable="loginResult">

<cfif ListFirst(loginResult, ":") is "Error"> <cfoutput>Login Failed - #loginResult#</cfoutput> <cfexit> </cfif>

<cfset ssid = ListRest(loginResult, ":")> <cfoutput>Original Method Login -- #ssid#
</cfoutput>



<cfinvoke webservice="#ws#" method="cslogout" ssid="#ssid#" returnVariable="finalLogoutResult">

<CFOUTPUT>Original Method Logout -- #finalLogoutResult#
</CFOUTPUT>

<cfoutput>

Time at end of CCAPI test: #now()#

</cfoutput>


<cfoutput>

ADF.CCAPI method

<cfset myInitResult = application.adf.ccapi.initccapi()>

I think I initalized the CCAPI.

<cfset myLoginResult = application.adf.ccapi.login(1)>

myLoginResult:

<cfdump var="#myLoginResult#" label="myLoginResult" expand="no"> <cfset AmLoggedIn = application.adf.ccapi.loggedin()>

Did I login to the site?: #AmLoggedIn#


<cfset AmLoggedOut = application.adf.ccapi.logout()>

Did I logout of the site?: #AmLoggedOut#

</cfoutput> </verbatim>