FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

DPD DE CFML

v0.1.1 Modules

DPD DE CFML

DPD DE CFML provides a wrapper for DPD DE functionality. At present, the module only includes access to SFTP file download for tracking events.

Installation

box install dpddecfml

Examples

Check out the /examples folder for an example.

Usage

The DPD DE CFML wrapper consists of a single model to manage the connection to the DPD SFTP server to download and process tracking event files. The wrapper may be used standalone, or as a ColdBox module.

Standalone

	DPDDEEvents = new models.events(
			sftpUsername 	= 'accountnumber'
		,	sftpKeyFile 	= 'path/to/keyfile.ppk'
	);

ColdBox

DPDDEEvents 	= getInstance("events@DPDDECFML");

alternatively inject it directly into your handler

property name="DPDDEEvents" inject="events@DPDDECFML";

When using with ColdBox, you'll want to insert your authentication details into your module settings:

DPDDECFML = {
		sftpUsername 	= getSystemSetting("DPDDE_SFTPUSERNAME", "")
	,	sftpKeyfile 	= getSystemSetting("DPDDE_SFTPKEYFILE_PATH", "")
}

Retrieve tracking event data

Tracking event files are uploaded to the DPD SFTP server every 20 minutes or so. The events component can be used to list, download and process these files.

fileList = DPDDEEvents.getFileList();
fileContents = DPDEvents.processRemoteFiles(
		dateRange 			= '2021-01-01,2021-01-31'
	,	removeFromServer 	= false
);

Author

Written by Gary Stanton.
https://garystanton.co.uk

$ box install dpddecfml

No collaborators yet.
 
  • {{ getFullDate("2022-01-18T14:29:27Z") }}
  • {{ getFullDate("2022-01-19T15:26:20Z") }}
  • 813
  • 11