Difference between revisions of "Load ADF Components into Site"

From ADF Docs
Jump to: navigation, search
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Load ADF Library Components into a Site ==
+
== Overview ==
Following are instructions to load the ADF library components into a sites ''application.ADF'' scope:
+
By default, when you configure a site to use the ADF, the latest version of all of the [[Library| ADF Library Components]] are loaded into the sites application.ADF memory space. Loading the ADF Library components into the site is controlled in the [[Site Configuration (ADF.cfc)]].
  
# Open the ''ADF.cfc'' in the sites "_cs_apps" directory.
+
== Load specific version of ADF Library Component ==
# Locate the ''Define the ADF components...'' section at the top of the file.
+
To load a specific version of an ADF Library component into the sites 'application.ADF' scope you need to:
# Set an ''application.ADF'' structure to the ADF library component with the structure key as the short name for the component (name without the version numbers).
+
# Create a /lib/ directory within you sites /_cs_apps/ directory (e.g. /mySite/_cs_apps/lib/)
# Here is a sample for adding the ''Scripts_1_0'' ADF library component into the ''application.ADF.scripts'' variable:
+
# Copy the original ADF Library Component into that /lib/ directory (e.g. /mySite/_cs_apps/lib/csData_1_0.cfc
  application.ADF["scripts"] = server.ADF.objectFactory.getBean("scripts_1_0");
+
# Change the copied file so that it extends the original
 +
<source lang="cfm">
 +
  <cfcomponent extends="ADF.lib.csData.csData_1_0">...</cfcomponent>
 +
</source>
 +
# Remove any methods you DO NOT WISH TO MODIFY
 +
# Make modifications to the methods you would like to change
 +
# Follow the instructions for [[Site Configuration (ADF.cfc)]].
 +
# [[Reset the ADF]]
  
The scripts component is now accessible via application scope for the site.
+
== What does this mean? ==
   application.ADF.scripts
+
By making this modification, any code within your site that uses code similar to this:
 
+
<source lang="cfm">
See the [[Site_Configuration#ADF_Library_Components|Site Configuration - Library Components]] wiki page for more details.
+
   <cfset myData = application.ADF.csData.getStandardMetadata(pageID)>
 
+
</source>
== Related Guides ==
+
Will use the component located within your /_cs_apps/lib/ directory instead of the one located in the /ADF/lib/ directory.
* [[Installation|ADF Installation]]
 
* Adding Site Level Components (non application)
 
  
 
[[Category: How-to Guide]]
 
[[Category: How-to Guide]]

Latest revision as of 04:50, 15 April 2010

Overview

By default, when you configure a site to use the ADF, the latest version of all of the ADF Library Components are loaded into the sites application.ADF memory space. Loading the ADF Library components into the site is controlled in the Site Configuration (ADF.cfc).

Load specific version of ADF Library Component

To load a specific version of an ADF Library component into the sites 'application.ADF' scope you need to:

  1. Create a /lib/ directory within you sites /_cs_apps/ directory (e.g. /mySite/_cs_apps/lib/)
  2. Copy the original ADF Library Component into that /lib/ directory (e.g. /mySite/_cs_apps/lib/csData_1_0.cfc
  3. Change the copied file so that it extends the original
  <cfcomponent extends="ADF.lib.csData.csData_1_0">...</cfcomponent>
  1. Remove any methods you DO NOT WISH TO MODIFY
  2. Make modifications to the methods you would like to change
  3. Follow the instructions for Site Configuration (ADF.cfc).
  4. Reset the ADF

What does this mean?

By making this modification, any code within your site that uses code similar to this:

  <cfset myData = application.ADF.csData.getStandardMetadata(pageID)>

Will use the component located within your /_cs_apps/lib/ directory instead of the one located in the /ADF/lib/ directory.