JSON Import Implementation¶
Note
In the following documentation, replace the terms {JSONshare} and JSONshare with the corresponding folder name in DropBox that is used for file exchange.
Update Windows Workstations¶
Although WARES runs entirely from a server fileshare, using Dropbox for file exchange will require administrative changes for each computer or user who will perform a Dropbox exchange.
Mount Dropbox in User Space¶
For every user requiring access to a Dropbox share, follow this link to the Dropbox installer to add Dropbox to their user path.
Commands to Link a Folder¶
Search for CMD.EXE on your start menu, and right-click to select “Run as Administrator.” In the DOS command window, type the following commands to set a permanent link to a shared Dropbox folder: [1]
mkdir C:\Dropbox
mklink /J "C:\Dropbox\{JSONshare}" "%userprofile%\Dropbox\{JSONshare}"
dir C:\Dropbox\{JSONshare}
Note
The mklink command works with WINDOWS Vista and higher, and Windows must have been installed using file system NTFS. Links may also be created with the command:
fsutil hardlink create "C:\Dropbox\{JSONshare}" "%userprofile%\Dropbox\{JSONshare}"
If you are using WindowsXP it is probably time for an upgrade. Call for advice on Windows upgrades.
Add JSON Import to WARES¶
Add JSON Import Features¶
Use the instructions from topic Update Patches files to install patch sets JSON and JSONIMPORT. WARES will also require account customization as described following. (These changes may be forwarded in site-specific patch sets.)
Configure WARES Pathnames¶
WARES saves import and export configuration data in control records. Use menu selections eXchange ‣ Export-Import ‣ Exports and eXchange ‣ Export-Import ‣ JSON Imports to access control records and change path settings.
Control Name | Entry Label | Entry values to check |
---|---|---|
JSONIMPORT
ORDERS
|
Export FileName
Export Directory
History Directory
|
null
C:\DROPBOX\{share}\ORDERS\
C:\DROPBOX\{share}\ORDERS\HISTORY\
|
EXPORT
JSONSHIPPERS
|
Export FileName
Export Directory
History Directory
|
{PO_NUMBER}
C:\DROPBOX\{share}\SHIPPERS\
null
|
The control names given above are generic; actual control record names will be different and unique for each account. Replace {share} with an account ID and append the account identifier to the control name to generate these controls. For example, account-specific controls for account ABC might be JSONIMPORT*ORDERS_ABC and EXPORT*JSONSHIPPERS_ABC.
Tip
Menu selection Tools ‣ Define ‣ Controls may be used to edit import controls (and any other controls) just as selections on the eXchange ‣ Export-Import menu are used.
Add WARES Process Selections¶
JSON orders import includes new processes JSONIMPORT_ORDERS and EXPORT_JSONSHIPPERS to import orders and create response documents. Custom versions of these processes are needed for each participating account. Use menu item Tools ‣ Processes ‣ Processes Setup to create the new processes, as described here:
- Display the Processes window from the menu.
- Retrieve the first process, JSONIMPORT_ORDERS, then rename the process
by appending the account ID: for example, JSONIMPORT_ORDERS_ABC. Press
<return>
to start the new record. - Press
<Alt-C>, <return>
to copy the last-displayed record into the new record. - Change the Execution command to use the control name from the previous section; that is, ORDERS_ABC instead of ORDERS. Change the process title to reflect the customer account, as you will see this title in the selection options.
- Save the process.
- Repeat the previous steps for process JSON*EXPORTSHIPPERS, where the control name might be JSONSHIPPERS_ABC instead of just JSONSHIPPERS.
The options list at eXchange ‣ Export-Import ‣ Processes should be used to list these account-specific process choices, as follows:
- At menu item Tools ‣ Define ‣ Popups, enter File name POPUPS and Popup name ECOM_PROCESS to display the exchange processes list.
- Add process names created above to the process list, and save the changes.
WARES Uses Short Filenames¶
Windows has two file naming conventions: upper-cased 8-character short names, and 256-character case-sensitive long names. File operations may be performed using either the short name or the long name, as directory entries track both names. Using short names, when a file operation results in a name collision, new files may overwrite previous files, resulting in data loss.
WARES performs file operations using 8-character short filenames. This is not a problem when using local files with distinct long names, because Windows 10 creates unique short names, as shown here:
Directory of W:\ATLAS\IMPORT\ORDERS\HISTORY
09/20/2017 03:55 PM <DIR> .
09/20/2017 03:55 PM <DIR> ..
09/20/2017 03:55 PM 1,149 3SUZMY~X.JSN 30000000223.JSN
09/20/2017 03:55 PM 889 14915.JSN
09/20/2017 03:55 PM 829 3927GZ~4.JSN 30000000104.JSN
09/20/2017 03:55 PM 844 14921.JSN
09/20/2017 03:55 PM 1,329 1MUCJR~M.JSN 30000000022.JSN
5 File(s) 5,000 bytes
Files linked to a Dropbox share use a different protocol for generating short filenames. The first 6 digits of the filename are followed by a tilde (~) and then a single digit from 1 to 9. Sequenced filenames longer than 8 characters will have short name collisions, and WARES file operations on the short names will result in data loss. This is illustrated with the directory listing below, where the same file list has been run through Dropbox:
Directory of C:\DROPBOX\SHARED\ORDERS\HISTORY
09/21/2017 11:03 AM <DIR> .
09/21/2017 11:03 AM <DIR> ..
09/21/2017 11:03 AM 1,149 300000~1.JSN 30000000223.JSN
09/21/2017 11:03 AM 889 14915.JSN
09/21/2017 11:03 AM 829 300000~2.JSN 30000000104.JSN
09/21/2017 11:03 AM 844 14921.JSN
09/21/2017 11:03 AM 1,329 300000~3.JSN 30000000022.JSN
5 File(s) 5,000 bytes
Warning
During file exchange, WARES requires unique filenames of 8 or fewer characters to guarantee that data will not be lost.