EnRoute - Amazon Simple Storage Service (S3)

52
EnRoute 2.2 July 3, 2012 EnRoute

Transcript of EnRoute - Amazon Simple Storage Service (S3)

Page 1: EnRoute - Amazon Simple Storage Service (S3)

EnRoute 2.2July 3, 2012

EnRoute

Page 2: EnRoute - Amazon Simple Storage Service (S3)

2

Contents1 What is enRoUte .........................................................................................3

1.1 Example Scenario - Uploadform ............................................................42 installinG enRoUte ...................................................................................7

2.1 Platform requirements ............................................................................72.2 Where do I get the software ...................................................................72.3 Installing the software ............................................................................72.4 Starting up .............................................................................................8

3 ConFiGURinG enRoUte ..............................................................................93.1 Generalconfigurations ...........................................................................93.2 Creating an Event .................................................................................103.3 Scan Setup ..........................................................................................113.3.1 Simple Database scan Query ..............................................................133.3.2 Scan Database for folder contents ......................................................143.3.3 Custom (Filebased) Database scan Query ..........................................143.3.4 Filelist limitations ..................................................................................153.3.5 Usingdatabasefieldfornotifications ..................................................153.4 Routing Setup ......................................................................................163.4.1 Move - Routing method .......................................................................163.4.2 Convert - Routing method ...................................................................173.4.3 Run Custom Program - Routing method .............................................193.4.4 No routing - Routing method ...............................................................203.4.5 Routing Paths and Custom program arguments .................................203.4.6 Setting Database Fields .......................................................................243.5 Reporting&notification .......................................................................263.5.1 Emailnotifications ................................................................................283.5.2 Emailnotificationtemplateformat .......................................................283.5.3 Emailnotificationdataandtokens .......................................................313.5.4 Reporting .............................................................................................353.5.5 Report template format ........................................................................353.5.6 Reportdataandtokens .......................................................................383.5.7 Report examples ..................................................................................383.6 Connect to external mySQL ................................................................403.7 Testing and Running events from admin..............................................413.8 Scheduling an event ............................................................................413.9 Creating Timetables .............................................................................42

4 hoUse_inpRess style ..............................................................................444.1 house_inpress toplevel setup ..............................................................444.2 house_inpress upload setup ................................................................464.3 House_inpress upload language ..........................................................504.4 Triggering EnRoute event from House_inpress toplevel ......................50

Page 3: EnRoute - Amazon Simple Storage Service (S3)

3

1 What is enRoUte

EnRoute is designed to be run at the central server where all assets are stored. It has a back-end engine and a web-based administrators interface. The EnRoute daemon, enrd, runs in the background and is started automatically when the server starts up. The daemon is responsible for running the events scheduled by the administrator (see below).

EnRoute allows an administrator to configure events to be run with a time cycle or using a timetable. A cycle can be setup with a minimum time (Hot folder) or a specific interval (min-utes or hours). A timetable can be used to run an event at specific hours on certain weekdays or dates. Associating an event with a cycle or timetable creates an EnRoute schedule. It is possible to toggle specific schedules betwen active and non-active.

An event combines the operations of scanning, routing and reporting.

The scanning stage finds the assets to operate on based on the event setup. Typical scanning setups can be: Scan directory for files or Scan directory for Uploadreports. The scanning process takes into consideration locking of files, growing files, etc. Other scanning options are in place for example, to ensure the asset has generated a proper entry in the Venture database

When assets have been found, routing is applied. Typical routing setups can be: Move assets to path defined by certain database fields that have been applied to the asset, Move assets to path defined by data supplied by the user when uploading files using an upload form.

The Routing step also includes operations not necessarily defined as “routing”. It can, for exam-ple, apply values to Venture database fields as movements have been performed. Examples of such operations are: set Venture field “uploaddate” to current date, set Venture field “customer” to customer ID supplied in the upload form.

The last step, reporting, makes it possible to send notifications by e-mail and/or write textbased reports of the operations performed. All e-mails and reports can be customized using InPress Systems notification templates, common for most of InPress Systems products (Accelerator, InterAct, InAlias and InForm).

Page 4: EnRoute - Amazon Simple Storage Service (S3)

4

1.1 example scenario - Uploadform

An uploadform is used to collect jobs from clients. The client is prompted to upload 1 or 2 files, make a note for each file and choose a file type for the file from a pulldown menu.

In addition to the file information, the user needs to supply general information like Company name, ID, Purchase ordernumber and more.

Upload form. Using the house_inpress configurable style

After the upload has completed, EnRoute takes care of the files by placing the uploaded files into a “New-jobs” directory and filing them with the following structures: Customer name / PO / Filetype.

Uploaded files have been routed to Newjobs : InPress : 123471 : Artwork/Printready

Certain data is also written into Venture database fields on the files. Some of the data is from the information in the form and some is supplied entirely from EnRoute (like current date).

Page 5: EnRoute - Amazon Simple Storage Service (S3)

5

EnRoute writes data to the Venture database

EnRoute also provides an e-mail receipt back to the customer (also forwarded to customer serv-ice) and writes a Jobticket file into the the directory including all information collected in the form.

Page 6: EnRoute - Amazon Simple Storage Service (S3)

6

Formatted HTML e-mail sent back as a receipt to the e-mail used in the form

Jobticket file created in the new jobfolder

Page 7: EnRoute - Amazon Simple Storage Service (S3)

7

2 installinG enRoUte

2.1 platform requirements

EnRoute is available for MacOSX (PPC/Intel), Solaris 8+ and RedHat Linux 4.

2.2 Where do I get the software

To get the latest EnRoute software, go to ftp.inpress.se, login using “anonymous” and provide your e-mail address as a password. As an alternative, the installation package can also be provided to you by an InPress Systems reseller or from InPress Systems support.

The installation package is a gzipped unix tar file named “enr” followed by the version and plat-form and ending in “tar.gz”. For example enr.2.0.macosx.tar.gz refers to EnRoute version 2.0 for the Mac OSX operating system.

2.3 Installing the software

Login to the server as root and place the software in an appropriate installation directory. Un-compress and untar the file to display the “enrouteinst” folder, a README file and an installa-tion script.

Run the script by typing “./installenroute” and press return.

Any current installation will be upgraded to the version you are installing.

Running the installation script

In addition to the enroute installation script you will find some general installers as well as the ipik package. The general installer is run by the enroute installer automatically. The ipik package is designed to be installed on any Portal server connected to the WebNative server and provides integration to the InPress Systems products from Portal. See the ipik manual on www.inpress.se for more information.

You need to be logged in as root when install-

ing the software

Page 8: EnRoute - Amazon Simple Storage Service (S3)

8

2.4 starting up

The installation script installs the proper startup scripts for all platforms and then starts the dae-mon. The daemon should start and stop using the normal startup procedures.

In case you need to stop the daemon manually, run the following command line command

# /usr/enroute/bin/enroute_ctrl stop

In case you need to start the daemon manually, run the following command line command

# /usr/enroute/bin/enroute_ctrl start

Page 9: EnRoute - Amazon Simple Storage Service (S3)

9

3 ConFiGURinG enRoUte

The web-based EnRoute admin utility can be found under the web address

http://<yourserver>/webnative/plugins/enrouteadmin

You need to be logged in as “nativeadmin” to access the admin utility. It is organized the same way as the other admin utilities for InPress Systems, with register tabs for different functions and links for licencing and base configurations.

The admin utility is divided into the main three sections mentioned in chapter 1: Schedules, Events and Timetables.

Enroute uses different Events that define how to find files, what to do with the files and how/if to report and notify. An Event is created under the tab “Events” and then scheduled under the tab “Schedules”. If the Event should be executed at certain times, a specific Timetable needs to be created under the tab “Timetables” and selected when scheduling.

3.1 General configurations

There are some general configurations that can be done in EnRoute. These configurations will be default for all the events. If another value is set on the event, that value will be used.

ConFiGURations explanation

Debug Debugison/off,dependingonthisflag.

error e-mail E-mail address to send error message to. Can be overridden by Event

Mail sender Thesenderofthee-mail,e.g.errormailandreportmail.Canbeoverriddenby Event

sleep time How long the daemon will wait until it runs the next time. (seconds)

Main Server URL ServerurlthatwillbeusedwhenbuildinglinkstoWebNativefornotificationsand reports.

Portal Server URL ServerurlthatwillbeusedwhenbuildinglinkstoWebNativePortalfornotifi-cations and reports.

Base configurations

Page 10: EnRoute - Amazon Simple Storage Service (S3)

10

3.2 Creating an Event

An Event consists of three sections: Scanning, routing and notification/reporting.

Scanning decides how EnRoute finds the files to work on. Scanning can be made by searching through folder structures in different ways or by querying the Venture database to find files.

Routing decides what to do with the files that has been identified. Routing methods provided includes copy/move, convert and pass to custom program/scripts.

Notification/Reporting controls how e-mail notifications and text based file reporting should be handled.

Note that there may be occasions where Scanning is not needed and that the word “Routing” is used in its loosest terms! There may be Route methods that cannot be considered to be routing assets.

The events that have been configured are all shown in the Events scroll list. To modify or delete an existing event, scroll and select an event or simply start typing in to the list, highlight an event followed by clicking the modify or delete event buttons.

Event scroll list

There is also a possibility to view the log for a specific event, just click the button “View log”. The original log file is placed in /usr/enroute/logs/ and is named setupname.log.

To create a new event, go to the Events tab and click the link to “Add event”. It is now possible to type in a name of the new event and, if applicable, select an event to copy in case the new event should be based on an already existing event.

Adding a new event

You can edit but not delete an event that is

used in a schedule

Event names can only include letters a-z A-Z,

0-9 , “-” and “_”

Page 11: EnRoute - Amazon Simple Storage Service (S3)

11

3.3 scan setup

There are a number of scanning methods. A directory can be scanned for files, folders, files and folders, files recursively, based on an uploadreport, based on a database query, file in named parent folder or no scan.

The files scan and folders scan will find the files or folders in the first level of the scan directory. A files and folders scan will read both files and folders in the first level. Scanning for files recur-sively in the scan folders finds all the files in all subfolders independently.

The uploadreport scan looks for Xinet html upload reportfiles and parses the report to get the individual files associated to a specific report. Upload reports that don’t contain any files are omitted, if the “empty” upload report is older than 24 hours it will be deleted. Since naming convention on upload reports can be changed it is also possible to change the name used on the reports for the EnRoute scanning. Read more about the House_inpress Upload style below.

The scan database query option will find files in the Venture database and search for specific data associated with the files.

Scanning for files in named parent folders will search for all folders with certain name and then scan all files and/or folders inside the found folders. This search is a database search and can be limited to under a certain base path and combined with other keyword criteria.

No scan option; there will be no scan for files at all.

sCan Methods desCRiption

Event description Description of event.

