Action
Modularization reduces the complexity of a system. More formally, we can define modularization as dividing any system into independent functional units to allow replacement and/or removal of these units.
ColdFusion in all its versions installed all components, such as, datasource, language, pdf, Solr, etc., by default. You did not have an option to pick and choose the component or package that you’d want, or to remove the package. This meant that a lot of packages were left unused if they are not related to your application(s), leading to unnecessary consumption of system resources.
In Adobe ColdFusion (2021 release), you can install ColdFusion features as packages for a specific purpose. For example, you want to execute oracle database operations, you can install the oracle package. You can also uninstall the package if it is not required in future. This means that you have a lightweight base version of ColdFusion and depending on your use, you can add or remove the packages. You need not restart ColdFusion for the changes to take effect.
You can install, remove, or update packages using these three ways:
In the ColdFusion Administrator, click Package Manager, and you can see the options to manage the packages.
The Packages page contains the following sections.
CORE SERVER
Check for updates to the core packages. Click the button Check for Updates and see a list of available updates.
INSTALLED PACKAGES
The Installed Packages section lists all packages that are already installed. Select a package and uninstall the package. You can also uninstall all the installed packages and check if any packge needs an update.
AVAILABLE PACKAGES
The Available Packages section lists packages that are not yet installed. Click Install All to install the packages simultaneously.
The Settings page contains the following options to specify update preferences such as update notifications or if to automatically check for updates.
If you have set up a local update site, you can also specify URL of that site to get updates.
Auto-Check
Click Auto-Check to see if any package updates are available for installation. You will receive a notification when a new update is available for download.
Notification
Provides options to specify update preferences such as update notifications or automatically check for updates.
Update Site
If you have set up a local update site, specify the URL of that site to get updates.
Packages Site
If you have set up a local site for packages, specify the URL to receive the updates.
Proxy Settings
If you host the packages on a server that is behind a proxy server, then provide these details:
Using the ColdFusion Package Manager (cfpm), you can install, uninstall, list all the packages that are currently installed and get the list of available ColdFusion packages, and much more.
Navigate to CFHOME/cfusion/bin and enter cfpm.bat
You are now in the cfpm prompt.
Command |
Description |
install PACKAGENAME[:VERSION] |
Installs a new package. If VERSION is not specified, then the latest version of the package will be installed. You can also specify comma-separated packages to install multiple packages. |
install ALL |
Installs all the packages available in the repo. |
update ALL | Updates the server hotfix and all the installed packages to the latest version. |
update packages |
Updates all installed packages to the latest versions. |
uninstall ALL |
Uninstalls all packages that were installed. |
uninstall PACKAGENAME |
Uninstalls a package from the system. You can specify comma-separated packages to uninstall the packages. |
list |
Lists all installed packages. |
listall |
Lists all available packages in the repo. |
info PACKAGENAME |
Prints the package-related information on the console. |
help |
Prints the usage of all commands on the console. |
scan CODEBASEPATH CFSERVERURL |
Scans code at the given PATH and finds all packages to be installed. |
scanandinstall CODEBASEPATH CFSERVERURL |
Scans code at the given PATH and installs all required packages. |
downloadrepo DOWNLOAD_PATH |
Clones the repository of the packages to the specified path. |
q or quit |
Exits the cfpm console. |
cls or clear |
Clears the cfpm console. |
purgecache | Purges the Felix cache. Felix stores all installed bundles into a bundle cache directory. By default, Felix creates a cache directory, called felix-cache, in your current working directory. For more information, see Apache Felix framework. Run this command to clear the bundle cache. You must stop ColdFusion server, run purgecache, and then restart ColdFusion. |
export EXPORT_FILEPATH | Exports all the installed packages to a file. |
import IMPORT_FILEPATH | Imports all the specified packages in the file into the server. |
In the prompt, type help and enter. You can see the following options:
To see the information about a package, enter the following command:
info <moulename>
For example, if you view the information about the package pdf and its dependencies, enter
info pdf
If a package is not installed, the information about it will be colored yellow. In this example, cfmongodb isn't installed, so the information shows up in yellow color.
In the prompt, to see the list of all packages that are installed, enter list.
You can see the list of packages, as shown below:
In the prompt, to see the list of available packages in the package repository, enter listall.
The packages that are installed are in green.
To install a package, enter the name of the package after install, for example,
install <package_name>
For example, to install Azure Blob, enter the command below:
install azureblob
You can also specify a comma-separated list of packages after install, for example,
install <package1>,<package2>,<package3>,…
If the package being installed has any other dependent packages, it automatically installs them as well.
You can also specify the version of the package while installing the package.
cfpm>install package:version
To uninstall a package, enter the name of the package after uninstall, for example,
uninstall <package_name>
Uninstalling a package does not uninstall its dependent packages. You must uninstall the dependent packages manually.
You can uninstall packages in their order of dependent packages.
For example, to uninstall Azure Blob, enter the command below:
uninstall azureblob
ColdFusion is modularized and only contains the core by default. It can be pretty difficult task to identify the list of packages that must be installed in order to run the application successfully.
The code scanner comes to the rescue and automatically scans through the specified code base and returns the list of required packages to be installed.
Enter the following command:
scan <path_to_your_code_base> http://[CF_SERVER_HOST]:port
In addition, you can scan the code base and install the recommended packages in one go as well. Enter the following command:
scanandinstall <path_to_your_code_base> http://[CF_SERVER_HOST]:port
For example, scanandinstall <code_base/wwwroot/cfm> http://localhost:8500.
It may happen that you may be behind a firewall or do not have an active internet connection, which results in packages not getting installed.
In this release, we’ve introduced the command downloadrepo, using which you can download the complete repo (all packages) to a specified location and host it on any web server locally.
Enter the command:
downloadrepo <path_to_repo>
For example, downloadrepo C:\packagerepo.
Once the repository is downloaded and hosted on the web server. It can be used by ColdFusion server to act as the online repository. You can switch the repository location using the ColdFusion administrator.
Steps to use the local repository:
Export the current state of a server. It can be imported to another instance of another ColdFusion instance or server.
For example,
cfpm>export C:\packages.txt
The contents of the file are shown below:
# #Thu Sep 17 13:41:19 GMT+05:30 2020 server_hotfix_updatelevel=0 packages=awssqs\:2021.0.0.322293,awssns\:2021.0.0.322293,azureservicebus\:2021.0.0.322293,awsdynamodb\:2021.0.0.322293,pdf\:2021.0.0.322293,felixclassloader\:2021.0.0.322293,report\:2021.0.0.322293,awss3\:2021.0.0.322293,document\:2021.0.0.322293,image\:2021.0.0.322293,chart\:2021.0.0.322293,spreadsheet\:2021.0.0.322293,presentation\:2021.0.0.322293,adminapi\:2021.0.0.322293,administrator\:2021.0.0.322293
Import the state of server from a file to install all packages that are mentioned in the file being imported.
For example,
cfpm>import C:\packages-to-import.txt
In this section, we shall discuss a few package update workflows where you will upgrade or downgrade core verion or packages. Here are some instances when you'll update or downgrade a package.
For example,
Note: When you install ColdFusion using the GUI installer, the by default, all packages are installed, which are updated to the latest version of ColdFusion.
Action |
ColdFusion Package Manager |
ColdFusion Administrator |
---|---|---|
Update a single package |
|
In the section Installed Packages, select a package, and in the Available Versions drop-down, choose the version that you want to update to. |
Update multiple packages |
|
NOT SUPPORTED |
Update all packages |
|
NOT SUPPORTED |
For updating or downgrading the core server or packages, use the command,
install <package name>:<lower package version>
For example, you have installed the package chart v2021.0.0.323100, which depends on the latest core package. Now you want to downgrade the package to v2021.0.0.323099, which depends on the previous version of the core package.
Then, use the command- install chart:2021.0.0.323099
The command will
It is easier to automate the process of package installation or uninstallation using the CFPM non-interactive mode.
Open the command prompt, navigate to the coldFusion/cfusion/bin folder, and enter:
cfpm COMMAND ARGUMENTS
For example: C:\ColdFusion\cfusion\bin>cfpm install <package_name>
The docker image accepts two environment variables:
Sign in to your account