All FarCry Community projects are managed through a single Jira Studio instance (thanks to our friends at Atlassian). That includes code commits across the framework, related plugins and projects, in additioni to WIKI documentation changes, and public code reviews.
You can track the lot in your favourite feed reader by subscribing to the universal activity feed:
A great feature of the FarCry Verity Plugin is the ability to override what content gets indexed. This is achieved by writing a custom function within the content type that starts with contentToIndex
For example, a custom function to allow the ability to restrict content to only show published content (to allow forward publishing)
1 2 3 4 5 6 7 8 9 |
<!-- For example, within an extended ./myproject/packages/types/dmNews.cfc --> <cffunction name="contentToIndex" returntype="query" description="Gets news content to index"> <cfset qContentToIndex = application.fapi.getContentObjects(typename="dmNews",lProperties="objectid",publishDate_lte=now(),expiryDate_gt=now()) /> <cfreturn qContentToIndex> </cffunction> |
You can actually add multiple functions to the same content type which will then allow you to choose the function you want when you create the verity collection. Simply prefix them with contentToIndex*
For example, contentToIndexTest and contentToIndexMyCategory.
Enjoy!
The Daemonites are releasing their beautiful FarCry 6.0 Contributor Training Course under Creative Commons. You're free to distribute the work, but not to use it for commercial purposes. If you would like instructor-led training, or want to run training courses of your own please contact us.
Enjoy!
cacheByVars is a view decorator who's values are used by the caching layer to identify unique views of the same webskin and object. For example, a single webskin has a paginated result set that means there is a different output depending on page number using something like URL.page.
The vars that might impact the caching are accessed and hashed BEFORE the webskin is executed in order to identify if that execution can be avoided. Unfortunately, there can be a problem if the webskin/view cfparam's one of these variables: the cache layer looks for an item with a null for that variable and doesn't find it, then afterwards caches the item where the variable DOES have a value. You'll see a fix for this coming through in 6.0.6, where we've added support for defining a default cacheByVars value in the decorator:<!--- @@cacheByVars: url.page:1 --->
In cases where the variable is not found by the caching layer, it is treated as being equal to the specified value instead. Variables with no defaults are still supported.Profiling code and logging output for a request is painful. It usually involves checking the IP address or URL variable to make sure only a developer sees it, and has to be outputed using cfdump/cfoutput followed by an abort.
Blair has added support for profile=1. Just tack it onto the end of your URL when you are developing. (You'll need to wait for 6.0.6 https://farcry.jira.com/browse/FC-2330 or be running from the p600 maintenance branch)
If the "tray menu" is showing (ie. you have logged into the webtop earlier with admin permmissions), this mode starts tracking calls to application.fapi.addProfilePoint(section,label) and application.fapi.addRequestLog(text). The profile functionality is a little bit primitive at this stage, but it's enough to show relative times between points. FarCry Core has a few points already in place to track request initialisation and view execution.
The logging is also simple; a list of strings. Timestamps are recorded but not outputed. Core has logging for cache hits and misses.
Enjoy!
A view decorator is a little bit of metadata that you can stick at the top of your view in FarCry to change its behaviour and the way its documented. FarCry Core framework is pretty clever and can work out a default in most cases depending on the file naming convention you have used. However, its good practice to be explicit about your decorators so be sure to put them in.
Adding them to your view couldn't be easier. Just add each decorator on its own line, in a ColdFusion comment, at the top of your view.
<!--- @@Displayname: Full Page Display --->
<!--- @@Description: Complete view of the case study. --->
<!--- @@Viewstack: page --->
<!--- @@Viewbinding: object --->
<!--- @@Cachestatus: 1 --->
<!--- @@Cachetimeout: 60 --->
<!--- @@Fualias: page --->
What follows is a little cheat sheet of the most common decorators and how they work.
@@cachestatus: 0, 1, -1
Cache status determines whether or not a view should participate in the dynamic caching layer of FarCry. 0 is the default and simply means, "no directive given". 1 says "turn on caching". -1 prohibits the view from being cached under any circumstances, even if a parent view has been instructed to be cached.
@@Cachetimeout: minutes (default 24hrs)
Cache time out is the number of minutes the view should remain in the cache. This defaults to an entire day. It's not unusual to have long time outs for FarCry caches. Unlike other CMSs, the FarCry caching service is clever and will automatically flush caches where content has been updated rather than waiting for the full time out.
@@Cachetypewatch: list of typenames
Cache type watch setting looks for changes in the nominated content types. If you add a new content item to the system, a view with a "type watch" will automatically get flushed. This is great for listing views that show stuff like the latest news items or whatever.
@@Cachebyvars: list of scoped variable names
Sometimes you want the view to have a different cache for different values of a variable. This is easily achieved by nominating the list of variables that make up that difference. For example, an archive page which uses a url parameter like &year=2010 would ideally have a different cache for each value for year.
@@Viewstack: page, body, fragment, ajax, any
View stack is a little quirky. It's basically an instruction to the friendly url service to help it identify what type of view your output should be, ie. "where in the stack". Normally this is determined by convention. If you name your view with a prefix of displayPage, then it will be assigned a value of "page", displayBody and its "body", and just about everything else is "fragment", for example displayTeaserStandard.cfm
@@Viewbinding: type, object, any
View binding determines what part of the model should be bound to your view. Use "type" when its a type view, that is a view on a group of objects pertaining to a content type. And use "object" if you are rendering a specific content instance or record.
@@Fualias: friendly URL alias for the view
Friendly URL alias is great. You can rename your view, as it appears on the URL, to just about anything you like. So for a view with a file name of displayRSSFeed.cfm you get a default URL containing "displayRSSFeed". Using fualias you could change this to simply "rss".
@@Displayname: name of the template
@@Description: overview of template usage
Displayname and Description are used by the framework and documentation plugin to provide a friendly name and additional information about the view when its relevant. It's highly recommended you fill these in so your users get friendly and intuitive labels.
The complete list of changes for 6.0.5 maintenance release is available here under "Filters > All":
https://farcry.jira.com/browse/FC/fixforversion/10352
Due to popular demand (well at least the folks who have been badgering me for an update), I've convinced Blair to put together a quick tutorial on setting up Selenium tests with the testMXUnit framework. The tutorial builds a simple Selenium script for checking a Google search result, shows how the ColdFusion test components are constructed and how simple it is to run the test suite in the FarCry webtop.
https://farcry.jira.com/wiki/display/TEST/Selenium+Tests The cool thing about the test suite is that you can use it to build Selenium test suites that run tests against any sort of web application -- just so long as your FarCry installation can reach the application via HTTP.
You can do just about anything you would normally in Selenium, and run it through the framework. If you have any questions about how to get your Selenium test going let us know :) Enjoy!
testMXUnit is a FarCry plugin based on the great MXUnit testing framework for ColdFusion. It's got a few pretty cool enhancements, hooking it up with the FarCry framework and providing a great UI for running test suites. But the super-cool news is something we've been sitting on for a little while, and that's Selenium support.
testMXUnit allows you to record Selenium testing scripts with the standard Selenium IDE, then with a simple conversion to CFSCRIPT and the tests run beautifully and unassisted within the FarCry framework. Here's a little screenshot as a teaser -- details on how to create Selenium tests to follow soon.
Download: https://farcry.jira.com/source/browse/TEST Awesome work Blair!
The complete list of changes for 6.0.4 maintenance release is available here:
https://farcry.jira.com/browse/FC/fixforversion/10350