Thursday, 17 May 2012
Blog

Blog

The FarCry blog are thoughts from the FarCry Core committers on a range of topics, but mainly on how FarCry works.  This is a list of the most recent posts. Full the complete FarCry Committer blog you'll need to go to:

< previous 1 2 next >

Fandango meet Fandango, the new Mollio

Justin has been hard at work designing a new set of templates for the standard FarCry installer.  This great looking skin is called Fandango after the FarCry release the project will first feature in.  A clean, blue-grey design based on the 960.gs CSS framework. You could probably throw this into an early FarCry build (6+) but we won't be making any concerted effort to make it available in distributions before the upcoming Fandango build.

Permalink | Leave a comment  »

Core Milestone 6.0.15 Released

Maintenance release includes patches to image management, proxy caching tweaks, and two great little features:

  • copy or duplicate content items from a content admin grid
  • loadJS/loadCSS from external libraries; eg. Google CDN, etc

The complete list of changes for 6.0.15 maintenance release is available here under "Filters > All":

Download the ZIP for for the 6.0.15 core milestone here:

Or alternatively you can update from Subversion (SVN) at this address:

Bug

  • [FC-387] - category.addCategory DSN arguments
  • [FC-761] - Possible Apache SCRIPT_NAME bug
  • [FC-2412] - New image formtool enhancements have issues with case sensitive file systems
  • [FC-2445] - application.fapi.flushCache should check whether the thing we're flushing exists in stCOAPI
  • [FC-2459] - No function endCrop() on $fc.imageformtool
  • [FC-2472] - Refactored image formtool doesn't handle uuid source field properly
  • [FC-2477] - FU: Friendly URL Edit Interface Errors
  • [FC-2503] - Replace tabs with double spaces when outputting js and css in head
  • [FC-2504] - Bugs in installer getDBTypes
  • [FC-2507] - editMethod attribute for ft:objectadmin works for "Add" action button but not "Edit"
  • [FC-2513] - genericNav activeClass attribute not applied to home node
  • [FC-2517] - jsInHead.cfm and cssInHead.cfm reference nonexistant application.url.cache variable
  • [FC-2519] - Update deprecated dmXMLExport functionality
  • [FC-2524] - Filtering in a library picker in combination with ftLibraryData breaks result ordering
  • [FC-2526] - Hitting enter key for carriage return in formtools textarea submits form

Improvement

  • [FC-157] - Option for refactoring nested tree model
  • [FC-2430] - No visibility of draft object state in objectAdmin
  • [FC-2474] - Add support for calling webtop/conjuror/invocation.cfm from a dialog iframe
  • [FC-2506] - Ability to permanently remove the system generated frienly URL
  • [FC-2516] - FarCry's request finalisation happens before plugin/project onRequestEnd templates
  • [FC-2520] - Add a generic category filter to getContentObjects
  • [FC-2525] - Restrict image upload size in the image formtool
  • [FC-2530] - The proxyCacheTimeout decorator isn't granular enough - browserCacheTimeout is also needed

New Feature

  • [FC-2505] - Copy content functionality
  • [FC-2511] - Use of loadJS/loadCSS with external libraries
Enjoy!

Permalink | Leave a comment  »

Related Content: Custom Webtop Tabs

Relatedcontent_2

Following up on some comments on the dev forum, Blair posted a really crafty bit of code that shows any and all related content for a specific content item.  

Ever wondered what content an image in the image library has been attached to? What content might be affected by removing something from the file library? This will shine a light on that little mystery :)

The code sample not only how to extract the relationships out of the COAPI but also how damn easy it is to have your very own tab views attached to a web top overview; just name the view webtopOverviewTabSomething.cfm, stick it in the right folder (e.g.. ./webskin/types for everything) and you are done.

Enjoy!

Permalink | Leave a comment  »

Array Upload: A multi-file uploader to array formtool

Awesome new formtool added to the p600 maintenance branch -- scheduled for milestone 6.0.16

The Array Upload allows you to nominate a specific content type, and a file or image property therein. For example, dmImage or dmFile. Then you can select multiple files, have them upload simultaneously, create the underlying content items and attach them to your content. Sweet! 

Arrayupload_uploading_2

Look at those three images all uploading inline! Yep, that's three images selected from the existing image library (the thumbs) and three additional images uploading together.

Arrayupload_reorder_2

You can list items in the array in "List" or the new "Tile" format (shown). All the drag and drop reordering magic you would expect is there.

Arrayupload_edit_2

And there's a new instant edit handler for related content! The standard Array form tool lets you nominate your own libraryEdit.cfm view, but for Array Upload you just list the properties you need to manage.

While you could use Array Upload for all kinds of scenarios, it's just plain marvellous for content where you want to attach a bunch of files; image galleries, file lists and more.

Enjoy!

Permalink | Leave a comment  »

FarCry 6.1 (codename: Mayonnaise) Core Milestone Released

There is now an official milestone for 6.1.0 and a corresponding maintenance branch. There is no official distro at this time -- just the ./core framework milestone. You can certainly upgrade existing projects if you have a mind, but we'll be releasing a friendlier distribution for folks new to FarCry in the very near future.

milestone-6-1-0

6.1.0 maintenance branch (p610)
https://farcry.jira.com/svn/FC/branches/p610 

# Key Features
  • Precision; allow the developer to nominate the exact precision of a property and have the database schema update accordingly
  • Better support options for new databases; a clean component architecture for adding new database gateways (only supports MSSQL & mySQL at this time)
  • Indexation; allow developers to nominate database indices that are automatically deployed, dropped and altered as needed 
  • Model schema tables that are not FarCry content types. Sometimes you just need a table without all the framework baggage; for example, refObjects and the nested tree model
  • Options for deploying and undeploying multiple objects, and mass property changes. This would make installers and updaters a breeze not to mention make development of customisations even simpler 
Previous posts discussing features: # Additional Release Notes Version FarCry 6.1 (Mayonnaise)

There are also a variety of bug fixes and minor enhancements swept up in the release that have been closed out. And probably a few older issues that need to be closed out as a result of underlying changes in the framework -- we'll close these out in the maintenance branch as we find them.

## Bug
  •     * [FC-364] - Deployment of array properties for custom rules isn't reflected in admin GUI
  •     * [FC-722] - Altertype functions need to be cflocked
  •     * [FC-2018] - Forgot password - hashed password is sent in the email when password hashing is enabled
  •     * [FC-2344] - Error when logging in to webtop - fourq createData() - Element TABLEMETADATA is undefined
  •     * [FC-2346] - Date values do not appear to contain times; all default to 12am
  •     * [FC-2358] - "typename" property not being set for dmHTML_aObjectIDs
  •     * [FC-2360] - Redirected back to home page after logging into webtop in subdirectory install
  •     * [FC-2361] - Fix hardcoded URL references to /webtop to be dynamic
  •     * [FC-2362] - Incorrect path for dmImage thumbnail on webtopOverviewSummary webskin
  •     * [FC-2367] - Editing a navigation node detaches child objects
  •     * [FC-2368] - dmNavigation - choosing "mirror" or "internal redirect" and then not picking an object locks you out of the edit form
  •     * [FC-2369] - Fix refObjects utility no longer works
  •     * [FC-2370] - TinyMCE GZip calculates incorrect path to cache folder
  •     * [FC-2371] - Friendly URL is not parsed correctly if it begins with two slashes (//)
  •     * [FC-2372] - farLogin form does not redirect user properly after switching projects or UD
  •     * [FC-2374] - Duplicate refObjectIDs created
  •     * [FC-2375] - Several references to getTablename() remain though the method no longer exists
  •     * [FC-2408] - When restarting installer, structDelete() session.oInstall is needed
  •     * [FC-2421] - "join" formtool specifies that "checkbox" is a valid render type when it is not
  •     * [FC-2428] - Child content deleted when editing navigation node
  •     * [FC-2456] - Cannot deploy new config
  •     * [FC-2484] - Typo in BaseGateway.cfc
  •     * [FC-2485] - db.cfc references a missing variables.paths['default'] path.
  •     * [FC-2487] - getContentObjects with categories is failing because of missing cfsqltype setting
  •     * [FC-2493] - COAPI repair fails to set default in database on boolean properties
  •     * [FC-2508] - pingFU not working
  •     * [FC-2512] - setData doesn't initialise object defaults when falling back to createData
  •     * [FC-2513] - genericNav activeClass attribute not applied to home node
  •     * [FC-2518] - Order of processing of _serverSpecificVarsAfterInit.cfm files should be plugins followed project
  •     * [FC-2521] - BaseGateway: "key doesn't exist in struct"
  •     * [FC-2522] - Google sitemap generation borked on external link data model changes
## Deprecated
  •     * [FC-1010] - Removing 3.0 widgets library
## Improvement
  •     * [FC-73] - Choose XML as an optional store of the tree data
  •     * [FC-111] - fourq property types needs a CUSTOM data type
  •     * [FC-923] - Logic order in the dmHTML and some minor bugs
  •     * [FC-1810] - dmNavigation: Allow the ability to add external targetable links directly to the navigation folder
  •     * [FC-2359] - Need to allow custom configuration for richtext on a per-field basis
  •     * [FC-2439] - Refactor "Forgot password" functionality
  •     * [FC-2476] - The framework does not pick up webskins if the folder is a different case to the cfc
  •     * [FC-2489] - dmcron grid should show full dates for start/end
  •     * [FC-2516] - FarCry's request finalisation happens before plugin/project onRequestEnd templates
## New Feature
  •     * [FC-2511] - Use of loadJS/loadCSS with external libraries
## Refactoring
  •     * [FC-1013] - Remove deprecated references to bTreeNode metadata in altertype.cfc
## Task
  •     * [FC-191] - Define all farcry content property types

Enjoy!

Permalink | Leave a comment  »

Maintenance Milestones 6.0.11-6.0.14 Released

Maintenance milestones have been silently released over the last half year without so much as a peep from me.  Apologies for that.  A bunch of great little patches in that lot.  To update all you need do is replace your ./core folder with the milestone and restart the FarCry application.

Distros and zips to follow shortly on http://www.farcrycore.org/builds

# Version 6.0.11 (4-March-2011)

## Bug
    * [FC-2449] - image formtool source delete option ui update
    * [FC-2454] - loadJS & loadCSS lCombineIDs caching issue
    * [FC-2455] - Fapi.getContentObjects) not respecting "time" value
    * [FC-2458] - Bold heading tags in webtop formtools so that they differentiate from themselves a little better

## Improvement

    * [FC-2151] - Form validation does not show message on longchar
    * [FC-2453] - Ability to specify basic cache headers (for reverse proxies) in webskins
    * [FC-2457] - While dependent images are being generated the user should see "working" message

# Version 6.0.12 (21-March-2011)

## Bug

    * [FC-2460] - farfu lookup fails on postgresql
    * [FC-2464] - ObjectAdmin tag doesn't apply filters for non-MSSQL databases

## Improvement

    * [FC-1942] - webskin with dash in file name throws error on startup / reinit
    * [FC-2463] - updates to ft:objectadmin for easy button adding 

# Version 6.0.13 (13-May-2011)

## Bug

    * [FC-2068] - Oracle library search in types.cfc needs a lower()
    * [FC-2465] - Objectadmin filtering: bad SQL Where clause for Oracle
    * [FC-2466] - User directory dropdown on login doesn't work
    * [FC-2467] - The objectadmin tag ignores the permissionset attribute
    * [FC-2469] - skin:loadCSS doesn't respect the media specified in skin:registerCSS
    * [FC-2470] - Errror when clicking Complete on Reflected Containers in Webtop
    * [FC-2471] - Javascript error when Imagesource field was a dmImage
    * [FC-2473] - Library picker doesn't work on forms using a developer specified prefix
    * [FC-2480] - Tabs do not work when managing friendly urls
    * [FC-2482] - Element MODE.AJAX is undefined in REQUEST (cssInHead)
    * [FC-2483] - Webtop redirect after login not working
    * [FC-2486] - Element URL.WEBTOPLOGIN is undefined in APPLICATION when trying to log into the webtop

## Improvement

    * [FC-2468] - Form spam protections doesn't work when the form is being cached in a reverse proxy
    * [FC-2478] - displayLibraryAdd and displayLibraryEdit need to look for an existing edit.cfm for the library object if libraryAdd.cfm/libraryEdit.cfm does not exist

# Version 6.0.14 (10-June-2011)

## Bug

    * [FC-487] - database error when repairing fileSize property of dmFile after upgrade
    * [FC-724] - After publishing a new Nav Node (with FUs activated), link to the page don't work until App Scope is updated.
    * [FC-726] - Copy Policy Group Does not apply permissions
    * [FC-864] - objectadmin: hitting enter in filter does not apply filter
    * [FC-973] - cache.cfm tag occasionally output Javascript/HTML, which breaks XML generation--need a suppress output option
    * [FC-1044] - Cannot create friendly URL's with nav items that have blank targets
    * [FC-1356] - Can't Upload File Larger Than 100MB Using the Flash Upload Tool
    * [FC-1797] - ERROR: "Element CONTAINERID is undefined in URL"
    * [FC-1955] - content type component inherited metadata incorrectly aggregated
    * [FC-2189] - Filtering - change default on Enter/Return key to Apply Filter rather than Clear Filter
    * [FC-2272] - Object admin filter problem when hitting enter/return
    * [FC-2490] - Bad default for ftLibraryDataTypename
    * [FC-2491] - In IE7 the action button bunch up and jump around on hover
    * [FC-2492] - 404 redirect fails
    * [FC-2496] - The url exit functionality of ft:processform bypasses onrequestend configs
    * [FC-2500] - When requesting approval, "All Approvers" isn't unselected when choosing a user
    * [FC-2501] - Error when displaying 404 and 500 templates under the project
    * [FC-2502] - checkPermission() in farBarnacle may grant access when a role has no explicit permission on any node in the tree

## Improvement

    * [FC-379] - buildLink.cfm:  XHTML-friendly output
    * [FC-439] - Unable to save multiple selection form values (object extended with an array property)
    * [FC-711] - formtools/datetime.cfc edit function: add switch to conceal time from user
    * [FC-1002] - buildlink: allow anchors in links
    * [FC-1043] - Add possibility to use content templates for dmNavigation when aObjectIDs is empty (/core/tags/navajo/display.cfm)
    * [FC-2132] - [Enter] key does not correctly send the default action (ie. first button) when submitting
    * [FC-2494] - In pagination tag call all pagination html as return variable
    * [FC-2499] - General arraylist improvements

## New Feature
    * [FC-930] - Add Formtool Metadata to Allow For New Library Option Only

## Task

    * [FC-1442] - image config: needs to be removed completely
    * [FC-1574] - Remove use of Prototype JS in farcryButton

Enjoy!

PS. you can always follow the latest FarCry Core activity here https://farcry.jira.com/browse/FC

Permalink | Leave a comment  »

Loading CSS and JS libraries

In dynamic CMS frameworks you often find yourself needing to load many different JavaScript or CSS libraries into a page. This becomes particularly complex when plugins enter the mix, needing to load libraries. In FarCry this problem is solved using skin:registerJS / skin:loadJS and skin:registerCSS / skin:loadCSS. The "load" tags tell FarCry to add libraries to a stack to be inserted into the head at the end of the request. The register tags make it easy to define a library in one place, then load them many places without redundant data. Added benefits of loadJS and loadCSS:

  • automatically minification
  • de-duping - libraries with the same id are only loaded once
  • overriding libraries - you can override a library defined in a plugin by re-registering it in your project
  • inline code - code between the open and closing tags is added to the end of the library, even if no actual files are specified
  • including multiple files in a single library


Here are some examples of how different libraries would be updated:


Example 1: 
<link media="screen" rel="stylesheet" type="text/css" href="/css/960.css">
/yourproject/config/_serverSpecificVarsAfterInit.cfm: 
<skin:registerCSS id="960" baseHREF="/css" lFiles="960.css" />
headerwebskin.cfm: 
<skin:loadCSS id="960" />

Example 2: 

<!--[if lt IE 7]>
<script type="text/javascript" src="/js/DD_belatedPNG_0.0.8a-min.js"></script>
<![endif]-->
/yourproject/config/_serverSpecificVarsAfterInit.cfm: 
<skin:registerJS id="png" condition="lt IE 7" baseHREF="/js" lFiles="DD_belatedPNG_0.0.8a-min.js" />
headerwebskin.cfm: 
<skin:loadJS id="png" />

Example 3: 

<script type="text/javascript" src="https://apis.google.com/js/plusone.js" ></script>
/plusoneplugin/config/_serverSpecificVarsAfterInit.cfm: 
<skin:registerJS id="plusone" lFiles="https://apis.google.com/js/plusone.js" />
plusonewebskin.cfm: 
<skin:loadJS id="plusone" />

If you look at a page's source now you will see HTML like this:
<!--
ID: 960
FILES: /css/960.css
-->
<link rel="stylesheet" type="text/css" href="/cache/960--1309753095000-C3608969AFF7EA8450DDC43B11362F20-D41D8CD98F00B204E9800998ECF8427E-D41D8CD98F00B204E9800998ECF8427E.css" media="screen" >

Combining libraries into a single file

