(file) Return to dsp_searchBytext.cfm CVS log (file) (dir) Up to [Development] / p2rx-programs / include

File: [Development] / p2rx-programs / include / dsp_searchBytext.cfm (download)
Revision: 1.3, Thu Jun 15 00:31:48 2006 UTC (3 years, 5 months ago) by nbisbee
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
Added code to account for P2Rx server being down

<!--- 	Name:  dsp_searchBytext.cfm
    	Purpose: This file will get the organization when user searches for a term
		Date created: 05/01/2006 
       	Dependancy: PageAction
					URL - for CFHTTP
					region - Number of region
		Variables: 	OrgID - Unique Identifier of the organization
					OrganizationName - name of the organization
					Division - Division of organization
		Date changed: 
					05/01/2006     	Prabin Kanel	Created file
					05/12/2006		Prabin Kanel	Documentation
					06/14/2006		Terry Huss		Added lines 20-22 in case P2Rx server is down
--->

<CFSETTING enablecfoutputonly="Yes">

<CFTRY>
		<cfhttp method="GET" url="http://www.p2rx.org/webservices/p2rx/searchByTextResult.cfm?format=#format#&searchText=#searchText#&region=#region#" resolveurl="no">
		<!---<cfoutput>#cfhttp.statuscode#</cfoutput>--->
			<cfif #cfhttp.statuscode# EQ "404 Not Found">
			<cfoutput>
		<cfhttp method="GET" url="http://wrrc.p2pays.org/webservices/p2rx/searchByTextResult.cfm?format=#format#&searchText=#searchText#&region=#region#" resolveurl="no"></cfoutput></cfif>
		<cfwddx action="WDDX2CFML" input="#cfhttp.fileContent#" output="strOutput">
					
			<CFSET intNumberOfTerms = ArrayLen(strOutput.List)>
			<p><b><cfoutput>#intNumberOfTerms#</cfoutput> records are returned.		</b></p>
				<CFLOOP from="1" to="#intNumberOfTerms#" index="intCounter">
				<cfoutput>
				<p><a href="index.cfm?pageAction=showDetail&orgid=#strOutput.List[intCounter].orgid#&Format=WDDX&region=#region#" class="subheading">#replacelist(strOutput.List[intCounter].ORGANIZATIONNAME,good_chars,Bad_chars)# </a>
				<cfif #strOutput.List[intCounter].DIVISION# NEQ ""><BR>
					Division - #replacelist(strOutput.List[intCounter].DIVISION,good_chars,Bad_chars)#</cfif>
				</P></cfoutput>
				</cfloop>
			
			
	<CFCATCH type="Any">
			<P>
				<strong>There is an error on getting browse by text data. The site administrator has been notified.<BR>
				If it is a connection failure error, please check back in few minutes.
				</strong>
			</P>
		</CFCATCH>
	</CFTRY>
	
<CFSETTING enablecfoutputonly="No">

CVS Admin
Powered by
ViewCVS 1.0-dev