Difference between revisions of "CCAPITestScript"

From ADF Docs
Jump to: navigation, search
Line 8: Line 8:
 
To reset the adf: Log in as an administrator. Add ?resetSiteADF=1&resetServerADF=1 to the end of your url
 
To reset the adf: Log in as an administrator. Add ?resetSiteADF=1&resetServerADF=1 to the end of your url
 
---->
 
---->
 +
</nowiki>
 
<cfscript>
 
<cfscript>
 
userid = "admin-commonspot";
 
userid = "admin-commonspot";
Line 16: Line 17:
 
</cfscript>
 
</cfscript>
  
 
+
<nowiki>
 
<!--- The following should not need to be modified. --->
 
<!--- The following should not need to be modified. --->
 
+
</nowiki>
 
 
 
<cfoutput><p>Time at beginning of CCAPI login process: #now()#</p></cfoutput>
 
<cfoutput><p>Time at beginning of CCAPI login process: #now()#</p></cfoutput>
  
Line 105: Line 105:
 
<p>Did I logout of the site?: #AmLoggedOut#</p>
 
<p>Did I logout of the site?: #AmLoggedOut#</p>
 
</cfoutput>
 
</cfoutput>
</nowiki>
 

Revision as of 17:23, 6 October 2010

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

<!--- Use: To test that the CCAPI configuration is working correctly. Requirements: The CCAPI.xml file also reflects the next cfscript block and the ADF has been reset. To reset the adf: Log in as an administrator. Add ?resetSiteADF=1&resetServerADF=1 to the end of your url ----> <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>

<!--- The following should not need to be modified. --->

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