>, Staff member functions, Workflow automation>Importing restrictions and reservations with Job server

Importing restrictions and reservations with Job server

This article explains how you can import time-based file restrictions and reservations from a CSV file with the Job server function.

If you haven’t used the Job server function before then please read the Job server article first.
To learn more about time-based restrictions, read the article Restrictions and reservations.

CSV file specifications

You can prepare your file using e.g. MS Excel, Libre Office Calc or other spreadsheet software, simply save your file as a CSV (Comma Separated Values) file when you’re done.
The first row of your file must be a header row with the column names:

  • ID
    Required. This column will hold the values used to look up the files in the database. It must be called ID regardless of the actual field that you are using (e.g. refcode, id, objectname etc.).
  • TYPE
    Optional. If you add this column, then it must have the value 1 for a restriction, or 2 for a reservation. If no value is supplied, the default 1 (restriction) is used.
    Optional. If you don’t add this column then the start date will be set to the data that your job is processed. If  you add a date then it must be in the format dd/mm/yyyy.
    Optional. If you don’t add this column then the end date will be set to the start date + 1 year. If  you add a date then it must be in the format dd/mm/yyyy.
    Optional. The notes column holds any internal notes that you would like to store.
    Required. The description column holds the text that will be visible on the client facing pages.
    Optional. The column must have valid user id’s if your CSV file has data to link the restriction/reservation to a user account.
    Optional. This column must have 0 to disable reminders or 1 to enable reminders. If no data is supplied, then reminders are disabled.
    Optional. This column must have 1 to display the restriction on previews, or 0 if you don’t want this. If no data is supplied then restrictions will show on previews (i.e. the default is 1).
    Optional. This column must have 1 to display the restriction on order/cart pages. If no data is supplied then the default value 1 is used.
    Optional. This column must have 1 to make the restriction block downloads. If no data is supplied then the default value 0 is used (i.e. downloads are not blocked).
    Optional. This column must have 1 to make the restriction block the “add to order” function. If no data is supplied then the default value 0 is used (i.e. add to order is possible).
    Optional. If the value 1 is supplied then the file will be excluded from search results during the duration of the restriction/reservation. The default is 0.
    Optional. If no values are supplied then the restriction/reservation is not a territory restriction, i.e. it is created as a normal restriction – not linked to any countries. To make a restriction apply to specific countries, add a comma separated list of ISO 3166 country codes. You can find the codes at the bottom of this article.

Note that the column names must be in the header row exactly as above (i.e. no spaces, all capitals).

Required and optional columns

As described above, there are only two required columns – i.e. ID and DESCRIPTION. This means that you can upload a CSV file with just these two columns if you want to. For any missing columns the default values will be applied.

The Look up values column

Your CSV file must have values that are used to look up the files in your database. The column header in the CSV file must be named ID (as explained above), but you can specify a field name to use in the job properties. E.g. to look up files using the objectname field, simply select that field in the properties drop down box.

Duplicate entries

Since there may be many restrictions/reservations for a file, the system can’t check for duplicate entries. If you upload and process the same CSV file more than once, then the restrictions will be added regardless. So if there was a problem with your import/processing job – it’s a good idea to contact support as opposed to just running the job again.

ISO 3166 country codes

To make restrictions or reservations apply to specific countries only (as opposed to “World wide”), enter the below ISO codes and use commas to separate multiple codes.
For example “NL,BE,LU,DE” for “The Netherlands, Belgium, Luxembourg and Germany“.

