DeploymentManager Object

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.

Properties

CreateFolder(Wordbool, read-write)

Boolean property telling the deployment engine to create any missing folders on the target server.

EncryptCFML(Wordbool, read-write)

Boolean property telling the deployment engine to encrypt all CFML files.

FolderCount (Integer, read-only)

The count of folders associated with the current open project.

ForceLowerCase(Wordbool, read-write)

Boolean property telling the deployment engine to force lower-case filenames.

IsLocalDeployment(Wordbool, read-write)

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.

ServerCount (Integer, read-only)

The count of deployment servers associated with the current open project, including any new servers that have been added temporarily via the AddServer method.

UploadOnlyIfNewer(Wordbool, read-write)

Boolean property telling the deployment engine to only upload a file if it has a newer date/time stamp than the target file.

Methods

Server login failures result in an automatic cancellation of the deployment.

AddServer

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.

CheckServerFolders

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.

ClearServerList

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.

CopyFile

function CopyFile(const SourceFile: WideString; const TargetFile: WideString): Integer

Copies the source file to the target file location.

CopyFileExtended

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.

CreateDir

function CreateDir(PathName: WideString): Integer

Directory creation primitive, returns 0 for success, or RDS error code for failure.

FileExists

function FileExists(const sFileName: WideString): WordBool

Checks to see if a file exists.

GetDeployServerName

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.

GetDeployServerStatus

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.

GetDeployState

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.

GetDeployTargetName

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.

GetFolderDeployPath

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.

GetFolderFileCount

function GetFolderFileCount(const sFolderName:String): Integer

Returns the number of files tracked by the passed-in project folder name.

GetFolderFileExt

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.

GetFolderFileName

function GetFolderFileName(const sFolderName: WideString; nIndex: Integer): WideString

Returns the name of a folder file based on the passed folder name.

GetFolderName

function GetFolderName(nFolder:Integer): WideString

Returns the project folder name of the folder represented by the position index nFolder. Project folders are numbered consecutively.

GetLastErrorCode

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.

GetLastErrorMessage

function GetLastErrorMessage(): WideString

Tests the result of an UploadFile call by returning last associated RDS error message.

IsFolderDeployable

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.

OpenProject

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.

PathExists

function PathExists(const sFolderName: WideString): WordBool

Checks to see if a path exists.

SetDeployState

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.

SetLogFileName(sLogFileName:String)

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.

SetLogging

procedure SetLogging(bDoLogging: WordBool)

Turn logging on and off. This method only has an effect prior to opening a project for deployment.

UploadFile

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.

UploadProject

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.

Special notes about project folder names

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