scan Scanallfilesandfoldersinscanpath.Notrecursive.

Scan Path Thepathwheretoscanforfiles

Scan Pattern Regularexpressionthatneedstobematchedonfileorfoldername.

Restricttosamevalueindbfield Onlyincludefileswiththesamevalueinthisdatabasefield.Typeinnameofsingledatabasefield.EnRoutewillcheckthevalueofthefirstfile/folderitfindsandthenonlyallownewfiles/folderswithsamevalue.

Minimumnumberoffiles Theeventwillonlyruniftheminimumnumberoffiles/foldersismet.

Maximumnumberoffiles Theeventwillonlyincludethisnumberoffiles/folders.

Scan files only Scanfilesonlyinscanpath.Ignorefolders.Notrecursive.

Same options as Scan -

Scan folders only Scanfoldersonlyinscanpath.Ignorefiles.Notrecursive.

Same options as Scan -

Scan recursively Scanpathrecursivelyforfilesandignorefolders.

Same options as Scan -

Clean out orphaned subfolders Usinga“recursivescan”combinedwith“deleteoriginalfiles”maycauseempty folders. This setting will clean out these folders

scan uploadreports Scanforuploadreports.Filesspecifiedinreportareidentified

Scan pattern Regular expression pattern to identify uploadreport. Defaults to upload-report.html*

Scan database query QueryfilesintheVenturedatabaseandsearchforspecificdataassignedtothefiles.

Scan Path Thepathwheretoscanforfiles

File Filescanningpatterntocatchnames,partofnamesorextensions.Use%aswildcard,example:%.jpg

Subscan method Selectwhethertofindfiles,foldersorboth

Include subfolder Select yes to search recursively beneath scan path

Page 12: EnRoute - Amazon Simple Storage Service (S3)

12

Database query Semi-SQLcalltouseforthequeryorfilenameforcustomquerybasedonfile.Thequerystringcanincludetokensforkeywords,etc.Example:#customer_no#=1234AND#status#=”delivered”See more details below.

Minimumnumberoffiles Theeventwillonlyruniftheminimumnumberoffiles/foldersismet.

Maximumnumberoffiles Theeventwillonlyincludethisnumberoffiles/folders.

Scan database query QueryfilesintheVenturedatabaseandsearchforfiles/foldersinsidenamedParentfolder(s).Combinewithkeywordsearchifapplicable.

Base scan path Limit the database search to this base path

Parent folder name Thesearchwillmatchfilesandfoldersatthefirstlevelwithinparentfold-ers with this name.

Subscan method Selectwhethertofindfiles,foldersorboth

Additionaldatabasequery Semi-SQLcalltouseforthequeryorfilenameforcustomquerybasedonfile.Thequerystringcanincludetokensforkeywords,etc.Example:#jofolder#=1AND#status#=”closed”See more details below.

Minimumnumberoffiles Theeventwillonlyruniftheminimumnumberoffiles/foldersismet.

Maximumnumberoffiles Theeventwillonlyincludethisnumberoffiles/folders.

no scan Therewillbenoscanforfiles,restofthefunctions(routingandreporting/notification)willrun.

Common scanning options:

option desCRiption

Run with no files Runthesetup,eveniftherearenofilesfound.Routingandreportingwilltakeplace

Unzip Attempttounzipfilesthatarescanned.Zipfilesareidentifiedbytheirsuffix“.zip”.

Scan wait (s) Enrouteusesthiswaittimetoconfirmthatafileisnotgrowinginsize.Default is 5 seconds

Wait for dB Whenroutingusingdatabasefields,itisimportantthatthefilehasbeenupdated in the database before routing is performed. This setting forces EnRoutetowaituntilthefilehasbeenaddedtotheVenturedatabasebeforebeingaddedtotheactivefilelist.

Event identifier Auniqueidentifiercreatedwhentheeventruns.Canbereferredtoasevent.IDwhenroutingfiles,sendingemails,writingreportsandsettingdatabasefields.TheEventIDisastringcreatedmuchlikeroutingpaths(seemoredetailsintheroutingsection).Thestringisbuildusingfunctionsandtokensconcatenatedwith“&”,Example:“ID_&date(%Y-%m-%m.%H.%M)”

Functionsthatcanbeusedare:date(format)=executiondatewhereformatisthestandardUNIXdateformatter,defaultisYYYY-MM-DD.counter(N)=eventcounterwhereNisthenumberofsignificantdigits.UsinganumberforNspecifiesthecounterwithleading“0”characters.

Page 13: EnRoute - Amazon Simple Storage Service (S3)

13

A typical file scanning setup for scanning a hot folder for incoming files. Database fields are used, therefore EnRoute needs to wait for the file to turn up in the database.

3.3.1 Simple Database scan Query

Scanning using a database query can be done in two ways: “Semi-SQL” or Filebased query.

When using a Semi-SQL query, the query string itself is typed into the Database Query field. The syntax used is an SQL-like string using one or more combinations of Keyword opera-tor Value, together with logic operators like AND and OR. EnRoute interprets the string and builds the complete query needed to get all the files that meet the search criteria.

Keyword has to correspond to an existing Venture Keyword and preceeded and succeeded by # (hash) characters: #CustomerID#, #Project_Status#

Permitted Operators include: = (equal), < (less), > (more), <> (not like) or != (not like).

Value can be numerical, string (double-quoted) or a date operator #vdate()#: “ABC”, 123, #vdate()#. Date calls can be made using a number that automatically adds or subtracts a certain number of days: vdate(-1) = yesterday, vdate(7) = a week from now. Boolean values are written as 0 or 1.

Examples:

Searching for keyword CustomerID equal to “ABC”

#CustomerID#=”ABC”

Searching for keyword Project_status equal to “Done” and Done_date older than a week ago

#Project_status#=”Done” AND #Done_date#<#vdate(-7)#

vdate() uses time of 12.00 (like Venture) date() use only date.

Different results can be produced using vdate

and date

Page 14: EnRoute - Amazon Simple Storage Service (S3)

14

A scanning setup using a database query.

3.3.2 Scan Database for folder contents

Scanning using the Scan database for folder contents method is similar to a Semi-SQL query. The scan looks for files and folders inside all the folders with a certain name. The search can be performed within a certain base path and combined with a keyword query of the same type as in the Semi-SQL query. For more information about the keyword search syntax, see 3.3.1.

It is possible to limit the search to files or folders and also set limits on maximum and minumum number of files.

3.3.3 Custom (Filebased) Database scan Query

If a more complex database query is needed or if tables other than the keyword table needs to be inluded in the query, it is possible to use a filebased query.

A filebased query is saved as an isolatin 1 file, using UNIX linebreaks. The file can be saved anywhere on the server. In the “Database query” setup field, the full path to the file is specified. When EnRoute receives a query that starts with “/” it automatically assumes that it is a filebased query.

The queryfile needs to contain the full query to be passed to the database. This query needs to be designed to return the subpath + filename to the entries found starting at the selected scanpath.

The query needs to be a working mySQL query and it can include some specific tokens: #SCANPATH#, #ARG0#, #ARG1#

Page 15: EnRoute - Amazon Simple Storage Service (S3)

15

#SCANPATH# translates to the scanpath of the Event.

#ARG0#, ARG1# and so on translate to specific arguments that can be entered in the admin af-ter the actual path to the queryfile. The arguments are separated by “;” In addition to the already mentioned tokens, #Date()# can be used as with simple queries.

Example entry in setup:

SCANPATH: /raid/filesDATABASE QUERY: /usr/enroute/setup/queries/myquery;123;158;159

The contents of the file “myquery” is:

