Creating Farcry Libraries

This documentation is no longer accurate (was relevant for the beta release only) and needs to be updated.

Folder Structure

You should have a folder at the same level at the farcry_core folder called farcry_lib.
Create a folder for your library under this folder.

Each library has the standard set of folders that you see under a project

  • farcry_core
  • farcry_lib
    • mylibrary
      • config
        • install
      • customadmin
      • includeObj
      • packages
        • rules
        • types
      • tags
      • webskin
      • www

Under config is an install folder. During the install process, using the install folder in the mollio default site, any and all scripts in this folder will be executed in alphabetic order.

Admin Config

In farcry 3.x links to custom content was done by adding a link to a /farcry/admin/customadmin?module=typename/list.cfm etc.
For libraries you follow the same procedure, but also need to include the url param "lib". lib should contain the name of the folder that contains your library eg. lib=mylibrary&mytype/list.cfm

Here's an working example:

<?xml version="1.0" encoding="utf-8"?>
<webtop>
	<section id="polltab" permission="PollAdmin" label="Poll Admin">
		<subsection id="polladmin" permission="PollAdmin" content="admin/customadmin.cfm?lib=poll&amp;module=pwPoll/list.cfm" label="Poll Admin">
			<menu label="Polls">
				<menuitem label="List Polls" link="admin/customadmin.cfm?lib=poll&amp;module=pwPoll/list.cfm" />
			</menu>
		</subsection>
	</section>
</webtop>

NOTE remember that in XML you must use html encoded special characters, so & becomes & otherwise your XML will fail muster.
PS. Andrew - hope you don't mind I've been abusing your pwPoll plugin to work out how libraries work

Using files in the www folder.

To use any files in the www folder simply map a virtual directory or alias to this folder from within your chosen web server.