ISO Country
AX Åland Islands
AF Afghanistan
AL Albania
DZ Algeria
AS American Samoa
AD Andorra
AO Angola
AI Anguilla
AQ Antarctica
AG Antigua and Barbuda
AR Argentina
AM Armenia
AW Aruba
AU Australia
AT Austria
AZ Azerbaijan
BS Bahamas
BH Bahrain
BD Bangladesh
BB Barbados
BY Belarus
BE Belgium
BZ Belize
BJ Benin
BM Bermuda
BT Bhutan
BO Bolivia, Plurinational State Of
BA Bosnia and Herzegovina
BW Botswana
BV Bouvet Island
BR Brazil
IO British Indian Ocean Territory
BN Brunei Darussalam
BG Bulgaria
BF Burkina Faso
BI Burundi
CI Côte D’Ivoire
KH Cambodia
CM Cameroon
CA Canada
CV Cape Verde
KY Cayman Islands
CF Central African Republic
TD Chad
CL Chile
CN China
CX Christmas Island
CC Cocos (Keeling) Islands
CO Colombia
KM Comoros
CG Congo
CD Congo, The Democratic Republic Of The
CK Cook Islands
CR Costa Rica
HR Croatia
CU Cuba
CY Cyprus
CZ Czech Republic
DK Denmark
DJ Djibouti
DM Dominica
DO Dominican Republic
EC Ecuador
EG Egypt
SV El Salvador
GQ Equatorial Guinea
ER Eritrea
EE Estonia
ET Ethiopia
FK Falkland Islands (Malvinas)
FO Faroe Islands
FJ Fiji
FI Finland
FR France
GF French Guiana
PF French Polynesia
TF French Southern Territories
GA Gabon
GM Gambia
GE Georgia
DE Germany
GH Ghana
GI Gibraltar
GR Greece
GL Greenland
GD Grenada
GP Guadeloupe
GU Guam
GT Guatemala
GG Guernsey
GN Guinea
GW Guinea-Bissau
GY Guyana
HT Haiti
HM Heard Island and Mcdonald Islands
VA Holy See (Vatican City State)
HN Honduras
HK Hong Kong
HU Hungary
IS Iceland
IN India
ID Indonesia
IR Iran, Islamic Republic Of
IQ Iraq
IE Ireland
IM Isle Of Man
IL Israel
IT Italy
JM Jamaica
JP Japan
JE Jersey
JO Jordan
KZ Kazakhstan
KE Kenya
KI Kiribati
KP Korea, Democratic People’S Republic Of
KR Korea, Republic Of
KW Kuwait
KG Kyrgyzstan
LA Lao People’S Democratic Republic
LV Latvia
LB Lebanon
LS Lesotho
LR Liberia
LY Libyan Arab Jamahiriya
LI Liechtenstein
LT Lithuania
LU Luxembourg
MO Macao
MK Macedonia, The Former Yugoslav Republic Of
MG Madagascar
MW Malawi
MY Malaysia
MV Maldives
ML Mali
MT Malta
MH Marshall Islands
MQ Martinique
MR Mauritania
MU Mauritius
YT Mayotte
MX Mexico
FM Micronesia, Federated States Of
MD Moldova, Republic Of
MC Monaco
MN Mongolia
ME Montenegro
MS Montserrat
MA Morocco
MZ Mozambique
MM Myanmar
NA Namibia
NR Nauru
NP Nepal
NL Netherlands
AN Netherlands Antilles
NC New Caledonia
NZ New Zealand
NI Nicaragua
NE Niger
NG Nigeria
NU Niue
NF Norfolk Island
MP Northern Mariana Islands
NO Norway
OM Oman
PK Pakistan
PW Palau
PS Palestinian Territory, Occupied
PA Panama
PG Papua New Guinea
PY Paraguay
PE Peru
PH Philippines
PN Pitcairn
PL Poland
PT Portugal
PR Puerto Rico
QA Qatar
RE Réunion
RO Romania
RU Russian Federation
RW Rwanda
BL Saint Barthélemy
SH Saint Helena
KN Saint Kitts and Nevis
LC Saint Lucia
MF Saint Martin
PM Saint Pierre and Miquelon
VC Saint Vincent and The Grenadines
WS Samoa
SM San Marino
ST Sao Tome and Principe
SA Saudi Arabia
SN Senegal
RS Serbia
SC Seychelles
SL Sierra Leone
SG Singapore
SK Slovakia
SI Slovenia
SB Solomon Islands
SO Somalia
ZA South Africa
GS South Georgia and The South Sandwich Islands
ES Spain
LK Sri Lanka
SD Sudan
SR Suriname
SJ Svalbard and Jan Mayen
SZ Swaziland
SE Sweden
CH Switzerland
SY Syrian Arab Republic
TW Taiwan, Province Of China
TJ Tajikistan
TZ Tanzania, United Republic Of
TH Thailand
TL Timor-Leste
TG Togo
TK Tokelau
TO Tonga
TT Trinidad and Tobago
TN Tunisia
TR Turkey
TM Turkmenistan
TC Turks and Caicos Islands
TV Tuvalu
UG Uganda
UA Ukraine
AE United Arab Emirates
GB United Kingdom
US United States
UM United States Minor Outlying Islands
UY Uruguay
UZ Uzbekistan
VU Vanuatu
VE Venezuela, Bolivarian Republic Of
VN Viet Nam
VG Virgin Islands, British
VI Virgin Islands, U.S.
WF Wallis and Futuna
EH Western Sahara
YE Yemen
ZM Zambia
ZW Zimbabwe