SELECT TRIM(“#SCANPATH#/” FROM CONCAT(path.Path,”/”,file.unixname)) FROM (file,path)LEFT JOIN keyword1 k1 ON (file.FileID=k1.FileID) WHERE file.pathID=path.pathIDAND file.Online=1 AND file.Dir=0 AND path.Path LIKE ‘#SCANPATH#/%’AND Field#ARG0#>’#Date(-28)#’ ORDER BY Field#ARG1#, Field#ARG2#;

The query will be (if executed on 2010-08-30):

SELECT TRIM(“/raid/files” FROM CONCAT(path.Path,”/”,file.unixname)) FROM (file,path)LEFT JOIN keyword1 k1 ON (file.FileID=k1.FileID) WHERE file.pathID=path.pathIDAND file.Online=1 AND file.Dir=0 AND path.Path LIKE ‘/raid/files’AND Field123>’2010-08-02’ORDER BY Field158, Field159;

3.3.4 Filelist limitations

The minimum and maximum number of files can be used to control how a scan is made. By set-ting a minimum number of files, the event can be forced to “wait” until the right number of files can be found.

By setting a maximum number of files the event will just include exactly the number of files needed and leave the rest behind.

Setting the same value on both minimum and maximum will force the event to wait until the right number of files have been found and then run on exactly that number.

3.3.5 Using database field for notifications

EnRoute can read database fields on the files that have been found. This feature can be used to read an email out of a database field to be used for notifications (see section 3.5). However, using this feature may also put some restrains on the filelist itself.

When using a databasefield to pickup email notification address, ONLY the files with the same email will be included in a specific scan.

For example, using a scanforfiles on a hot folder and reading the notification email from the database field “Notify”. If there are four files, two with Notify=”[email protected]”, one with Notify=”[email protected]” and one with a blank value in the field, it will result in three different filelists.

Page 16: EnRoute - Amazon Simple Storage Service (S3)

16

3.4 Routing setup

After EnRoute has scanned and identified the files, it will apply whatever routing specified in the Event setup. The word “Routing” is used for the setup but in fact the files do not need to be moved.

Routing methods are Move, Convert, Run Custom Program and No Routing. The different methods will be covered in detail below.

3.4.1 Move - Routing method

Move will copy the files to the routing path. If the “delete original” function is selected, it will be a move. Move can move to a static path or to a dynamic path based on different data collected in the scan or from the individual files.

Files can also be renamed while routing. If the routing path ends with “/” it is assumed that the path is to a directory and the original filename is added to the path.

RoUtinG Methods desCRiption

Move Copy/Movefiletotarget(routingpath)

Routing Path TargetPathwheretoputthefiles.Canbestaticordynamic.Endingwith“/”assumesoriginalfilenameshouldbeused.See more information and examples below for creating dynamic paths.

RoutingPath,Second Optionalsecondtargetpathwheretoputthefiles.OperateslikeRouting path above.

Deleteoriginalfiles Ifsettoyes,EnRoutewilldeletetheoriginalfilethathasbeencopied.

Error Path PathwheretoputfilesincaseRoutingpathcannotberesolvedorifacopycannot be made to the target path

Routing Character Filter RoutingCharacterfilterisusedtofilterthecharactersusedintheroutingpath.Therearethreedefaultfilters; Only lett, num, undersc to undersc-Thisfilteronlyaccepta-z,A-Z,0-9_-/.Allothersignswillbereplacedwithunderscore(_).Only lett, num, undersc remove-Thisfilteronlyaccepta-z,A-Z,0-9_-/.Allothersignswillberemoved.dash to slash - Replaces dash (-) to slash (/).It’spossibletocreateownfilters,theyshouldbeplacedinthefolder/usr/enroute/setup/routetrans.

Routing Filter Option RoutingFilterOptionisusedtodecidewhattofilter(routingcharacterfilter),justfilename,justpathorboth.

Overwritefiles Ifsettoyes,EnRoutewilloverwriteexistingfilesotherwiseadecimalwillbeappendedtothefilename:-N(-1,-2,..)

Inherit permissions Ifsettoyes,EnRoutewillusethepermissiondetailsofthefirstencounteredparentdirectory´sforanysubfoldersandfiles.

SetFindercolor,routedfile&routedfile2

Pulldowntoselectthefinderlablecolortobesetonroutedfileandsecondroutedfile.

Maxfilesintargetdir Maximumnumberoffilesinthedirectorywherefilesaremovedto.Whenreachingthemaxnumberanewdirectoryiscreatedaddinga-N(-1,-2,..)to the directory name.

Resetdatabasefields,routedfile&routedfile2

Ifsettoyes,alltheentriesinthedatabaseforthefilewillbedeletedafterrouting.Notethatthisdoesnotaffecttheoriginalfileifkept.

Setdatabasefields,routedfile&routedfile2

Formulasforsettingdatabasefieldsontheroutedfile.ThesyntaxforsettingdatabasefieldsisFieldname1=Value1;Fieldname2=Value2;..whereFieldnameisthenameofavalidVenturefieldandvalueisstatic or variable. The variables can either be information collected from an upload form or functions that can be run.See more information in following section.

Page 17: EnRoute - Amazon Simple Storage Service (S3)

17

Routing method “Move files” moves files to a dynamic path including the date as well as a backup. Original files are de-leted and the routed files get two database fields set. Filtering on the filename is enabled.

3.4.2 Convert - Routing method

Convert will convert the files to the routing path using a conversion setup. The converted file can be sent to a static path or to a dynamic path based on different data collected in the scan or from the individual files.

Files can also be renamed while routing. If the routing path ends with “/” it is assumed that the path is to a directory and the original filename is added to the path.

RoUtinG Methods desCRiption

Convert Convertfiletotarget(routingpath)

Conversion option Setuptoconvertto.Asetupincludesfileformat,resolution,color,andmore.New conversion setups can be created (see below).

Routing Path See move

Handling of non-images Howtohandlefilesthatcannotbeconverted; ignore,Copy to routing path,Copy to error path

Deleteoriginalfiles See move

Error Path Pathwheretoputfilesthatcannotbeconverted(ifsoconfigured)

Routing Character Filter See move

Routing Filter Option See move

Overwritefiles See move

Inherit permissions See move

Maxfilesintargetdir See move

Setdatabasefields,routedfile See move

Page 18: EnRoute - Amazon Simple Storage Service (S3)

18

Converting images to the setup named 72dpi_jpg. The converted images goes to the path /FP_vol/Webshare followed by the original path from the top scan location. non-images are ignored.

When selecting a conversion option, it is possible to create new conversion setups or edit an existing one. Click the “Edit” link to edit the selected option. If no option is selected, a new one can be created.

Editing a conversion setup

Page 19: EnRoute - Amazon Simple Storage Service (S3)

19

A conversion setup includes the following choices:

CONVERSION SETTING desCRiption

name Nametochoosefrom.Canonlyusea-z,A-Zandnumbers

File format Formatoffile

ICC Profile Profiletouseforconversion.UsingProfilestochoosethecolorspaceover-ridesanycolorspacesettings.Italsorequirestheimagestobeconverted,tohaveasourceprofileorthatthereisadefaultsourceprofilessetbytheXinetsetup for the image type.Addnewprofilesbycopyingto:/usr/enroute/setup/iccprofiles

Color space Colorspacetouseifnotusingprofile.

Resolution (dpi) Resolution in dpi

scale method Inches,Cm,MmandPixelwillscaletotheappropriatefinitesizeassetbyWidth and Height.%willscaleproportionallytotheoriginalsizeusingonlyWidth.

Width Width in the selected Scaling method. Use only numbers and decimal point.

height Height in the selected Scaling method. Use only numbers and decimal point.

padding Whenscalingtoasetwidthandheight,usingPaddingmeansthattheimagewillalwaysbethesetsize,usingpaddingtofillupemptyspace.

3.4.3 Run Custom program - Routing method

The method Run Custom Program will run an external program. There are two ways to run the program: One at a time or All at once.

When running one time per file, the program will execute once per file passing the path to the file as the program´s first argument.

When running once for all files, EnRoute will create a temporary file including a list of all the current files. It will execute once while passing the path to the listfile as the program´s first argu-ment. After execution, the temp file will be deleted.

RoUtinG Methods desCRiption

Run Custom program Will run an external program.

Custom Program Writethefilenametotheexternalprogramthatisgoingtoberun.Placetheexternal program in the folder /usr/enroute/setup/extprogs/.Note that the program/script has to be executable.

CustomArgument1 Thefirstargumenttotheexternalprogram.

CustomArgument2 The second argument to the external program.

CustomArgument3 The third argument to the external program.

CustomArgument4 The fourth argument to the external program.

Execute type Ifthereareseveralfilesinthefilelist,tobeexecutedbythecustompro-gram,youcanchoosehowtoexecutethem.one at a time-Thefileswillbeexecutedonebyone.Apathtothefilethatis going to be executed is sent as argument 1.all at once-Allfileswillbeexecutedatonce.Apathtoafilelistissenttothe custom program as argument 1.

Deleteoriginalfiles Ifsettoyes,EnRoutewilldeletetheoriginalfilethathasbeenprocessed

The custom arguments can be static or dynamic. Dynamic arguments are very similar to the arguments used to create paths. However, when running in the “once for all files” mode it is not possible to use dynamic data from individual files.

Page 20: EnRoute - Amazon Simple Storage Service (S3)

20

Example of a custom program setup. The program /usr/enroute/setup/extprogs/my_custom_program is executed once per file in the temporary file list. Two static arguments are passed as well as the dynamic file.name and date(%Y). First argu-ment to the program is the filepath.

3.4.4 no routing - Routing method

The No routing method is normally used when it is only of interest to use the reports and notifi-cation and/or to set database fields.

RoUtinG Methods desCRiption

no routing Noroutingwillbedone.Canbeusedforsettingdatabasefieldsorforreportingandnotification.

Deleteoriginalfiles Ifsettoyes,EnRoutewilldeletetheoriginalfile A routing setup routing files to a location based on values in current database fields.

3.4.5 Routing paths and Custom program arguments

The Routing Path for methods move and convert as well as arguments to running Custom Pro-grams can be static or dynamic.

A dynamic path contains tokens separated by & characters. Every token is either a reference to a static path section or to a variable or a function.

Example: /myRaid/files/Jobs/&db(CustomerName)&/&db(ProjectID)&/

In the example above we are using the following components:

/myRaid/files/Jobs/ db(CustomerName) / db(ProjectID) /

The db() components are dynamic and will get their values querying the Venture database on the files it’s routing. The other components are static.

With the values “ACME” for CustomName and “2010-123456” for ProjectID the path is:

/myRaid/files/Jobs/ACME/2010-123456/

The path ends with a “/” meaning that EnRoute will treat this as a path where to put the file us-ing the files original name. It is also possible to create full paths including filename.

Example: /myRaid/files/SubmittedFiles/&db(ProjectID)&/&date()&/&db(SKU)&file.fext

In the example above we are using the following static components:

Page 21: EnRoute - Amazon Simple Storage Service (S3)

21

/myRaid/files/SubmittedFiles/, /, /

and the following dynamic components:

db(ProjectID), date(), db(SKU), file.fext

In this example the resulting path is dependent on the values of two database fields (ProjectID and SKU) as well as the current date. We also pick up the file extension from the original file (if it exists) and adds to the value of the SKU database field which is used as the name.

In this case the path does NOT end with a “/” meaning that EnRoute will treat this as a path to the final file.

There are a number of dynamic sections that can be used based on what the current scenario is. Possible variables to use are values from database fields (from Venture), data from an upload form (or list), parts of the current filename and specific functions. The dynamic sections can both be used to create routing paths for move/convert and to create arguments for running custom programs.

dynaMiC seCtion desCRiption

file.FIELDNAME DatafromfileassociateduploadformfieldnamedFIELDNAME(seeuploadform)

file.ATTRIBUTE Fileattributes,like“name”,“subname”,“namenoext”,“ext”

file.name Filename

file.path Fullfilepath

file.dir Pathtofolderenclosingfile

file.namepath Relativefilepathfromscandirectorytocurrentlocation

file.namenoext Filename without any extenstion

file.ext File’s extension if any

file.fext File’sextensionifany,includingthe“.”

file.lastfolder Nameoffolderenclosingthefile

file.lastfolder_N NameofNthfolderenclosingthefile.Nisanumber:1,2,3...1meansthelastfolder(iethesameasusingfile.lastfolder),2thesecnodlastandsoon.

file.fromzip NameofzipfilewheretheFilewasunzippedfrom.Without“.zip”

file.idx Indexoffileinsidefilelist

file.idx_n Indexoffileinsidefilelist,usingnsignificantnumbers.Example:index5,idx_3would result in “005”

meta.FieldnaMe DatafromgeneraluploadformfieldnamedFIELDNAME

event.ATTRIBUTE Eventattributes,like“ID”,“nfiles”,“scanfolder”

event.ID Theeventidasspecifiedinsetup

event.scanfolder Name of scanning folder

event.nfiles Numberofcurrentfiles

date(FORMAT) CurrenttimeexpressedinspecifiedFORMAT.EnRouteusesthestandarddateformattersinUNIX(seemanpagefordate).Ifnotspecified,EnRoutewilluse.%Y-%m-%dwhichtranslatestotheYYYY-MM-DDformat.

db(FIELD) RetrievevaluefordatabasefieldFIELD.Errorifempty.Iffieldisfidthefileidwillbe returned.

db2(FIELD;Default) RetrievevaluefordatabasefieldFIELD.IfemptyuseDeafultvalue.Ifemptyandnodefault,useemptystringwithouterror.Iffieldisfidthefileidwillbereturned.

_amp_ Insert the & character

Page 22: EnRoute - Amazon Simple Storage Service (S3)

22

dynaMiC seCtion desCRiption

abr(VALUE;METHOD;ARG) Abbreviateavalueusingcertainmethod

VALUE=datatoabbreviate,forexamplefile.nameMETHOD=lvl,num,AB,Ab,ab,to,frARG=numberordigitsorcharactersortoken

lvl-roundsdowntonumberofdigitsinARG:abr(12999;lvl;2)Resultsin12000num-roundstonumberofdigitsinARG:abr(12999;num;2)Resultsin13000ab -usesnumberofcharsinARG,lowercase:abr(Wxyz;ab;2)ResultsinwxAb-usesnumberofcharsinARG,nocasechange:abr(Wxyz;Ab;3)ResultsinWxyaB-usesnumberofcharsinARG,uppercase:abr(Wxyz;AB;2)ResultsinWXto-usesstringuptoARG:abr(ABC-123;to;-)ResultsinABCfr-usesstringfromARG:abr(ABC-123;fr;-)Resultsin123

abr()canbeusedonmostroutingtokensincludingdb()anddb2()

lookup(VALUE;FILE;COL) Lookupavaluefromatabdelimetedfile

VALUE=datatousewhenlookingupvalue,forexamplefile.nameFILE=filetouseforthelookup.Needstobein/usr/enroute/setup/lookupCOL=columntoread

Example:fileextmapcontainsextensionsandcorrespondingnameslike jpg webimg psd originals ...Usinglookup(file.ext;extmap;2)willreturn“webimg”iftheextensionisjpg

lookup()canbeusedonmostroutingtokensincludingdb()anddb2()

replace(VALUE;FIND;REP) Replace a substring within a larger string

VALUE=stringtosearchandreplacein,forexamplefile.dirFIND=sectiontochange(canonlybestatic)REP=replacementtext,iesectiontochange(canonlybestatic)

Example:file.diris/raid1/hotfolders/incoming_jobsUsingreplace(file.dir;raid1/hotfolders;raid2)willreturn“/raid2/incoming_jobs“

replace()canbeusedonmostroutingtokensincludingdb()anddb2()

dbd(BASE;F1;V1;F2;V2) dbf(BASE;F1;V1;F2;V2)

Searchforafile-ordirectorypathintheVenturedatabase.dbdrestrictstodirpathwhiledbfrestricttoafilepath.dbd()anddbf()returnstheshortestpathifmultiple paths are found.

BASE=optionalbasepathwheresearchshouldtakeplace.F1=NameoffirstfieldtomatchV1=FirstvaluetomatchF2=Nameofsecondfieldtomatch(optional)V2=Secondvaluetomatch(optional)

Search:F1="V1"ANDF2="V2"whilepathLIKEBASE%

Notethatvaluescanbedynamic.Example:Findprojectfolderthatmatchincomingfile´svalueforproject.Add"/uploads/"topathRoute:dbd(/raid/projects;PROJID;db(PROJID);PROJFOLDER;1)

customfunc(ARG1;ARG2..) Run a custom function that will return a path segment. The custom function needstobeanexecutablefileinside/usr/enroute/setup/extprogs.Itcanbepassed arguments (up to 10) that will be used when the custom function is called.Argumentscanbeanytokensmentionedinthistable.Theprogram/scriptshouldreturnthepathsegmenttobeusedonstdout.Anon-zeroexitstatus indicate an error.

Example:/basepath/&myfunc(file.path;date())&/myfuncwillbecalledandfile.pathandcurrentdatepassedasparameterstothe script/program.

Asampleofacustomroutingfunctionscriptisincludedwiththedistribution.

Page 23: EnRoute - Amazon Simple Storage Service (S3)

23

Let’s take a look at a few examples using different Route path setups

Example 1:

We want to route files that are being uploaded using the Xinet uploader and we want to route based on supplied database information.

Xinet uploader sets two database fields: ProjectID and CustomerNameRoutePath is set to: /myRaid/files/Jobs/&db(CustomerName)&/&db(ProjectID)&/

On an upload using CustomerName: “inpress” and ProjectID: “Enroutemanual” the path would translate to:

Resolved path is: /myRaid/files/Jobs/inpress/Enroutemanual/

The routepath ends with a “/”. Enroute will assume this is the directory where to route the file and add the original filename at the end. Routing of a file named “Screenshot” would then place the file in the full path

/myRaid/files/Jobs/inpress/Enroutemanual/Screenshot

Example 2:

Files are uploaded using the WebNative html upload with the House_inpress form. The form has an input field named “CustomerID” and associated to the selected file there is a field named “Status” (for more information about the House_inpress upload style, see a following section).

We want to route the files to an appropriate customer folder, create a subfolder named after today’s date and make a subfolder inside that folder for the files status as selected by the person submitting the file.

RoutePath: /myRaid/files/Incoming/&meta.CustomerID&/&date(%Y-%m-%d)&/&file.Status&/

On an upload using CustomerID: “inpress” and Status: “Printready” on Sept 20, 2007 the path translates to

Resolved path is: /myRaid/files/Incoming/inpress/2007-09-20/printready/

The routepath ends with a “/”. Enroute will assume this is the directory where to route the file to and append the name to the end. Routing of a file named “Enroute manual” would result in the full path looking like this:

/myRaid/files/Incoming/inpress/2007-09-20/printready/Enroute manual

Example 3:

A folder with files is scanned at a specific time everyday. There are database fields set on the files. We want to use two keywords to file the files into nested subfolders and also rename the file add-ing _OLD to the filename.

Routing Path: /myRaid/files/Old/&db(Keyword1)&/&db(Keyword2)&/&file.noext&_OLD.&file.fext

Processing the file foo.jpg with Keyword1 = “fruit” and Keyword2 = “orange”

Translates to: /myRaid/files/Old/fruit/orange/foo_OLD.jpg

The routepath does NOT end with a /. Enroute will assume this is the full path where to route the file including the filename. We are using the tokens file.namenoext and file.ext to generate a new filename while making sure that we preserve any extension.

Page 24: EnRoute - Amazon Simple Storage Service (S3)

24

3.4.6 Setting Database Fields

Depending on the routemethod both original and routed files can have database values set by EnRoute.

The syntax for setting database fields is

Fieldname1[Operator1]Value1;Fieldname2[Operator2]Value2;..

where Fieldname is the name of a valid datafield in Venture, Operator is one of the valid opera-tors (listed below) and the value part can be static information, dynamic information or a valid function.

Following operators are valid:

opeRatoR desCRiption

Field=VALUE SetstheFieldtoVALUE.Example:“Submitdate=date()”. The date function inserts the current date.

Field=+ Incrementsthefieldby1.Thefieldcanbeintegerorstring.Example:“Usage=+”.

Field=- Decrementsthefieldby1.

Field=+VALUE IncrementsthefieldbynumericalVALUE.

Field=-VALUE DecrementsthefieldbynumericalVALUE.

Field=!VALUE SetstoVALUEonlyifnothedatabasefieldisempty.Example:“Converted_on=!date()”.

Field=>VALUE InsertsstringVALUEbeforeanyexistingvalueandreappliesthestringtothefield.Example:“Execute_dates=>date()&,”.Astringlike“2010-10-25,2009-10-15,2010-06-12”willbemaintained,withnewadditionsattheSTARTofthestring.

Field=<VALUE InsertsstringVALUEafteranyexistingvalueandreappliesstringtothefield.Example:“Events=<event.ID&“.Astringlike“000100020003”willbemaintained,withnewadditions at the END of the string.

Field=[VALUE AddsstringVALUEtoalistofuniquevalues.Example:“Events=[event.name”.Astringlike“abcdefghi”willbemaintained.Field={VALUEAddsstringVALUEtoalistofuniquevalues,maintainscountofeachoccurrence.Example:“Events={event.name”.Astringlike“abc(2)def(5)ghi”willbemaintained.

The dynamic information to be used when setting a database field is similar to the information accessible when creating routepaths. It is the same as the information available when creating notifications and reports (see following sections).

VARIABLE VALUE desCRiption

meta.FieldnaMe DatafromgeneraluploadformfieldnamedFIELDNAME

event.ATTRIBUTE Eventattributes,like“ID”,“nfiles”,“scanfolder”

event.ID Theeventidasspecifiedinsetup

event.scanfolder Name of scanning folder

event.nfiles Numberofcurrentfiles

event.name Theeventidasspecifiedinsetup

event.date Currentdate,inYYYY-MM-DDformat

event.time Currenttime,inHH:MMformat

file.FIELDNAME DatafromfileassociateduploadformfieldnamedFIELDNAME(seeuploadform)

file.ATTRIBUTE Fileattributes,like“name”,“subname”,“namenoext”,“ext”

file.idx Indexinfilelist

Page 25: EnRoute - Amazon Simple Storage Service (S3)

25

VARIABLE VALUE desCRiption

file.name Filename

file.namenoext Filename without extension

file.path Original Filepath

file.name_u Filename,URLencoded

file.path_u OriginalFilepath,URLencoded

file.tname Target Filename

file.tpath Target Filepath

file.tname_u TargetFilename,URLencoded

file.tpath_u TargetFilepath,URLencoded

file.lastfolder Folderenclosingoriginalfile

file.comment Files comment if any

date(OFFSET;FORMAT) Datefunction.FORMATisthedateformattertobeused.EnRouteusesthestandarddateformattersinUNIX(seemanpagefordate).Ifnotspecified,EnRoutewilluse.%Y-%m-%dwhichtranslatestodateslike“2007-09-31”OFFSETisanoptionalnumber(positiveornegative).Ifsupplied,thedatewillbeoffsetedwithasmanyhours.

udate(OFFSET) Date function. Supplies unix timestamp as number.OFFSETisanoptionalnumber(positiveornegative).Ifsupplied,thedatewillbeoffsetedwithasmanyhours.

_amp_ Insert the “&” character

abr(VALUE;METHOD;ARG) See earlier description

nl(n) insert n newlines. 1 is default

Let’s take a look at a few examples using different database setups.

Example 1:

We want to route files that are being uploaded using the Xinet uploader and the uploaded files should get today’s date set into the Filesubmit date field and the default value “submitted” set into the Filestatus field. Set database field is set to:

Filesubmit date=date();Filestatus=submitted

Example 2:

Files are uploaded using the a WebNative html upload with the House_inpress form. The form has an input field named “CustomerID” and associated to the selected file there is a field named “Status” (for more information about the House_inpress upload style, see upcoming section).

We want to update the Filestatus database field with the information selected for the file in the form, update the ProjectID database field with the CustomerID and put today’s date set into the Filesubmit date field. Set database field is set to:

Filesubmit date=date();Filestatus=file.Status;ProjectID=meta.CustomerID

Page 26: EnRoute - Amazon Simple Storage Service (S3)

26

3.5 Reporting & notification

After performing the routing of the files, EnRoute generates a list of data that can be fed into notification/receipt e-mail and/or in a written text report. Both the notification and the report are based on templates and they share the same technology for making custom formatted e-mails and reports as all other InPress Products.

New templates (both for emails and reports) can be custom made and added to the system and then selected. See more details on the templating technology below.

In addition to the report and notifications, it is also possible to make a query to a secondary MySQL server. The Query is based on a query templatefile (just like custom queries when scan-ning) and can use the same data as the report/notification.

Following options are available for Notification and Reporting:

RepoRtinG & notiFiCation desCRiption

Mail address for First notification E-mailwheretosendnotification.Canbeacommaseparatedlist.Emailaddresscanbepickedupfromuploadformusingmeta.FIELDNAME,example:meta.EMAIL.The first emailaddresscanalsobereadfromVenturedatabaseonthefile,usingdb(FIELDNAME).Notethatreadingemailfromdata-baseaffectsthefilelist.

Template for First notification Select template to use. The default template will be used if no tem-plate has been selected but an e-mail has been supplied.

Mail address for Second notification E-mailwheretosendnotification.Canbeacommaseparatedlist.Emailaddresscanbepickedupfromuploadformusingmeta.FIELDNAME,example:meta.EMAIL.

Template for Second notification Select template to use. The default template will be used if no tem-plate has been selected but an e-mail has been supplied.

Mail sender for notifications Replyaddresstousefornotifications,forthisspecificevent.Themailsendersetupinthegeneralconfigurationwillbeusedincaseno event Mailsender has been supplied.

output path for reports Path where to write report for Event. This path can be static or include dynamic segments.

template for reports Select template to use. The default template will be used if no tem-plate has been selected but a report path has been supplied.

Get Venture fields for reports WritethekeywordsinVenture,neededforreportsandnotifications,separatedwithsemicolon(;).Thekeywordnamesandvalueswillbegatheredandincludedinthearrayforreportsandnotifications.

Set database fields, original Formulasforsettingdatabasefields,ontheoriginalfile.ThesyntaxforsettingdatabasefieldsisFieldname1=Value1;Fieldname2=Value2;..whereFieldnameisthenameofavalidVenturefieldand value is static or variable. The variables can either be information collected from an upload form or functions that can be run.More information and examples in previous section.

Mail address for error mails E-mailwheretosendErrormessage.Incertaincircumstances,EnRoute will send an error mail.

portal sitename Ifavailable,EnRoutewillcreatelinkstofilesandfolderstobeusedto access through Portal

Main server address ( from Portal) The server address the site is accessing (as seen from the Portal serverconfig).WillbeusedwhencreatinglinkstofilesforPortal.

Event debug Settoyestogetmoredebugintologfiles

Content array debug Emails and reports gets their data from an array generated by EnRoute. It is possible to write this array in order to view the data available.Insertapathwheretowritethefile.ThefilewillbewrittentothepathandnamedEVENTNAME_cont_UNIQUENUMBER.txt.

IP-number TheIP-numbertotheserver,wheretheexternalMySQLdatabaseislocated.

dB name The name of the external MySQL databas (schema).

Page 27: EnRoute - Amazon Simple Storage Service (S3)

27

RepoRtinG & notiFiCation desCRiption

dB User name The user name that is needed to log in to the external MySQL database.

DB Password The password that is needed to log in to the external MySQL data-base.

Template for SQL query The template that is used to create the DB queries. The SQL queries mustbedividedbysemicolon(;)andeverynewSQLquerymuststartonanewline.ThereisoneexampleofDBtemplate,DB-sample.

Example of a Reporting & Notification setup.

Page 28: EnRoute - Amazon Simple Storage Service (S3)

28

3.5.1 Email notifications

Emails can be sent to multiple recipients using a comma to separate the emails. Email addresses can be static or dynamic. There are two different types of dynamic emails supported: from up-load form or from database field.

In order to use an email address supplied by an upload form, type in “meta. “the name of the field, example meta.EMAIL.

In order to use an email address supplied from a venture field on a scanned file, specify the field-name within the db() function, example db(Notificationmail).

Note that when using a databasefield to retrieve the email it is possible to end up with multiple email addresses. In order to handle this situtation, EnRoute will limit the current scan to the first value of email address it encounters and ignore files with other values.

3.5.2 Email notification template format

EnRoute emails are based on mailtemplates. The mailtemplates are files saved into a subfolder (notiftempl) in the EnRoute setup directory (/usr/enroute/setup). Each file in this directory will show up as a selectable choice in the pulldowns for Template for first notification and Template for second notification. The reason that there are two emails and two templates is to make it possible to send different emails to different recipients, for example a receipt to someone uploading a file and a report to the admin.

EnRoute ships with a default emails formatted as text only. This template will be used in case a notification email address has been entered but no template selected (or default selected).

To create a new email template, copy the template that needs customization into the the folder. Edit the emails as needed and select it from the admin interface. Please note that any standard emails shipped with EnRoute should not be edited since they may be overwritten when a soft-ware upgrade is made.

The email templates are plain text files and should be edited using a text editor like BBEdit or TextWrangler. Save the files using UNIX linefeeds and encoded as ISO Latin 1. Any empty line in the file will be ignored so if you need a line that show up as empty, use a space on that line.

The first line in the email template is used as the Subject line of the email and will be stripped out and not be part of the email itself. If the email is of HTML type it is of upmost importance that the first line after the subject is an <HTML> tag.

Uploadeport<HTML><HEAD><STYLE TYPE=”text/css”>

The example above is the top four lines of an html email template. “Uploadreport” is the subject and the first line is an HTML doc tag.

EnRoute parses the email template looking for markers specifying tokens that will be exchanged for the unique data pertaining to the specific event. The marker used in the email templates is “#” (the hash character). The token is normally embedded inside two markers: “#event.date#”.

Enroute Report - #event.name# - #event.date# / #event.time#

The section above is taken from the default notification template. It has three tokens: event.name, event.date and event.time, all embedded within “#” characters.

Using database fields as email address may

split the scan

Page 29: EnRoute - Amazon Simple Storage Service (S3)

29

EnRoute builds an array with many different values that come from the current run of the event. The array is structured into sections like event and meta with subvalues like event.name and event.date. To insert a value from a certain variable, use the token within the markers.

In addition to the simple sections there are also numbered sections and subsections that can have different length depending on the data available. Example: file0, file1, file2 and so on with cor-responding entries for file0.idx, file0.name and so on.

Retrieving data from the numbered sections has to be done using loops. There are two types of loops: single-line and multi-line. A single-line loop is created by typing one of the numbered variables at a line using a “@” instead of the number. The entire line will be repeated, string with the number “0” and increasing the counter as long as there is data:

#[email protected]# : #[email protected]#

With the data

file0.idx = “1”file0.name = “Acme industries.eps”file1.idx = “2”file1.name = “ACME_hq.psd”file2.idx = “3”file2.name = “Sale 2010.xls”

The template section will be expanded to:

1 : Acme industries.eps2 : ACME_hq.psd3 : Sale 2010.xls

A multi-line loop can be created using specific loop tags. These tags are only used to create the loop and will not be printed. A loop tag needs to be aligned to the left of the line and the follow-ing syntax is used: “#TOKEN@<#” where TOKEN is the numbered variable token name - for example “file” - followed by the section to loop and then closing the section again by the end token “#TOKEN@>#”.

Following example from the default template shows the use of a multi-line loop on the meta@ variable:

#meta@<#--------------------------#[email protected]# = #[email protected]##meta@>#

With the data

meta0 = “0”meta0.name = “Company”meta0.val = “ACME Inc”meta1 = “1”meta1.name = “Reference”meta1.val = “Donald Duck”meta2 = “2”meta2.name = “Delivery”meta2.val = “ASAP”

The template section will be expanded to:

--------------------------Company = ACME Inc--------------------------

A multi-line loop tag needs to start the

line to the left

Page 30: EnRoute - Amazon Simple Storage Service (S3)

30

Reference = Donald Duck--------------------------Delivery = ASAP

It is possible to put single line loops within multi-line loops. For example, when retreiving Ven-ture data from files in an event, these turn up as subindex for the main index:

file0 = “Acme industries.eps”file0.idx = “1”file0.name = “Acme industries.eps”file0.ventname0 = “Creation date”file0.ventcont0 = “2010-06-01”file0.ventname1 = “Artist - Photographer”file0.ventcont1 = “DD”file1 = “ACME_hq.psd”file1.idx = “2”file1.name = “ACME_hq.psd”file1.ventname0 = “Creation date”file1.ventcont0 = “2009-04-30”file1.ventname1 = “Artist - Photographer”file1.ventcont1 = “Mickey Mouse”

Using template section:

#file@<#--------------------------#[email protected]# : #[email protected]# #[email protected]@# : #[email protected]@##file@>#

Expands to:

--------------------------1 : Acme industries.eps Creation date : 2010-06-01 Artist - Photographer : DD--------------------------2 : ACME_hq.psd Creation date : 2009-04-30 Artist - Photographer : Mickey Mouse

In addition to the repetition tags, there is a tag for logics. The logics tag is very simple and checks for the existence of a certain variable. EnRoute puts a number of these types of variables into the array to be able to print certain sections only under certain circumstances. The logics tag is almost identical to the loop tag and also needs to be placed to the left on the line. It will not be printed and also has a start and end version: “#TOKEN?<#” and “#TOKEN?>#”

The meta data section is available when EnRoute has parsed an upload using the uploadform parsing. If it finds metadata, the control token hasMeta will be available. Using a logics token with hasMeta makes it possible to decide whether to print or not print a section:

#hasMeta?<#Supplied information:#[email protected]# = #[email protected]# #hasMeta?>#

With the data

meta0 = “0”meta0.name = “Company”

A single-line loop can be made within a

multi-line loop

Logic tokens are used to decide if to print

certain sections or not

Page 31: EnRoute - Amazon Simple Storage Service (S3)

31

meta0.val = “ACME Inc”meta1 = “1”meta1.name = “Reference”meta1.val = “Donald Duck”meta2 = “2”meta2.name = “Delivery”meta2.val = “ASAP”hasMeta = “1”

Following is generated:

Supplied information:Company = ACME IncReference = Donald DuckDelivery = ASAP

If hasMeta does not exist in the array, the section will not generate any output. Note that the value of hasMeta is not important. It is the fact that it exists at all that makes the test true.

3.5.3 Email notification data and tokens

As per last section, EnRoute generates a large set of data to be used in email notifications and reports. This list of data is generated automatically and “fed into” the notification and report templates. The content is unique for each execution of every event.

It is possible to output the complete list to a text file to see the exact data available for email notifications and reports when running a certain event. To do this, type in an accessible path in the Content array Debug setting on the Reporting & Notification setup page.

The most common variables are listed in the table below. Note that some data can be accessed from multiple names. In the table all the numbered variables are noted as tokenN, where N will be replaced by 0,1,2,... for example. In some cases there are subsets of numbered variables (as with fileN). These are noted as tokenK.

The main bulk of the dataset consist of fileinformation. The fileinformation is made up of 5 dif-ferent file arrays: file, fileP, fileE, fileF and fileV. All files go into the file array. fileP is made up of the files that have been processed, fileE are files that Errored, fileF are files that were filtered (not used as of version 2) and fileV are files that were found but not verified.

In the list below, we list all the sub sections for the file only. They do exist for the other file arrays if there is an entry for the file in that array.

TOkEN NAME(S) desCRiption

event.name, enroute.name name of event

event.time, enroute.time executiontimeexpressedashours:minutes

event.date, enroute.date executiontimeexpressedasYYYY-MM-DD

event.nfiles numberoffiles

event.scanfolder name of scanned folder

event.ID event id if used

noFiles controlvariable,setto1iftherearenofilesinscan

metaN, metaN.name fieldnameofgeneraluploadmetadata,ifusinguploadformwithmetafields

metaN.val contentofgeneraluploadmetadata,ifusinguploadformwithmetafields

meta.MetanaMe contentofgeneraluploadmetadata,metadatafieldwithnameFIELDNAME,ifusinguploadformwithmetafields

hasMeta controlvariable,setto1iftherearemetafieldvalues

Page 32: EnRoute - Amazon Simple Storage Service (S3)

32

TOkEN NAME(S) desCRiption

file arrayofallfiles

filesA controlvariable,setto1iftherearefilesinfilearray

fileP arrayofPROCESSEDfiles

filesP controlvariable,setto1iftherearefilesinfileParray

fileE arrayofERRORfiles

filesE controlvariable,setto1iftherearefilesinfileEarray

fileF arrayofFILTEREDfiles(notusedasofv2)

filesF controlvariable,setto1iftherearefilesinfileFarray

fileV arrayofNOTVERIFIEDfiles

filesV controlvariable,setto1iftherearefilesinfileVarray

fileN, fileN.name filename

fileN.namenoext filenamewithoutextension

fileN.idx indexwithinfilelist(1,2,3...)

fileN.path filepath

fileN.type "Folder"or"File"dependingontype

fileN.fid Venturefileidoffile

fileN.lastfolder name of last folder in path

fileN.tname, fileN.tname2 targetnamewhenrouting,“2”denotessecondroutingifused

fileN.tpath, fileN.tpath2 targetpathwhenrouting,“2”denotessecondroutingifused

fileN.tfid, fileN.tfid2 targetVenturefileidwhenrouting,“2”denotessecondroutingifused

fileN.name_u filename,URL-encoded

fileN.path_u filepath,URL-encoded

fileN.tname_u, fileN.tname2_u targetnamewhenrouting,URL-encoded,“2”denotessecondroutingifused

fileN.tpath_u, fileN.tpath2_u targetpathwhenrouting,URL-encoded,“2”denotessecondroutingifused

fileN.path_wnurl filepath,WebNativeurl

fileN.path_portalurl filepath,Portalurl

fileN.tpath(2)_wnurl targetpathwhenrouting,WebNativeurl,“2”denotessecondroutingifused

fileN.tpath(2)_portalurl targetpathwhenrouting,Portalurl,“2”denotessecondroutingifused

fileN.comment filecommentonfile

fileN.ventnamek fieldnameofventuremetadataforfileN,fieldK,ifsettocollect

fileN.ventcontk contentofventuremetadataforfileN,fieldK,ifsettocollect

fileN.vent.FIELDNAME contentofventuremetadataforfileN,venturefieldwithnameFIELDNAME,if set to collect

fileN.hasvent setto1ifthereisdatatopresentforthefile,i.e.ifsettocollect

fileN.hast2 set to 1 if there is a second target (ie using a second route on move)

fileN.metanamek fieldnameofuploadmetadataforfileN,fieldK,ifusinguploadformwithfilemetafields

fileN.metavalk contentofuploadmetadataforfileN,fieldK,ifusinguploadformwithfilemetafields

fileN.METANAME contentofuploadmetadataforfileN,metadatafieldwithnameFIELD-NAME,ifusinguploadformwithfilemetafields

fileN.hasmeta setto1ifthereismetadatatopresentforthefile,ifusinguploadformwithfilemetafields

Page 33: EnRoute - Amazon Simple Storage Service (S3)

33

The table below describes the different types of tokens that can be used in an email or report template.

token type desCRiption

#naMe# Simpletokentobereplaced.

## Replacewith#(single#)

#naMe@# Repeatabletoken.WillrepeatfordataNAME0,NAME1,...

#naMe@<# ...#naMe@>#

Repeatabletokensection.WillrepeatentiresectionbetweenstartandendtokenfordataNAME0,NAME1,...andreplaceeachsectionwiththecorrespondingvaluesofNAME0,NAME1,...Tokens need to be aligned to left in file

#naMe?<# ...#naMe?>#

Logictoken.Tokens need to be aligned to left in fileThesectionbetweenstartandendtokenwillbeprocessedifdataNAMEexistsand has a value.

#!naMe?<# ...#naMe?>#

Logictoken.Tokens need to be aligned to left in fileThesectionbetweenstartandendtokenwillbeprocessedifdataNAMEdoesnotexists or exists but has no value.

#NAME==VALUE?<# ...#naMe?>#

Logictoken.Tokens need to be aligned to left in fileThesectionbetweenstartandendtokenwillbeprocessedifdataNAMEexistsandhasavalueexactlyequaltoVALUE

#NAME!=VALUE?<# ...#naMe?>#

Logictoken.Tokens need to be aligned to left in fileThesectionbetweenstartandendtokenwillbeprocessedifdataNAMEdoesnotexistorexistandhasavaluenotequaltoVALUE

Page 34: EnRoute - Amazon Simple Storage Service (S3)

34

Email Example:

Template for generating an email receipt used in an event collecting uploads from form

Page 35: EnRoute - Amazon Simple Storage Service (S3)

35

Resulting email receipt from template above.

3.5.4 Reporting

EnRoute can write a report every time an event is run. The report is written to a specific path and appended to any existing file that may be residing at the path (unless ;replace is added at the end on the path). The report path can be dynamic and include tokens pointing to information in the event´s data (see previous section).

Example: Making a daily report file from an event

Output path for reports: /myraid/Reports/uploads/&date(%Y%m%d)&.report.txt

Uploading files where this Event is running on Sept 20, 2010, will cause EnRoute to write reports to

/myraid/Reports/uploads/20100920.report.txt

If more than one job is run on the setup the same day, the report will be appended to for every time the Event runs.

Should a report be replaced instead of appended, the path should end with ;replace.

Example: Making a report file used as an include to show latest addtion to webnative

Output path for reports: /var/adm/webnative/mysite/latestfiles.js;replace

Every time the Event runs the report file will be replaced instead of appened.

3.5.5 Report template format

EnRoute uses templates to create the reports. The templates share the same technology creating the files as when making email notifications. Further, the same content array is used to “feed” the report template.

The report templates are files saved into a subfolder (reporttempl) in the EnRoute setup direc-tory (/usr/enroute/setup). Each file in this directory will show up as a selectable choice in the

Page 36: EnRoute - Amazon Simple Storage Service (S3)

36

pulldowns for Template for reports.

EnRoute ships with a default report template. This template will be used in case a report path has been entered but no template selected (or default selected).

To create a new report template, copy the template that needs customization into the the folder. Edit the template as needed and select it from the admin interface. Please note that any stand-ard reports shipped with EnRoute should not be edited since they may be overwritten when a software upgrade is made.

The report templates are in plain text and should be edited using a text editor like BBEdit or TextWrangler. Save the files using UNIX linefeeds and encoded as ISO Latin 1. Any empty line in the file will be ignored so if you need a line that shows up as empty, use a space on that line.

When working with reports there are a couple of differences from working with notifications:

• The first line is part of the report. (For notifications, the first line is used as subject in the mail and removed from the body.)

• It is possible to use a header and a tail section in the report template. The header will only be written when a new file is created. The trailer will be removed and re-added everytime a report file is being appended with new data.

Loops, logics and tokens all work the same way as with notifications.

Header section is defined by:

<HEAD>... more lines here</HEAD>

Tail section is defined by:

<TAIL>... more lines here</TAIL>

Note that the tail cannot include any repetitions.

Example. Report for uploads using an uploadform that has two general fields as well as one metadata field per uploaded file.

Report path:

/raid/Reports/Uploads/&date()&.xml

Report template:

<HEAD><?xml version=”1.0” encoding=”ISO-8859-1”?><Uploads></HEAD><upload id=”#event.ID#”> <uploadinfo> id=”#event.ID#” date=”#event.date#” time=”#event.time#” #meta@name#=”#[email protected]#” </uploadinfo>#fileP@<#

Page 37: EnRoute - Amazon Simple Storage Service (S3)

37

<file idx=”#[email protected]#”> name=”#[email protected]#” path=”#[email protected]#” instruction=”#[email protected]#” </file>#fileP@>#</upload><TAIL></Uploads></TAIL>

Running the event and catching two uploads on the same date (2010-10-01) may end up creat-ing following file (using some sample data and other setups)

Filename: /raid/Reports/Uploads/2010-10-01.xml

<?xml version=”1.0” encoding=”ISO-8859-1”?><Uploads><upload id=”2010-10-01-0001”> <uploadinfo> id=”2010-10-01-0001” date=”2010-10-01” time=”14.32” Company=”ACME” PO=”123456” </uploadinfo> <file idx=”1”> name=”Businesscard.pdf” path=”/raid/uploaddata/2010-10-01/0001/Businesscard.pdf” instruction=”Ready to print file” </file> <file idx=”2”> name=”Letter.pdf” path=”/raid/uploaddata/2010-10-01/0001/Letter.pdf” instruction=”Ready to print file. Please check” </file></upload><upload id=”2010-10-01-0002”> <uploadinfo> id=”2010-10-01-0002” date=”2010-10-01” time=”19.13” Company=”ACME Service” PO=”123458” </uploadinfo> <file idx=”1”> name=”Productsheet.zip” path=”/raid/uploaddata/2010-10-01/0002/Productsheet.zip” instruction=”Zip includes all needed components” </file></upload></Uploads>

Page 38: EnRoute - Amazon Simple Storage Service (S3)

38

3.5.6 Report data and tokens

Reports share the data and tokens with Email notifications. For an explanation on the different tokens to be used, see “Email notification data and tokens“ above.

3.5.7 Report examples

Below are a few examples of reports showing the template and the final result.

First Example: XML report

XML report template. The header is only printed when file is created. The tail (not shown in screenshot) is maintained at the end of the file.

Page 39: EnRoute - Amazon Simple Storage Service (S3)

39

The final report after the event has been executed once.

Second Example: report used as an included .js file to create a list of last added assets.

Template to create a js file listing filenames, urls and database values in an array.

Page 40: EnRoute - Amazon Simple Storage Service (S3)

40

Final js file listing with filenames, urls and database values in an array.

3.6 Connect to external mySQL

EnRoute can be set up to connect to an external mySQL database and run SQL queries using the data from the event.

The query is created from a query template much like the report template. It uses the same data, tokens and technology to render as the notifications and reports. Instead of being sent as email or written to disk, it is used to build the queries to send to the external mySQL server.

Inside the “/usr/enroute/setup/dbTempl” is a sample template: DB sample, that illustrate how a

Page 41: EnRoute - Amazon Simple Storage Service (S3)

41

query file may be setup. The actual file to be used depends on the mySQL database to connect to and its layout.

3.7 Testing and Running events from admin

An event can be tested or run from the admin GUI. Click the “test” button next to the save button to test an event. A new window will be open and the test result, including the files that are found, will be shown. No actual routing will take place.

Clicking "Run Event" will fully execute the event, including routing or converting files.

Testing an event from the admin utility

3.8 Scheduling an event

Any defined event needs to be scheduled and set to active before it will be executed. All schedul-ing is done from the Schedules tab. A schedule can either be run on a cycle with a specific wait period or a be based on a timetable that specifies certain run times on certain dates or weekdays. A cyclic schedule with minimum wait period is referred to as a hot folder.

The schedule tab shows an overview of all the events that are scheduled. It is possible to see what events are active and inactive, as well as what type of schedule it has been associated with: cycle or timetable.

Page 42: EnRoute - Amazon Simple Storage Service (S3)

42

Schedule overview

To add a new schedule, select the schedules tab and click the “add schedule” link. You need to select an event and the scheduling type that should be associated with the event. The cyclic schedules are displayed above the dashed line of the pulldown menu. Below the dashed line are the different timetables that have been defined using the Timetables tab.

Adding a new schedule

Any event scheduled with a cyclic schedule cannot be scheduled again. However, several time-tables can be associated with the same event. The pulldown displayed when adding a schedule reflects these limitations.

3.9 Creating Timetables

Use the timetables tab to create named timetables. You can select to run weekly or by dates as well as on any given hour(s) of the day. A single timetable definition can be used to run multiple events by making the appropriate schedules.

The timetables that have been configured are all shown in the Timetables scroll list. To modify or delete an existing timetable, scroll and select a timetable or start typing into the list and then select, followed by clicking the modify or delete timetable buttons.

NOTE: You can edit but not delete a timetable that is used in a schedule.

Page 43: EnRoute - Amazon Simple Storage Service (S3)

43

Timetable scroll list

Adding a new timetable

To create a new timetable, go to the Timetables tab and click the link to “add timetable”. It is now possible to type in a name of the new timetable and, if applicable, select a timetable to copy in case the new timetable should be based on an already existing one.

Editing timetable

A timetable consists of execution days / dates and the times to run on these days.

Page 44: EnRoute - Amazon Simple Storage Service (S3)

44

4 hoUse_inpRess style

The house_inpress styleset is installed with EnRoute to make it easier to create customized upload pages. Using this style makes it easy to take advantage of the EnRoute “uploadscan” to its full capabilities. The style is configurable using a user.js file and allows the admin to control the number of files to upload, metadata fields associated with the uploaded files and metadata fields associated with the entire upload. It is also possible to add informative text and to decide what fields (or files) need to be required.

The style consists of inpress versions of toplevel, upload, basket, search and browse. For the pur-pose of this document, only the toplevel and upload styles are discussed.

Common for all the setups in this chapter is that the WebNative user.js file is used to configure the behaviour. The user.js file is saved to the user’s directory in /var/adm/webnative. The name of the file is user.js and it gets loaded prior to the style. The file needs to supply the proper javas-cript tags and configurations are made using javascript variables and objects. For more informa-tion regarding the user.js file look at the Xinet manuals.

4.1 house_inpress toplevel setup

The toplevel style has a few settings that allow you to control access to upload sections for a user as well as some features to show custom information for the user. To control access to uploads there are three variables available:

uploaddirect_p, uploaddirect_n and uploadonly. All three variables are booleans and should be set to true in order to affect the style. The variable hidevolume is used to hide a volume. It can come in handy if we want to hide a volume that we are using for the Xinet uploader.

uploaddirect_p and uploaddirect_n removes the browse and search access to a volume when the path or name includes the word “upload” while uploadonly redirects the user to the uploadpage for the first volume encountered with name or path including the word “upload”.

Upload related options for the toplevel style:

option desCRiption

uploaddirect_n Settotrue,changesbrowseaccesstouploadandremovessearchonanyvolumeusingtheword“upload”inthename.Alsoremovesbrowseaccess from the upload page.

uploaddirect_p Settotrue,changesbrowseaccesstouploadandremovessearchonanyvolumeusingtheword“upload”inthepath.Alsoremovesbrowseaccess from the upload page.

uploadonly Settotrue,redirectsuserdirecttotheuploadpageforthefirstvolumewith“upload”inthenameorpath.Alsoremovesbrowseandtoplevelaccess from the upload page.

hidevolume Settoatext,toplevelwillhidethevolumethatcontainsthetextinitsname

Example:

We want a toplevel that gives us only access to an upload volume through the upload form and to hide access to another volume used for uploads via the Xinet uploader. Both volume paths are monitored by EnRoute.

To enable this behaviour:

1) Make a volume only used for uploads through the form. Name the volume including the word “upload” or include the word “upload” in the path to the volume.

Page 45: EnRoute - Amazon Simple Storage Service (S3)

45

2) Make a volume only used for uploads through the Xinet uploader. Name the volume in a way that is easy identify.

3) In WebNative, turn on the house_inpress toplevel style

4) Make a user.js file for the user. Put in javascript tags and create the controlvariables “uploaddirect_n” or “uploaddirect_p” true. Use _n when you want to use the name to trigger and _p when you want to the path to trigger.

5) Put in the control variable “hidevolume” with the text you want to use to identify vol-umes to hide.

<SCRIPT LANGUAGE="javascript"> var uploaddirect_p=true var hidevolume="incoming from" </SCRIPT

Toplevel before and after

Other toplevel house_inpress setups of interest are toplevel_title and toplevel_instr. toplevel_ti-tle is used to change the title in the top banner and the toplevel_instr variable is an array of texts, that if present will print below the banner but before the table of volumes.

Other toplevel options:

option desCRiption

toplevel_title Text to print in the top banner.vartoplevel_title=“MYOWNTITLE”

toplevel_instr Arrayoftextstoprintinbelowthetopbanner.vartoplevel_instr=newArray()toplevel_instr[0]=“Myfirstlineofinstructionaltext.”toplevel_instr[1]=“Mysecondlineofinstructionaltext.”

Page 46: EnRoute - Amazon Simple Storage Service (S3)

46

sample toplevel style using all the options

4.2 house_inpress upload setup

The upload form is controlled using a single javascript object: uploadconf. The object has several sub-objects that can be defined. Place this object in the user.js file for the user where the style is applied.

The style is installed in /usr/etc/webnative/styles/upload and is named house_inpress. Inside the style there are four files: upload.html, include.js, spinning_counter.gif and user.js.sample

The upload.html is the style itself. The image spinning_counter.gif is an animation shown when an upload has been initiated and the user.js.sample file is a file you can use as a starting point to make your own user.js file. Most of the sample configurations and text below come from the user.js.sample file. The include.js file can be included into the user.js file to provide some needed functions for the upload style. As an alternative, the content of the include file can also be copied and pasted into the user.js that is made for the user.

The uploadconf object controls following aspects of the upload:

- Titles and texts

- Number of files to upload

- Input fields, hidden datafields and popups associated with the files

- Input fields, hidden datafields and popups as general data

- Fields and Files can be set to required

- Fields can be set to hidden

Copy the user.js.sample file or copy and paste from user.js.sample into your already existing user.js file. Since the uploadconf object is built using the provided build functions it is important that you also include the link to the include.js file or copy the build functions. The user.js.sample file has the link for including the functions already at the top.

Page 47: EnRoute - Amazon Simple Storage Service (S3)

47

Create the object by adding this into the user.js file:

1) Create main object

var uploadconf = new Object();

2) Add main setups

Main setups control the upload report name, title and success strings, information text.

Main setUp desCRiption

uploadconf.reportname Nameofthereportafteruploadisfinished.Thisisarequiredsetup.uploadconf.reportname=“uploadreport”;

uploadconf.title Title to print on top of upload page. It is possible to use the WebNative lang string “lang.upload” hereuploadconf.title=lang.upload

uploadconf.title_uploaded Title to print after upload is done. It is possible to use the WebNative lang string “lang.upped” hereuploadconf.title_uploaded=“Wehaveyourfiles!”

uploadconf.instructions Text appearing below the title. uploadconf.instructions=“Theinstructionsgohere”

uploadconf.nobrowse Settotrue,itturnsoffthebrowsebuttonintheuploadform.Thesamecanbe accomplished using the uploaddirect_ variables in the toplevel.

uploadconf.width Width of the title column in the form. Defaults to “25%”uploadconf.width=“35%”

uploadconf.anim Webpath to an animation to use while waiting for the upload. If notspecified,itwilldefaultto“/webnativedoc/images/spinning_counter.gif”uploadconf.anim=“/webnativedoc/images/my_own_counter.gif”

3) Add main input fields. These fields will be printed before the file selection and file inputs. This is an array where every input field should be defined. An input field can be a single input, hidden input or a pulldown menu. There are controls for making a field required, giving it a default value and setting the input size.

Create the array:

uploadconf.maininputs = new Array();

Add array elements. One for every field you need. The fields will be printed in the order they appear in the array. Every field is defined using the addInputObj() function:

uploadconf.maininputs[0] = new addInputObj(“Project”,“PROJID”,20,“test”,true,false);uploadconf.maininputs[1] = new addInputObj(“Project type”,“PROJTYPE”,20,“External”, true,false);

The inputs to the function are following, in the order they appear below:

UploadConF.MaininpUts explanation

title Titletextshownintheform.Putinquotes,example:“Project”

name Nameusedforfieldintheform.ThisisalsothenametouseinEnRoutetosetdatabasefields,routefilesandtoincludeinreportsThefieldisreferencedinEnRouteusing“meta.<name>”where“<name>”shouldbereplacedwiththeactualfieldname.example:“PROJID”

