Facebook v1.2 Install
Download the Facebook Application from the Community Site or from the SVN Repository.
Extract the zip file into your /ADF/apps/ folder. A subfolder called facebook will be created and will include all the code and the custom elements ready to be imported from the /ADF/apps/facebook/exported-objects/ folder.
The Facebook Application is built within the ADF. The ADF must be installed in the site to run the Facebook App, follow the ADF Installation instructions.
- Make sure the ADF is setup and running on the site. If the ADF is not setup, then follow the instructions for ADF Installation.
- Open the site's 'ADF.cfc' (See Site Configuration (ADF.cfc) for more info) file (located in your site's /_cs_apps/ directory) in a text editor. Locate the Load the ADF Application into application space comment in the file. Add (or uncomment) the following command under the comment section:
- Reset the ADF for the server and site.
Import Custom Elements
The Facebook Application has several Custom Components defined within CommonSpot. The components have been exported and are available in the app's "exported-objects" folder located at the root of the Facebook application directory (e.g. /ADF/apps/facebook/exported-objects/).
Optional: You may want to create a new category within the CommonSpot Element Gallery for 'Facebook Elements'.
To import these objects, you will need to be an administrator for your site. If you are not a site administrator, consult your Server administrator for more information.
Follow these steps to import the Custom Elements:
- Go to your site's admin.cfm (CommonSpot's Site Administrator).
- Expand the 'Elements & Forms' tab and click on 'Elements'.
- In the Manage Elements screen click on 'Manage Categories'.
- Now click the 'Add New Category' link and create a 'Facebook Elements' category.
- Close the 'Manage Element Categories' screen.
- Back in the 'Manage Elements' screen click on the 'Import Custom Element' link.
- Now click on 'Browse...' and go to the /ADF/apps/facebook/exported-objects/ folder
- Click on one of the ZIP files to import that custom element.
- Be sure to choose your new 'Facebook Elements' category
- Click Next.
- Repeat steps 7-10 for other custom elements in the exported-objects folder.
Now you can import the Custom Fields:
- Go to your site's admin.cfm (CommonSpot's Site Administrator)
- Expand the 'Elements & Forms' tab and click on 'Field Types and Masks'
- In the Field Types and Masks screen click on 'Import Custom Field Type'
- Now click on 'Browse...' and go to the /ADF/apps/facebook/exported-objects/
- Click on the zip file that's name starts with 'Post-to-Facebook-Page-Custom-Field-Type-…"
- Click Next.
The imported components' render handlers must be verified. During the import process, the render handler paths may have been changed to reflect the current site's path.
Review and update these paths to reference the ADF path. In most cases, this will just require to be unlocked and a change in the path from the site name to 'ADF'.
The Facebook App uses an XML file to store site specific configurations. The Facebook App needs to know your Facebook application's Application ID and Application Secret.
Don't worry you will not have to write a single line of code to use Facebooks API's, we just need to add those values to the configuration XML file in any text editor (like Notepad).
There are two components in the configuration XML file (/ADF/apps/facebook/site-files/_cs_apps/config/), both can be found on your Facebook app's properties on this page:
- appID - Listed as Application ID.
- appSecret - Listed as Application Secret.
Once your configuration XML file (facebook.xml) has been updated with the correct values, move the XML file to the /cs_apps/config/ folder. Reset the ADF for the server and site.