Difference between revisions of "Load ADF Components into Site"

From ADF Docs
Jump to: navigation, search
(Load ADF Library Components into a Site)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Load ADF Library Components into a Site ==
+
== Overview ==
Loading the ADF Library components into the site is controlled in the [[Site Configuration]].
+
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)]].
  
To enable the full ADF Library components automatically loaded into the sites ''application.ADF'' scope, follow the instructions for [[Site_Configuration#ADF_Library_Components|ADF Library Components]]. '''Note''': this will load the '''most recent versions''' of the ADF Library component. 
+
== 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:
 +
# Create a /lib/ directory within you sites /_cs_apps/ directory (e.g. /mySite/_cs_apps/lib/)
 +
# Copy the original ADF Library Component into that /lib/ directory (e.g. /mySite/_cs_apps/lib/csData_1_0.cfc
 +
# 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]]
  
To load a specific version of an ADF Library component into the sites ''application.ADF'' scope, follow the instructions for [[Site_Configuration#ADF_Library_Components_Overrides|ADF Library Components Overrides]]. 
+
== What does this mean? ==
 
+
By making this modification, any code within your site that uses code similar to this:
 
+
<source lang="cfm">
 
+
   <cfset myData = application.ADF.csData.getStandardMetadata(pageID)>
 
+
</source>
 
+
Will use the component located within your /_cs_apps/lib/ directory instead of the one located in the /ADF/lib/ directory.
ADF Library components are automatically loaded into the sites ''application.ADF'' scope
 
 
 
 
 
Following are instructions to load the ADF library components into a sites ''application.ADF'' scope:
 
 
 
# Open the ''ADF.cfc'' in the sites "_cs_apps" directory.
 
# Locate the ''Define the ADF components...'' section at the top of the file.
 
# 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).
 
# Here is a sample for adding the ''Scripts_1_0'' ADF library component into the ''application.ADF.scripts'' variable:
 
   application.ADF["scripts"] = server.ADF.objectFactory.getBean("scripts_1_0");
 
 
 
The scripts component is now accessible via application scope for the site.
 
  application.ADF.scripts
 
 
 
See the [[Site_Configuration#ADF_Library_Components|Site Configuration - Library Components]] wiki page for more details.
 
 
 
== Related Guides ==
 
* [[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.