size Inputfieldsize,example:20

default Defaultvalueshowninformwhenloading.Putinquotes,example:“test”

required true/false,makesafieldrequired

hidden true/false,makesafieldhidden.Defaultvaluewillbeused.

Page 48: EnRoute - Amazon Simple Storage Service (S3)

48

To make a pulldown, you also need to define an array with value pairs to the maininput array element. The pair is defined using texts in a buildfunction where the first text is the title displayed in the pulldown and the second text is the actual value.

uploadconf.maininputs[1] = new addInputObj(“Project type”, “PROJTYPE”, 20, “Exter-nal”, true, false);uploadconf.maininputs[1].pop = new Array();uploadconf.maininputs[1].pop[0] = new addPopVal(“”, “”);uploadconf.maininputs[1].pop[1] = new addPopVal(“Internal”, “Internal”);uploadconf.maininputs[1].pop[2] = new addPopVal(“External”, “External”);

4) Add upload file definitions.

This is an array that defines the number of files to upload, titles on the upload, if the upload is required and if to display the comment field in the form.

Create the array:

uploadconf.fileuploads = new Array();

Add array elements. One for every file upload you need. The file uploads will be printed in the order they appear in the array. Every field is defined using the addFileUpload() function.

uploadconf.fileuploads = new Array();uploadconf.fileuploads[0] = new addFileUpload(“File 1”, true, true);uploadconf.fileuploads[1] = new addFileUpload(“File 2”, true, false);

