CFLib.org – Common Function Library Project

enableDisableWhiteSpaceManagement([action])

Last updated February 14, 2004

author

Qasim Rasheed

Version: 1 | Requires: CF6 | Library: UtilityLib

Description:
This function will enable or disable whitespace management in ColdFusion Server without access to ColdFusion Administrator. It returns the current status of the setting.

Return Values:
Returns a boolean.

Example:

<cfoutput>#enableDisableWhiteSpaceManagement("disable")#</cfoutput>

Parameters:

Name Description Required
action Either disable or enable. Defaults to enable. No

Full UDF Source:

<!---
 This function will enable or disable whitespace management in ColdFusion Server without access to ColdFusion Administrator.
 
 @param action 	 Either disable or enable. Defaults to enable. (Optional)
 @return Returns a boolean. 
 @author Qasim Rasheed (qasim_1976@yahoo.com) 
 @version 1, February 14, 2004 
--->
<cffunction name="enableDisableWhiteSpaceManagement" output="false" returntype="boolean">
	<cfargument name="action" type="string" default="enable" />
	<cfscript>
		var factory = CreateObject("Java","coldfusion.server.ServiceFactory");
		var runtime = "";
		
	</cfscript>
	<cflock name="factory_runtimeservice" type="exclusive" timeout="5">
		<cfset runtime = factory.getRuntimeService()>
		<cfswitch expression="#arguments.action#">
			<cfcase value="enable">
				<cfif not runtime.WhiteSpace>
					<cfset runtime.setWhiteSpace("YES")>
				</cfif>
			</cfcase>
			<cfcase value="disable">
				<cfif runtime.WhiteSpace>
					<cfset runtime.setWhiteSpace("NO")>
				</cfif>
			</cfcase>
		</cfswitch>
	</cflock>
	<cfreturn runtime.WhiteSpace />
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson