919 - 926 - 9847

Next up on deck... My First FarCry lib!

I'll add to this post, hopefully to completion, tomorrow. At one point, I had a fairly decent mass mailer set up in FarCry 2.x/3.x. I left that employer but still have most of the code required. It was a modification of the dmEmail object to allow for the a list of emails to be inserted into a variable via CFFILE. You'd upload the list to the server, then import said list to an array.

So, I'm working on site for my son's preschool, and it would be helpful to have similar functionality. But, with a twist. I want the library to capture emails into subscription pools, then use these pools to send out the various emails. The idea being that those looking to get updates from the preschool will join one (or more) of the mailing lists, then receive updates based on the list that was joined. I'll be placing this into the new FarCry 4.0 library feature and making the code available here, and on the FarCry lists/wiki.

Update: I've seriously underestimated this task. Much has changed under the hood of FarCry that I'm only just getting back into. At the moment, the extension to formtools has been created. Dang is that a cool new feature ;). I've got the main display item for Mass Mail distribution 90% complete. But, I've run into an issue of making aObjectIDs for the underlying list emails that gets called. This has REALLY changed, and will take a little more time to deconstruct. It's late, I'm off for now.

Update2: Please bear with me. There's not much going to be accomplished today. I'll try finishing up tonight, but we'll take the day as it comes.

Installing FarCry as a virtual site in IIS

This is specific to the FarCry 4.0 release. At the time of this writing, you can grab it from http://www.jeffcoughlin.com/?pg=11. From this site, be sure to get farcry_core, fourq, farcry_mollio, farcry_lib.farcrycms.

First, our directory structure. Unzip the zips into
C:\farcry40\farcry_core
C:\farcry40\fourq
C:\farcry40\farcry_mollio
C:\farcry40\farcry_lib\farcrycms

You will need to create a project folder. Create a copy of farcry_mollio, and place it into either: C:\farcry40\somesite Or C:\websites\somesite

If the folder is placed outside of the FarCry root, additional steps will need to be followed. Those steps will be listed below. Follow the steps below to complete the installation. Please note that the folder paths used are merely provided as an example.

  1. Open the IIS administrator. Add the virtual site somesite off of your main domain website. Eg. Mainsite.com/somesite. To do this, right click the website to modify, and click New->Virtual Directory.
  2. Fill in the Alias as somesite, click Next. Path will be either C:\farcry40\somesite\www, or the optional folder outside of farcry at C:\websitse\somesite\www.
  3. Choose access permissions as appropriate for your environment. Click Next then Finish to continue.
  4. Create a new virtual directory in a similar fashion for farcry. Right click the newly created somesite folder and click New->Virtual Directory. The alias is farcry and the path is C:\farcry40\farcry_core\admin.
  5. Create a new database user/schema/database/etc to hold the FarCry table information. This document is database agnostic, and assumes the user has some means of affecting these changes. Regardless, FarCry should have its own schema/database to reside in.
  6. Log into the ColdFusion (CF for short) administrator and create mapping for a logical path of /farcry and directory path of C:\farcry40.
  7. Optional - if the project folder is outside of the FarCry folder, create a mapping for a logical path of /farcry/somesite and a directory path of C:\websites\somesite.
  8. Create a new CF datasource called somesite_farcry pointing to the database/schema created in step 5.
  9. And, this was submitted to the FarCry list... change somesite\www\install\FlightCheck.cfc to:
    <cfinclude template="/#arguments.siteName#/install/ping/index.cfm" />
  10. At this point you should now be ready to run the FarCry installation scripts. Open a browser to mainsite.com/somesite/install. If running from somewhere other than localhost, be sure to edit C:\farcry40\somesite\www\install\Application.cfm (or C:\websites\somesite\www\install\Application.cfm) to reflect your IP.
  11. Fill in the required fields. The application name must match the folder name you've created. In this case it is somesite. Fill in the DSN name, and the database type. The website mapping should be /somesite and the FarCry mapping should be /somesite/farcry. Choose to install the farcrycms library, and if in production, remove the installation folder.
  12. At this point, everthing should be ready to go. Click Install and watch the output of the screen. If any errors occur, either report them back to the FarCry mailing list, or investigate where the installer indicates there to be a problem.
  13. Add this line to somesite\config\_serverSpecificVars.cfm: <cfset application.url.webroot = "/somesite">

FarCry installation on a linux/Plesk shared host

First, just a little “this is WHY we do this” (and only a little, I promise!).  Everyone seems to get a touch freaked out when going over the FarCry install and its various mappings.  The thing to keep in mind is that the mappings and folder structure exist because FarCry relies heavily upon CFCs and extension of these CFCs.  Even your site, eg. “Project”, relies upon being able to map to these CFCs in a preordained fashion.  The easiest way to pull this off is to have everything reside inside the main FarCry root.

Now, that was the 3.0 and lower builds.  FarCry 4.0 introduced the ability to have the “Project” folder reside completely separately from the FarCry core.  Or, at least that’s my understanding from the new features document.  I’ve not tried this with 3.x (but I do have another method for that!)  Anyway, if this is done, you must make sure that you create a CF mapping to these files in a way that FarCry can reach them.  Since FarCry assumes that the “Project” folder resides in the FarCry root, you need to make a CF mapping that imitates that.  Thus, you need to make the normal CF mapping for FarCry (something like /farcry c:\farcry40) and a mapping to your site, pre-pending farcry to it (/farcry/somesite c:\websites\somesite).  This mapping MUST match what you called the site when installing FarCry.  So, a call to farcry.somesite.whatever will work correctly.  All is good with the universe.

So let’s do an example of this for FarCry 4.0 and the linux shared host out on the interweb using Plesk. 

  1. Upload FarCry (and all of it’s supporting libraries farcry_core, fourq, farcry_lib) to one of your domains httpdocs directory.  Doesn’t matter which, really.  One you know will not be deleted.  Ever.
    eg /home/httpd/vhosts/mainsite.com/httpdocs/farcry40
  2. Ask the CF admin of your box to create a CF mapping like:
    /farcry /home/httpd/vhosts/mainsite.com/httpdocs/farcry40
  3. Upload the mollio template (renamed to somesite) to the domain that will be hosting a FarCry site:
    /home/httpd/vhosts/somesite.com/httpdocs/somesite
  4. Ask the CF admin of your box to create a CF mapping like:
    /farcry/somesite /home/httpd/vhosts/somesite.com/httpdocs/somesite
  5. Now, this is really, REALLY handy.  Ask the CF admin to create a vhost.conf file for your somesite domain.  This file will never be over written by Plesk and can be used to override the values Plesk sets.  The file should contain:
    DocumentRoot "/home/httpd/vhosts/somesite.com/httpdocs/somesite/www"
    Alias /farcry /home/httdp/vhost/mainsite.com/httpdocs/farcry40/farcry_core/admin
  6. Create a database to hold your FarCry information, and ask the CF admin to create DSN pointing to this database
  7. Once Plesk gets restarted, browse to www.somesite.com/install and fill in the values as required.  App name in this case is “somesite”, and the project web mapping and farcry web mapping should not be changed.  Click install once all fields are complete
  8. Repeat per domain as necessary. Make sure everyone and every group can write into the FarCry plp and tmp directories.

Now let’s do an example of this for FarCry 3.1 and the linux shared host out on the interweb using Plesk

  1. Upload FarCry (and all of it’s supporting libraries farcry_core, fourq) to one of your domains httpdocs directory.  Doesn’t matter which, really.  One you know will not be deleted.  Ever.
    eg /home/httpd/vhosts/mainsite.com/httpdocs/farcry31
  2. Ask the CF admin of your box to create a CF mapping like:
    /farcry /home/httpd/vhosts/mainsite.com/httpdocs/farcry31
  3. Upload the mollio template (renamed to somesite) to the farcry31 directory:
    /home/httpd/vhosts/mainsite.com/httpdocs/farcry31/somesite
  4. Now, this is really, REALLY handy.  Ask the CF admin to create a vhost.conf file for your somesite domain.  This file will never be over written by Plesk and can be used to override the values Plesk sets.  The file should contain:
    DocumentRoot "/home/httpd/vhosts/mainsite.com/httpdocs/farcry31/somesite/www"
    Alias /farcry /home/httdp/vhost/mainsite.com/httpdocs/farcry31/farcry_core/admin
  5. Create a database to hold your FarCry information, and ask the CF admin to create DSN pointing to this database
  6. Once Plesk gets restarted, browse to www.somesite.com/farcry/install and fill in the values as required.  App name in this case is “somesite”, and the project web mapping and farcry web mapping should not be changed.  Click install once all fields are complete
  7. Repeat per domain as necessary.  Make sure everyone and every group can write into the FarCry plp and tmp directories.  Make sure everyone and every group can read farcry directories.

The end! I much prefer the first method since it means each domain has its own files reside within the normal directory struture. Much more secure, much easier to manage. Better all around.