Most web experts recommend that a website serve as few CSS and JS files as possible. FarCry's library loading functionality can take care of this too:

After converting all your libraries to use loadJS and loadCSS, review your source and make a note of the groups of files that can be combined. A typical example might be to combine jQuery with your site specific JavaScript.

Register these combined libraries in /yourproject/config/_serverSpecificVarsAfterInit.cfm:
<skin:registerJS id="combined-project" lCombineIDs="jquery,projectjs" />

Load this new library in your pages.
<skin:loadJS id="combined-project" />

If FarCry sees this combined library in the stack, it will automatically remove instances of it's child libraries.

Q&A
Q: Will the sequence of skin:loadJS calls be preserved by FarCry?
A: Yes, though loading a combined library overrides the position of any libraries it contains. Looking back at the example, if combined-project is loaded then any other attempts to load projectjs will be ignored.

Q: Are combined libraries minified too?
A: Yes. All CSS and JS libraries are minified.

Q: Can external libraries be combined with internal ones?
A: No, external libraries and internal libraries can't be mixed at this point.

Q: Are the media and condition attributes preserved in combined libraries?
A: No, a combined library needs to redefine all of the relevant attributes, including media and condition.


Cheers
Blair

Permalink | Leave a comment  »

The Tomek Tutorials

Recently stumbled across these excellent little tutorials from FarCry developer Tomek. 
The FarCry profiling API that became available with FC6.0.6 is a godsend for figuring out why some pages load slowly. For example, I have a couple of ‘displayTypeBody’ pages that load in 7 seconds, while normal HTML pages generally load in less than 0.3 seconds. Huge difference! 

Recently I was tasked with creating a “duplicate” button for the event type in FarCry. It turns out that while adding a button is actually easy, the hard part was ensuring that the rest of the default buttons didn’t disappear.

Recently, I have had the need to programmatically reload type metadata for a specific type in FarCry. Since I’m usually working on a dev copy on my laptop (which is underpowered), I don’t want to take the time to reset all the types together. This is especially useful if you need to do something similar...
Enjoy! 

Permalink | Leave a comment  »

Google Analytics plugin released

Ga-webtop-overview

Daemon has released its commercial plugin for Google Analytics to LGPL.  The GA plugin provides close integration for FarCry projects with the Google Analytics service.

While its easy enough to throw in an URCHIN and get google stats, the plugin takes care of hard to track clicks like external links and file downloads. Plus its easy to enforce the use of canonical URLs to make sure you're getting the right stats for your content. 

Features include:
  • webtop overview integration; showing stats for individual pages directly in the webtop
  • support for tracking file downloads and external link reporting
  • a framework for tracking Google custom variables
  • popular content publishing rule which draws down real time data direct from Google's data store
Documentation and installation instructions available:

Source code available in the Subversion repo here:

Stay tune for updates to address GA's latest changes.

Enjoy!

Permalink | Leave a comment  »

Reverse Proxy Caching and FarCry

FarCry already has various mechanisms for caching content. These make it easy to do things like cache some parts of a page and not others, have different timeouts for each, automatically expire caches if content changes, and so on. This is possible because the cache is managed in memory on the same server where the data is edited by administrators, and the HTML is generated by FarCry.

Where FarCry caching is a sophisticated and granular caching solution, a reverse proxy (RP) is the "big hammer" solution. One for complex and highly dynamic content, the other for overwhelming traffic and mostly static content.

Thus controlling RP caching is a different beast. It is simple and unwieldy, because it needs to perform well under high load. It is possible to create complicated caching strategies with an RP like Varnish, but we have gone with a simpler approach:

  • cache based on the s-maxage header in backend responses
  • clear a site's entire cache on GET /varnishpurge from an authorised IP address

This moves control of which pages get cached and for how long back to FarCry. But this is still fundamentally different to FarCry's internal caching options:
  • page caching strategy VS fragment caching strategy
  • cache refreshed on timeout VS refresh on timeout, or content change
  • cache by URL (and to a lesser extent cookies and user agent) VS cache by URL, form, user role, custom variables

Because of this we decided that it didn't make sense to try to extrapolate the RP cache timeout based on a projects existing config. Instead we added support for a new webskin decorator: @@proxyCacheTimeout [https://farcry.jira.com/wiki/display/FCDEV60/Cache+Headers]. This means developers will need to consciously decide which pages to cache and for how long.

Permalink | Leave a comment  »

< previous 1 2 next >