The DeploymentManager VTOM object is a scriptable interface into the Allaire Project Deployment engine. It provides a collection of methods and properties to allow you to write highly customized VTOM scripts to control the deployment process.
Boolean property telling the deployment engine to create any missing folders on the target server.
Boolean property telling the deployment engine to encrypt all CFML files.
The count of folders associated with the current open project.
Boolean property telling the deployment engine to force lower-case filenames.
Allows you to perform a local deployment by overriding the assigned deployment server list. Instead the actual deployment path names assigned to the folders are used directly.
The count of deployment servers associated with the current open project, including any new servers that have been added temporarily via the AddServer method.
Boolean property telling the deployment engine to only upload a file if it has a newer date/time stamp than the target file.
Server login failures result in an automatic cancellation of the deployment.
procedure AddServer(const sServerName:WideString,ITServerType:Integer)
Allowed ITServerType values are:
1=FTP 2=RDS
Temporarily add a machine level server to the list of deployment servers. This server does not become part of the Project's stored Deployment Server list, but is only added temporarily for custom deployment tasks.
procedure CheckServerFolders(sServerName: WideString);
Inserted in the generated VBScript/JScript deployment scripts at the appropriate points, it iterates through all of the assigned deployment folders for a project, verifying their existence on the target server (sServerName
). If a folder does not exist, it is created.
Older scripts that do not contain the CheckServerFolders
call will still work. The CreateFolder DeploymentManager
property gets passed to the internal CopyFileExtended
call and tells FileProxy
to create any directories that do not exist.
procedure ClearServerList()
Clears the internal list of servers assigned to the project. This method can be used when you want to override the default project deployment server list.
function CopyFile(const SourceFile: WideString; const TargetFile: WideString): Integer
Copies the source file to the target file location.
function CopyFileExtended(const SourceFile: WideString; const TargetFile: WideString; CreateFolder: WordBool; UploadOnlyIfNewer: WordBool; EncryptCFML: WordBool): Integer
Copies the source file to the target file location and provides additional arguments.
function CreateDir(PathName: WideString): Integer
Directory creation primitive, returns 0 for success, or RDS error code for failure.
function FileExists(const sFileName: WideString): WordBool
Checks to see if a file exists.
function GetDeployServer(nServer:integer): WideString
Returns the name of the server in the server list based on the index nServer. The internal server list array starts from a zero base.
function GetDeployServerStatus(nServer:integer):WideString
Returns the index of the server in the server list based on the index nServer. The internal server list array starts from a zero base.
procedure GetDeployState(sServerName:WideString): WordBool
Queries a specific deployment server to determine if it is enabled for deployment. GetDeployState is passed the server name as sServerName and returns a WordBool True or False result.
function GetDeployTargetName(const sServerName:Widestring, const sFolderName:Widestring, nFileIndex:Integer): WideString
Calculates the target deployment file name using the passed-in server name, and folder name, and an integer representing the folder file to use. This method is mainly used when you are iterating through all of the existing files in a folder. It calculates a server file target path, such as "Rds://localhost/D:/main/images/TestImage.jpg" which can be passed as the second argument to the UploadFile method.
function GetFolderDeployPath(const sFolderName:String): WideString
Returns the deployment path of the passed folder name. This path can be used in conjunction with the GetDeployServer and GetFolderName methods.
function GetFolderFileCount(const sFolderName:String): Integer
Returns the number of files tracked by the passed-in project folder name.
function GetFolderFileExt(const sFolderName: WideString; nIndex: Integer): WideString
Returns the extension of a folder file based on the passed folder name. See "Special notes about project folder names" for details.
function GetFolderFileName(const sFolderName: WideString; nIndex: Integer): WideString
Returns the name of a folder file based on the passed folder name.
function GetFolderName(nFolder:Integer): WideString
Returns the project folder name of the folder represented by the position index nFolder. Project folders are numbered consecutively.
function GetLastErrorCode(): Integer
Tests the result of an UploadFile call by returning last error code as an integer. Both GetLastError methods can be used to programmatically abort a script or provide other forms of rudimentary error handing.
function GetLastErrorMessage(): WideString
Tests the result of an UploadFile call by returning last associated RDS error message.
function IsFolderDeployable(const sFolderName:WideString): WordBool
Returns the deployment status of the passed folder name. This method can be used to skip folders that have been designated as "Do Not Deploy" folders.
procedure OpenProject(const sProjectName: WideString)
Opens the project specified in the passed OleString. The project specification must be a fully qualified path to the existing project file.
function PathExists(const sFolderName: WideString): WordBool
Checks to see if a path exists.
procedure SetDeployState(sServerName:WideString,bServerStatus: WordBool)
Enable/disables the deployment server specified by sServerName during deployment. This allows some servers to be turned on or off during the deployment process.
procedure SetLogFileName(sLogFileName: String)
Change the name of a generated deployment log file. The default name is "Deployment.log" and its default location is the visual tool's main installation directory. Specify a fully qualified path and file name.
procedure SetLogging(bDoLogging: WordBool)
Turn logging on and off. This method only has an effect prior to opening a project for deployment.
procedure UploadFile(const sFile:Widestring, sTargetFile: WideString)
Uploads an individual file to the server. The first OleString represents the fully qualified path of an individual file to upload. The second OleString represents the fully qualified target name, such as rds://localhost/main/index.html.
procedure UploadProject(const sProjectName: WideString)
Uploads an entire project based on the fully qualified project name passed as an OLE string. This triggers the default deployment engine processing loop which iterates through each server assigned to the project, each folder within the project, and uploads all the files contained within each folder. Note that any folders that have been configured as "Do not deploy" folders will be skipped during this process.
Project folder names are stored in the following format: Project/Folder/Subfolder1[/SubFolder2... SubFolderN], where:
To use any of the existing Folder-related DeploymentManager VTOM calls, you must pass the fully qualified folder name starting from the project name itself. For example, if you have a project called Project1, and you have a Main folder which contains and Images folder and you wanted to retrieve the count of how many files you had in the images folder, the proper call would be:
ICount = GetFolderFileCount("MyProject/Main/Images"); // Returns count of files in Images