Editing Task Configuration Files

An import configuration file contains definitions of the following properties:

importDirectory

The path of an import folder on the server that the import service will watch for new files. Any files appearing in this folder that match the specifications given with the filenames property will be automatically imported. For example:

importDirectory=/var/spool/escenic/import/pub1
fileNames

The files to watch for in the import folder specified with importDirectory. You can use wildcards, and you can specify several file names, separated by commas. You can also specify files in other folders by preceding the file names with relative paths. For example:

fileNames=*.xml,feeds/ntb.rss,feeds/reuters.xml
archiveDirectory

The path of an archive folder on the server to which successfully imported files will be copied. The folder is created if it does not exist. Here is an example archiveDirectory specification:

archiveDirectory=/var/cache/escenic/import/pub1/archive
errorDirectory

The path of an archive folder on the server to which files that fail to import will be copied. The folder is created if it does not exist. Here is an example errorDirectory specification:

errorDirectory=/var/cache/escenic/import/pub1/errors
contentDirectory

The path of an archive folder on the server in which an individual syndication file will be stored for each content item processed. The folder must contain three sub-folders called success, warning and error. Each of these three directories again has a sub-folder for each content type imported.

For every content item that is successfully imported, a syndication file is stored in the success/content_content-type folder.

For every content item that is imported with warnings, a syndication file is stored in the warning/content_content-type folder, with the warnings embedded as comments.

For every content item that fails to be imported, a syndication file is stored in the error/content_content-type folder, with the error messages embedded as comments. The files are given names of the form:

source _ source-id .xml

contentDirectory and its sub-folders are created if they do not exist.

You will most likely find it more useful to define a contentDirectory than an archiveDirectory and errorDirectory. It is easier to trace errors using contentDirectory output, since error messages are packaged together with the content item that caused them. You can, however, define all three folders if you wish.

Here is an example contentDirectory specification:

contentDirectory=/var/cache/escenic/import/pub1/content
publicationId

The id of the publication to which files are to be imported. You can use publicationName instead of this property to identify the publication if you wish. If you specify both publicationId and publicationName then publicationId is used. For example:

publicationId=pub1
publicationName

The name of the publication to which files are to be imported. You can use publicationId instead of this property to identify the publication if you wish. If you specify both publicationId and publicationName then publicationId is used. For example:

publicationName=pub1
defaultSectionId

The id of a default section for imported content items. Content items that are not explicitly assigned to sections in the imported syndication file are added to this section. You can use defaultSectionName instead of this property to identify the default section if you wish. If you specify both defaultSectionId and defaultSectionName then defaultSectionId is used. For example:

defaultSectionId=sports
defaultSectionName

The name of a default section for imported content items. Content items that are not explicitly assigned to sections in the imported syndication file are added to this section. You can use defaultSectionName instead of this property to identify the default section if you wish. If you specify both defaultSectionId and defaultSectionName then defaultSectionId is used. When using defaultSectionName to look up the default section it is first matched against unique section names. If no match is found, then it is matched against section names. For example:

defaultSectionName=Sports and Leisure
defaultUserId

The id of a default user for imported content items. The specified user is set as the creator of imported content items that do not have an explicitly specified creator in the imported syndication file. You can use defaultUserName instead of this property to identify the default section if you wish. If you specify both defaultUserId and defaultUserName then defaultUserId is used. For example:

defaultUserId=smithj
defaultUserName

The name of a default user for imported content items. The specified user is set as the creator of imported content items that do not have an explicitly specified creator in the imported syndication file.. You can use defaultUserId instead of this property to identify the default section if you wish. If you specify both defaultUserId and defaultUserName then defaultUserId is used. For example:

defaultUserName=John Smith
fileComparatorClass

The name of a Java class that is used to determine the order in which files found in the import folder are imported. For example:

fileComparatorClass=com.escenic.syndication.xml.comparator.DateComparator

The following predefined classes are provided:

com.escenic.syndication.xml.comparator.DateComparator

Files are imported in date order (oldest first). The date used for comparison purposes is the "last edit" date normally shown in file listings, not the creation date.

com.escenic.syndication.xml.comparator.DateComparatorDesc

Files are imported in reverse date order (newest first). The date used for comparison purposes is the "last edit" date normally shown in file listings, not the creation date.

com.escenic.syndication.xml.comparator.NameComparator

Files are imported in alphabetical order.

com.escenic.syndication.xml.comparator.NameComparatorDesc

Files are imported in reverse alphabetical order.

You can add other sorting methods by implementing your own comparator classes that implement the java.util.Comparator interface. The import service supplies two File objects as parameters to the comparator class's compare() method.

If you do not specify a comparator, then files are imported in alphabetical order.

preFilters

This property can be used to specify prefilters for processing input files. It is a mapped property. This means you can assign multiple indexed values to the property using dotted indices as follows:

preFilters.jpg=./filter/IPTCStreamFilter
preFilters.default=./filter/DefaultPreFilter

The property index is used as a file type selector: the first example above specifies that all import files with the extension .jpg are to be processed by filter/IPTCStreamFilter (see Configuring Prefilters). The special index default can be used to specify a default prefilter that will be used to process all files that are not specifically selected. If you do not specify a default prefilter, then any input files that are not specifically selected will not be processed by a prefilter. The referenced prefilters are actually .properties files in the filter subfolder containing prefilter configuration properties. For the above example the filter subfolder would need to contain two files called IPTCStreamFilter.properties and DefaultPreFilter.properties. For information about prefilter configuration, see Configuring Prefilters.

You can specify several prefilters, separated by commas. The specified filters then form a chain in which output from one is passed as input to the next. For example:

preFilters.jpg=./filter/IPTCStreamFilter1,./filter/IPTCStreamFilter2
SAXFilters

This property can be used to specify filters for processing input files. It is a mapped property. This means you can assign multiple indexed values to the property using dotted indices as follows:

SAXFilters.jpg=./filter/DebugFilter,./filter/IPTCFilter,./filter/DebugFilter
SAXFilters.default=./filter/DebugFilter,./filter/DefaultFilter,./filter/DebugFilter

The property index is used as a file type selector: the first example above specifies that all import files with the extension .jpg are to be processed by a particular chain of filters. The special index default can be used to specify a default filter chain that will be used to process all files that are not specifically selected. If you do not specify a default filter chain, then any input files that are not specifically selected will not be filtered. The referenced filters are actually .properties files in the filters subfolder containing filter configuration properties. For the above example the filters subfolder would need to contain two files called IPTCFilter.properties and DefaultFilter.properties. For information about filter configuration, see Configuring Filters.

importReporter

Specifies the location of the import reporter configuration file.

importReporter=/com/escenic/syndication/xml/ImportReporter

For more information about configuring the import reporter see Configuring an Import Reporter.