iDropper Help
 
Getting Started
Requirements
Making Droplets:
 
Droplets:
  What End Users Get
 
 

 

 

Notification: Web Script

Web scripting is a powerful way to tie iDropper into an existing workflow. On the Web Script pane, you may define POST fields which are then sent as variables to a URL where a web script resides. The script can be written in PHP, JSP, ASP, or whatever you wish. Once a droplet is configured, all uploads trigger the web script and the server process it controls. What your script does is up to you: it could move files, unzip them, update a database, send e-mail to an account rep, or all of these and more.

Example

Included with the installer is a sample web script: iDropperExample1.php. This is a simple PHP script that sends an email message with details about the file delivery. This script could as easily be written to update a database to fit into a workflow solution. You are limited only by your imagination and capabilities.

Step 1
Open iDropperExample1.php in your favorite text editor and find line 45:

$to = "somebody@somewhere.com";

Change this variable to a real address (for example, john@johndoe.com). Save the file. You may wish to rename it as something like MailScript.php.

Place this file in a folder on your server where it can be accessed through a URL (for example, “http://www.mydomain.com/MailScript.php”).

Step2
Open iDropper and create a droplet in the usual manner, setting the FTP server information in the Destination pane.

Now go to the Notification/Web Script pane. In the URL field, type the URL you chose in Step 1 (“http://www.mydomain.com/MailScript.php”).

In the POST Fields box, define the POST fields you want to have e-mailed to you. Use the “+” and “-“ buttons to add or remove fields. In our example we have defined a Customer ID and a Job ID for a specific customer and job (see Figure 1). Your end-users will not be able to change the field names or their contents. In fact, the entire Web Script functionality is invisible to the end-user. The only input they will have is through the Job Info form defined in the Job Info pane, or through the Notes feature discussed next (if selected).

In the Notes box, enter any extra information you want to send to the script. If you check the "Prompt User" checkbox, your end-user will be prompted to fill out a form that will create a note to be sent to the script. This is similar to the "Prompt User" function in the E-Mail Notification settings.

Figure 1: The Notification/Web Script pane

Step 3
Go to the Job Info pane and define the Job Info settings. Our droplet is set to deliver the Job Info file in XML format. It will be called JobInfo.xml and the user will be asked to fill in three fields: Stock Color (scolor), Stock Weight (sweight), and Quantity(quantity).

Figure 2: The job Info pane

Step 4
Run a pre-flight check and save the droplet. Send the droplet to your end user. Your end-user will drag and drop files onto the droplet for upload.

Result
Here’s what an E-mail message would look like from the sample web script after dropping a folder called PrintJob with two files in it:

From:           iDropperNotify@johndoe.com
Subject:       iDropper Test POST
Date:            October 22, 2006 2:44:39 PM EDT
To:               john@johndoe.com
Reply-To:    iDropperNotify@johndoe.com

Files Delivered with iDropper
FileName_0 = PrintJob /FirstSampleFile.doc
FileName_1 = PrintJob /SecondSampleFile.doc
Delivered 2 files

Customer = ABC Advertising
Job = abc06-001
jobInfoFile = JobInfo.xml
FileName_0 = PrintJob /FirstSampleFile.doc
FileName_1 = PrintJob /SecondSampleFile.doc

The job Info file was specified to be JobInfo.xml in the Job Info pane. Here’s what it contains. The user specified that the color should be white, the weight 80lb, quantity 500 and gave a brief description of the job:

<jobInfo>
<scolor>white</scolor>
<sweight>80</sweight>
<quantity>500</quantity>
<description>500 brochures printed 2/2. Needed next Tuesday.</description>
<file_0>PrintJob /FirstSampleFile.doc</file_0>
<file_1>PrintJob /FirstSampleFile.doc</file_1>
<jobInfo>

A more advanced script than the example could use the customer and job fields to add a record to a database and send a status report to a customer representative. And, since the Job Info file name is POSTed to the web script, your script can use the values in it as well.

From this simple example you can see how web scripting gives you the power to fit iDropper into your workflow.

 

 

 
      © 2006-2007 317 Software LLC. All rights reserved.