The inputs to the function are following:

UploadConF.FileU-ploads

explanation

title Title text shown in the form. Put in quotesexample:“File1”

comment true/false,turnson/offthecommentinputfieldforthefileupload

required true/false,makesafieldrequired

It is possible to have input fields associated with a specific file upload. The fields are of the same type as the main input fields and will appear only for that file. If you want file input fields, but want to use the same fields for all file uploads, please jump to section 5 below.

Create the array:

uploadconf.fileuploads[1].localinputs = new Array();uploadconf.fileuploads[1].localinputs = new Array();uploadconf.fileuploads[1].localinputs[0] = new addInputObj(“File 2 Specific”, “FILE-2Data”, 40, “”, true, false);uploadconf.fileuploads[1].localinputs[1] = new addInputObj(“File 2 Hidden”, “FILE-2Hidden”, -1, “This data will be posted as hidden”, false, true);

Note that the index in the array decides in what order the fields will be shown

5) Add general upload file input fields.

It is possible to have the same input fields associated with all file uploads. The fields are of the same type as the main input fields and will appear once for every file. The fields will be printed in the order they appear in the array.

Create the array:

uploadconf.fileinputs = new Array();uploadconf.fileinputs[0] = new addInputObj(“Photographer”, “PHOTO”, 40, “Input name here...”, true, false);

Page 49: EnRoute - Amazon Simple Storage Service (S3)

49

uploadconf.fileinputs[1] = new addInputObj(“Status”, “STATUS”, -1, “”, true, false);uploadconf.fileinputs[1].pop = new Array();uploadconf.fileinputs[1].pop[0] = new addPopVal(“”, “”);uploadconf.fileinputs[1].pop[1] = new addPopVal(“Approved”, “Approved”);uploadconf.fileinputs[1].pop[2] = new addPopVal(“Rejected”, “Rejected”);

Example:

Following example shows the javascript object used to create an upload form as well as a screen-shot showing the resulting form. Note that the text definitions have been shortened in the sample.

var uploadconf = new Object();

uploadconf.reportname = “uploadreport”;uploadconf.title = “Uploads from Clients”;uploadconf.title_uploaded = “Thank you for the uploaded Job. You will soon receive an e-mail receipt”;uploadconf.instructions = “Upload the number of files you need for the job.<br>Please be ”

uploadconf.maininputs = new Array();uploadconf.maininputs[0] = new addInputObj(“Your Company Name”, “COMPANY”, 40, “”, true, false);uploadconf.maininputs[1] = new addInputObj(“Your Company ID”, “COMPANYID”, 40, “”, false, false);uploadconf.maininputs[2] = new addInputObj(“Your Order Number”, “PONUMBER”, 40, “”, true, false);uploadconf.maininputs[3] = new addInputObj(“Delivery type”, “DELIVERY”, 40, “Nor-mal”, true, false);uploadconf.maininputs[3].pop = new Array();uploadconf.maininputs[3].pop[0] = new addPopVal(“”, “”);uploadconf.maininputs[3].pop[1] = new addPopVal(“Normal”, “Normal”);uploadconf.maininputs[3].pop[2] = new addPopVal(“Rush”, “Rush”);uploadconf.maininputs[4] = new addInputObj(“E-mail me receipt”, “EMAIL”, 40, “”, true, false);

uploadconf.fileuploads = new Array();uploadconf.fileuploads[0] = new addFileUpload(“File 1”, false, true);uploadconf.fileuploads[1] = new addFileUpload(“File 2”, false, false);

uploadconf.fileinputs = new Array();uploadconf.fileinputs[0] = new addInputObj(“Type”, “JOBTYPE”, -1, “”, true, false);uploadconf.fileinputs[0].pop = new Array();uploadconf.fileinputs[0].pop[0] = new addPopVal(“”, “”);uploadconf.fileinputs[0].pop[1] = new addPopVal(“Print Ready”, “Printready”);uploadconf.fileinputs[0].pop[2] = new addPopVal(“Native File”, “Native”);uploadconf.fileinputs[0].pop[3] = new addPopVal(“Artwork”, “Artwork”);uploadconf.fileinputs[1] = new addInputObj(“Note”, “JOBNOTE”, 40, “”, false, false);

Page 50: EnRoute - Amazon Simple Storage Service (S3)

50

Custom title

information text

Main inputs. 4 are required1 pulldown

2 files defined as uploads1st file is requiredThey share the same 2 input fields Type pulldown is required

Resulting Upload form configured by setup above

4.3 house_inpress upload language

There are a few new language strings that may be changed. These can be added making your own language style or by adding them to the user.js file as well. Following are the four language string names and the defaults that will be used unless added by the user:

lang.fieldisreq = “is a required field!” lang.fileisreq = “is a required file upload!” lang.selectfiles = “You need to select files to upload!” lang.moreuploads = “More uploads”

4.4 Triggering EnRoute event from House_inpress toplevel

An event can be triggered from a link in the House_inpress toplevel style.

The link that is created should be configured from the user.js file like all other configurations for the style:

var ajaxLinks = [{title:"Run event...", cgi: "/webnative/inprtools/enrtrig?Eventname" }];

Page 51: EnRoute - Amazon Simple Storage Service (S3)

Appendix AX, InPress Systems Software License

Our software license is included here so you can read it before using the software. DO NOTinstall the software from this distribution digitaly delievered or by CD media until you havecarefully read this Agreement. BY INSTALLING THIS SOFTWARE YOU ACCEPT ALLTHE TERMS AND CONDITIONS OF THIS AGREEMENT. If you do not agree with theterms and conditions of this Agreement, return the software package within a reasonable timeto your supplier for a full refund.

In return for acquiring a license to use the software and related documentation ("Software"),you agree to the following terms and conditions:

1. Grant of LicenseInPress Systems grants to you a nonexclusive, nontransferable license to use the Software onone computer system and to make one copy of the software solely for backup purposes. Youmust place the same copyright and other proprietary rights notices on any copy of theSoftware as appears on the original. You must not transfer, sell, assign, rent or distribute anycopies of the Software to others. InPress Systems reserves all rights not expressly granted toyou.

2. Proprietary RightsAs a licensee, you own the media on which the Software is originally recorded. The Softwareis copyrighted by and proprietary to InPress Systems and its suppliers. InPress Systems andits suppliers retain title and ownership of all copies of the Software. The nonexclusive licenseset forth in this Agreement is not a sale of the Software or any copy. You agree that you willnot assign, sublicense, transfer, pledge, lease or share your rights under this Agreement andagree to take all reasonable steps to prevent unauthorized use. You agree you may not reverseassemble, reverse compile, or otherwise translate the software.

3. No Other RightsExcept as stated above, this Agreement does not grant you any rights to patents, copyrights,trade secrets, trade names, trademarks (whether registered or unregistered), or any otherrights, franchises, or license in respect of the Software. You MAY NOT MODIFYTRANSLATE, DISASSEMBLE, OR DECOMPILE THE SOFTWARE OR ANY COPY, INWHOLE OR IN PART.

4. TermThe license is effective until terminated. You may terminate the license at any time bydestroying the Software (including the related documentation) together with all copies ormodifications in any form. InPress Systems will have the right to terminate your licenseimmediately if you fail to comply with any term or condition of the Agreement. Upon anytermination you must destroy the Software together with all copies or modifications in anyform.

5. LIMITED WARRANTYInPress Systems warrants to you that the Software will perform substantially in accordancewith the user's manual for a period of thirty (30) days after delivery to you ("WarrantyPeriod"). If the Software fails to comply with this limited warranty, InPress Systems will at itsoption and at no cost to you, correct errors you discover which you report during the Warranty

Page 52: EnRoute - Amazon Simple Storage Service (S3)

Period, or replace the Software, or refund the license fee paid for the Software provided youreturn the Software. INPRESS SYSTEMS AND ITS SUPPLIERS DO NOT AND CANNOTWARRANT THE PERFORMANCE OR RESULTS YOU MAY OBTAIN BY USING THESOFTWARE OR DOCUMENTATION. THE FOREGOING STATES THE SOLE ANDEXCLUSIVE REMEDIES INPRESS SYSTEMS WILL PROVIDE FOR BREACH OFWARRANTY. YOU UNDERSTAND THAT, EXCEPT FOR THE FOREGOING 30-DAYLIMITED WARRANTY, INPRESS SYSTEMS AND ITS SUPPLIERS MAKE NOWARRANTIES EXPRESS OR IMPLIED, AS TO PERFORMANCE, OR NON-INFRINGEMENT OF THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESSFOR ANY PARTICULAR PURPOSE. Some states do not allow the exclusion of impliedwarranties or limitations on how long an implied warranty may last, so the above limitationsmay not apply to you. This warranty gives you specific legal rights and you may also haveother rights which vary from state to state.

a. LIMIT OF LIABILITYIN NO EVENT WILL INPRESS SYSTEMS OR ITS SUPPLIER BE LIABLE TO YOUFOR ANY SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGSOR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF INPRESSSYSTEMS OR ANY INPRESS SYSTEMS REPRESENTATIVE HAS BEEN ADVISED OFTHE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHERPARTY. Some states do not allow the exclusion or limitation of incidental or consequentialdamages, so the above limitation or exclusion may not apply to you.

b. Integration.You acknowledge that you have read this Agreement, understand it, and that by installing thesoftware you agree to be bound by its terms and conditions. You further agree that it is thecomplete and exclusive statement of the agreement between InPress Systems and you whichsupersedes any proposal or prior agreement, oral or written, and any other communicationsbetween InPress Systems and you relating to the subject matter of this Agreement. Novariation of the terms of the Agreement or any different terms will be enforceable againstInPress Systems unless InPress Systems gives its express consent, including an expresswaiver of the terms of this Agreement, in writing signed by an officer of InPress Systems.

6. Governing LawThis Agreement shall be governed by and construed in accordance with the laws of Swedenwithout giving effect to the choice of law principles thereof.

7. ArbitrationAny dispute, controversy or claim araising out of or in connection with this Agreement, or thebreach, termination or invalidity thereof, shall be settled by arbitration in accordance withGöteborgsklausulerna om skiljeförfarande (simplified rules of arbitation). The arbital tribunalshall be composed of one arbitrator.