Setting up an FTP Scripting gateway
An FTP Scripting gateway runs according to the schedule
you set. The behavior of an FTP Scripting gateway is governed by
an FTP command script.
Creating the FTP script
To use an FTP Scripting gateway, you create a file that
includes all the FTP commands required that can be accepted by your
FTP server.
- Create a script for the gateways, to
indicate the actions you want performed. The following script is
an example of connecting to the specified FTP server (with the name
and password specified), changing to the specified directory on
the FTP server, and sending all the files to the specified directory
on the server.
open %BCGSERVERIP% %BCGUSERID% %BCGPASSWORD% %BCGOPTIONx%
cd %BCGOPTIONx%
mput *
quit
The placeholders (for example, %BCGSERVERIP%) are replaced when
the gateway is put in service by the values you enter when you create
a specific instance of an FTP scripting gateway, as shown in the
following table:
Table 17. How script parameters map to FTP Scripting gateway field entries
Script parameter |
FTP Scripting gateway field entry |
%BCGSERVERIP% |
Server IP |
%BCGUSERID% |
User ID |
%BCGPASSWORD% |
Password |
%BCGOPTIONx% |
Optionx, under User Defined Attributes |
You can have up to 10 user-defined options.
- Save the file.
FTP script commands
You can use the following commands
when creating the script:
- ascii,
binary, passive
These commands are not sent to the FTP server. They modify the
mode of transfer (ascii, binary, or passive) to the FTP server.
- cd
This command changes to the specified directory.
- delete
This command removes a file from the FTP server.
- mkdir
This command creates a directory on the FTP server.
- mput
This command takes a single argument, which specifies one or
more files to be transferred to the remote system. This argument
can contain the standard wildcard characters to identify multiple
files ('*' and '?').
- open
This command takes three parameters--the FTP server IP address,
the user name, and a password. These parameters map to the %BCGSERVERIP%,
%BCGUSERID%, and %BCGPASSWORD% variables.
The first line of your FTP Scripting gateway script, therefore,
should be:
open %BCGSERVERIP% %BCGUSERID% %BCGPASSWORD%
- quit,
bye
This command ends an existing connection to an FTP server.
- quote
This command indicates that everything after the QUOTE should
be sent to the remote system as a command. This allows you to send
commands to a remote FTP server that might not be defined in the
standard FTP protocol.
- rmdir
This command removes a directory from the FTP server.
- site
This command can be used to issue site-specific commands to the
remote system. The remote system determines if the contents of this
command are valid.
FTP Scripting gateways
If you will be using FTP Scripting gateways, perform the
following tasks:
To create
FTP Scripting gateways, use the following procedure.
- Click Account Admin > Profiles > Community Participant.
- Enter search criteria and click Search,
or click Search without entering any search criteria
to display a list of all participants.
- Click the View details icon to display
the participant's profile.
- Click Gateways.
- Click Create.
Gateway Details
From the Gateway List page, perform the following steps:
- Type a name to identify the gateway. This is a required field.
- Optionally indicate the status of the gateway. Enabled is
the default. A gateway that is enabled is ready to send documents.
A gateway that is disabled cannot send documents.
- Optionally indicate whether the gateway is Online or Offline.
The default is Online.
- Optionally enter a description of the gateway.
Gateway Configuration
In the Gateway Configuration section
of the page, perform the following steps:
- Select FTP Scripting from the Transport list.
- Enter the IP address of the FTP server to which you are sending
documents. The value you enter here will replace %BCGSERVERIP% when
the FTP script is run.
- Enter the user ID and password required to access the FTP server.
The values you enter here will replace %BCGUSERID% and %BCGPASSWORD%
when the FTP script is run.
- If the target is in secure mode, use the default of Yes for FTPS Mode.
Otherwise, click No.
- Upload the script file by following these steps:
- Click Upload Script File.
- Type the name of the file that contains the script for processing
documents, or use Browse to navigate to the
file.
- Click Load File to load the script file
into the Currently loaded script file text box.
- If the script file is the one you want to use, click Save.
- Click Close Window.
- In the Retry Count field, enter the number
of times you want the gateway to attempt to send a document before
it fails. The default is 3.
- In the Retry Interval field, enter the
amount of time the gateway should wait before attempting to send
the document again. The default is 300 seconds.
- For Connection Timeout, enter the number
of seconds a socket will remain open with no traffic. The default
is 120 seconds.
- In the Lock User field, indicate whether
the gateway will request a lock, so that no other instances of an
FTP Scripting gateway can gain access to the same FTP server directory
at the same time.
Note: The Global FTP Scripting Attributes values
are already filled in, and you cannot edit them from this page.
To modify these values, you use the Global Transport Attributes
page, as described in Setting up global transport values.
User-Defined Attributes
If you want to specify additional attributes, perform
the following steps. The value you enter for the option will replace
%BCGOPTIONx% when the FTP script is run (where x corresponds
to the number of the option.)
- Click New.
- Type a value next to Option 1.
-
If you have additional attributes to specify,
click New again and type a value.
- Repeat step 3 as often
as necessary to define all the attributes.
For example, suppose your FTP script looked like this:
open %BCGSERVERIP% %BCGUSERID% %BCGPASSWORD%
cd %BCGOPTION1%
mput *
quit
The %BCGOPTION% in this case would be a directory name.
Schedule
From the Schedule section of the page, perform the following
steps:
- Indicate whether you want interval-based scheduling or calendar-based scheduling.
- If you select Interval Based Scheduling,
select the number of seconds that should elapse before the gateway
is polled (or accept the default value).
- If you select Calendar Based Scheduling,
choose the type of scheduling (Daily Schedule, Weekly Schedule,
or Custom Schedule).
- If you select Daily Schedule, enter the
time of day when the gateway should be polled.
- If you select Weekly Schedule, select
one or more days of the week in addition to the time of day.
- If you select Custom Schedule, select
the time of day and then choose Range or Selective Days for
the week and the month. With Range, you indicate
the start date and the end date. (For example, click Mon and Fri if
you want the server polled at a certain time on weekdays only.)
With Selective Days, you choose the specific
days of the week and month.
- If you want to configure the Preprocess or Postprocess step
for the gateway, go to Configuring handlers.
Otherwise, click Save.
