PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/_assets/controllers/Filtering.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 45 lines | 38 code | 7 blank | 0 comment | 0 complexity | f2740ad6aae63120fd1d57e3ba2a7151 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="Controller">
  2. <cffunction name="init">
  3. <cfset aStr.testArg1 = 1>
  4. <cfset aStr.testArg2 = 2>
  5. <cfset filters(through="dir", testArg=1, except="doNotRun")>
  6. <cfset filters(through="str", strArguments=Duplicate(aStr))>
  7. <cfset filters(through="both", bothArguments=Duplicate(aStr), testArg=1)>
  8. <cfset filters(through="pub,priv", only="index,actOne,actTwo")>
  9. </cffunction>
  10. <cffunction name="dir">
  11. <cfset request.filterTests.dirTest = arguments.testArg>
  12. </cffunction>
  13. <cffunction name="str">
  14. <cfset request.filterTests.strTest = StructCount(arguments) & arguments.testArg1>
  15. </cffunction>
  16. <cffunction name="both">
  17. <cfset request.filterTests.bothTest = StructCount(arguments) & arguments.testArg>
  18. <cfif NOT IsDefined("request.filterTests.test") OR request.filterTests.test IS "bothpubpriv">
  19. <cfset request.filterTests.test = "">
  20. </cfif>
  21. <cfset request.filterTests.test = request.filterTests.test & "both">
  22. </cffunction>
  23. <cffunction name="pub">
  24. <cfset request.filterTests.pubTest = true>
  25. <cfif NOT IsDefined("request.filterTests.test") OR request.filterTests.test IS "bothpubpriv">
  26. <cfset request.filterTests.test = "">
  27. </cfif>
  28. <cfset request.filterTests.test = request.filterTests.test & "pub">
  29. <cfset request.filterTests.pubTest = true>
  30. </cffunction>
  31. <cffunction name="priv" access="private">
  32. <cfset request.filterTests.privTest = true>
  33. <cfif NOT IsDefined("request.filterTests.test") OR request.filterTests.test IS "bothpubpriv">
  34. <cfset request.filterTests.test = "">
  35. </cfif>
  36. <cfset request.filterTests.test = request.filterTests.test & "priv">
  37. </cffunction>
  38. </cfcomponent>