Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garystanton/dpdde-cfml
https://github.com/garystanton/dpdde-cfml
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/garystanton/dpdde-cfml
- Owner: GaryStanton
- License: mit
- Created: 2022-01-18T14:56:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-19T15:26:28.000Z (almost 3 years ago)
- Last Synced: 2024-05-16T16:58:12.572Z (6 months ago)
- Language: ColdFusion
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```js
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
```cfc
DPDDEEvents = new models.events(
sftpUsername = 'accountnumber'
, sftpKeyFile = 'path/to/keyfile.ppk'
);```
### ColdBox
```cfc
DPDDEEvents = getInstance("events@DPDDECFML");
```
alternatively inject it directly into your handler
```cfc
property name="DPDDEEvents" inject="events@DPDDECFML";
```When using with ColdBox, you'll want to insert your authentication details into your module settings:
```cfc
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.```cfc
fileList = DPDDEEvents.getFileList();
``````cfc
fileContents = DPDEvents.processRemoteFiles(
dateRange = '2021-01-01,2021-01-31'
, removeFromServer = false
);
```## Author
Written by Gary Stanton.
https://garystanton.co.uk