Skip to content

Client Code Configuration

Grainne Mooney edited this page Feb 28, 2020 · 91 revisions

Home / Configuration / Client Code

/index.html Configuration file.

/index.html is the entry page for application (https://domain.name/index.html#) The file contains entries for Client API Library Java Script listed as below:

  • api.constant.js RequiredOK
  • api.config.js RequiredOK
  • api.library.js RequiredOK
  • api.plugin.js RequiredOK
  • api.plugin.dragndrop.js RequiredOK

More details about Client API Library Java Script at Client API Library Java Script.

Configuration entries at /index.html file.

<!DOCTYPE html>
<html lang="en">

<head>
    <!-- API Constant -->
    <script src="https://cdn.jsdelivr.net/gh/CSOIreland/Client-API-Library/src/js/api.constant.min.js"></script>

    <!-- API Configuration -->
    <script src="https://cdn.jsdelivr.net/gh/CSOIreland/Client-API-Library/src/js/api.config.min.js"></script>

    <!-- API Library -->
    <script src="https://cdn.jsdelivr.net/gh/CSOIreland/Client-API-Library/src/js/api.library.min.js"></script>

    <!-- API Plugin -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/CSOIreland/Client-API-Library/src/css/api.plugin.min.css">
    <script src="https://cdn.jsdelivr.net/gh/CSOIreland/Client-API-Library/src/js/api.plugin.min.js"></script>

    <!-- API Plugin - Drag n Drop -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/CSOIreland/Client-API-Library/src/css/api.plugin.dragndrop.min.css">
    <script src="https://cdn.jsdelivr.net/gh/CSOIreland/Client-API-Library/src/js/api.plugin.dragndrop.min.js"></script>
   
</head>

/config.json configuration file.

/config.json contains development (debug) configuration parameters and constants.

Each Deployment environment have specific version of config.json file:

  • config.json.test
  • config.json.uat
  • config.json.live

URL

  • url.application The base URL of the application with trailing slash
	"url": {
		"application": "https://dev-data.cso.ie/"
	}
  • url.api.public The public API endpoints used for Ajax-JSON-RPC requests used for anonymous authentication.
  • url.api.private The private API endpoints used for Ajax-JSON-RPC requests used for windows authentication.
"url": {
		"api": {
			"public": "https://ws.domain.extension/public/api.jsonrpc",
			"private": "https://ws.domain.extension/private/api.jsonrpc"
		}
	}
  • url.header.logo.alt The alternative text attached to the header logo.
  • url.header.logo.src The path to the image file used in the header.
"url": {
		"header": {
			"logo": {
				"alt": "ORGANISATION NAME",
				"src": "image/logo.png"
			}
		}
	}
  • `url.footer An array of objects used as links in the footer.
  • url.footer.text The text to be displayed in the link.
  • url.footer.href The URL of the page the link goes to.
"url": {
		
			"footer": [
			{
				"text": "WEBSITE NAME",
				"href": "https://www.domain.extension/"
			}
		]
	}

Language

  • language.iso The default client side language.
  • language.iso.code ISO code of default language.
  • language.iso.name Name of default language.
"language": {
		"iso": {
			"code": "en",
			"name": "English"
		}
	}

Embargo

  • embargo.time The time of day to set as the publish time of embargo releases.
"embargo": {
		"time": "11:00:00"
	}
  • embargo.day An array of days of the week by number (Monday=1) to allow publishing of embargo releases.
"embargo": {
		"day": [
			1,
			2,
			3,
			4,
			5
		]
	}

Mask Datetime

How to format datetimes

  • Mask.datetime.ajax Datatime format used in Ajax-JSON-RPC requests.
  • Mask.datetime.display Datatime format used for display in the browser.
  • Mask.datetime.file Datatime format used for download file names.
  • Mask.daterangepicker Datatime format used in the date range picker.
"mask": {
		"datetime": {
			"ajax": "YYYY-MM-DDTHH:mm:ss",
			"display": "DD/MM/YYYY HH:mm:ss",
			"file": "YYYYMMDDTHHMMss",
			"dateRangePicker": "DD/MM/YYYY HH:mm",
		}
	}
  • Mask.date
  • Mask.date Date format used in Ajax-JSON-RPC requests. How to format dates.
  • Mask.date.ajax Date format used in Ajax-JSON-RPC requests.
  • Mask.date.display Date format used for display in the browser.
"mask": {
		"date": {
			"ajax": "YYYY-MM-DD",
			"display": "DD/MM/YYYY"
		}
	}
  • Mask.time How to format times.
  • Mask.time.display Date format used for display in the browser.
"mask": {
		"time": {
			"display": "HH:mm:ss"
		}
	}

Separator

  • separator.thousand.display Thousand separator used for display on browser.
"separator": {
		"thousand": {
			"display": ","
		}
	}
  • separator.decimal.display Decimal separator used for display on browser.
"separator": {
		"decimal": {
			"display": "."
		}
	}

Upload Threshold

Limits on upload file sizes.

  • Upload.treshold.soft: Filesize threshold that will display warning alert to user before upload.
  • Upload.treshold.hard: Filesize threshold that will prevent user to upload.
"upload": {
		"threshold": {
			"soft": 1048576,
			"hard": 104857600
		}
	}
  • Upload UnitsPerSecond

"upload": {
		"unitsPerSecond": {
			"read": 250000,
			"validate": 500000,
			"upload": 70000,
			"update": 40000
		}
	}
  • Upload Timeout

"upload": {
		"timeout": 3600000
	}
  • Regex Phone

"regex": {
		"phone": {
			"pattern": "\\(\\+\\d{1,3}\\)\\s\\d+\\s\\d+\\s\\d+",
			"placeholder": "(+353) 21 452 2253"
		}
	}
  • Entity Data

"entity": {
		"data": {
			"datatable": {
				"length": 100,
				"null": ".."
			},
			"threshold": {
				"soft": 1000,
				"hard": 1000000
			},
			"pagination": 10
		}
	}
  • Entity Build

"entity": {
		"build": {
			"officialStatistics": true,
			"geoJsonLookup": {
				"enabled": true,
				"href": "https://geojson.doamin.extension/"
			}
		}
		
		
  • Entity Release

 "entity": {
		
		"release": {
			"comparison": {
				"threshold": {
					"soft": 1048576
				},
				"differenceClass": "table-danger"
			}
		}
		
		}
			
  • Entity Analytic

"entity": {
		
		"analytic": {
			"dateRangePicker": 29
		}
	}
  • Plugin Sharethis

"plugin": {
		"sharethis": {
			"enabled": false,
			"apiURL": "https://platform-api.sharethis.com/js/sharethis.js#property={0}&product=inline-share-buttons",
			"apiKey": ""
		}
}
  • Plugin Highcharts

"plugin": {
		"highcharts": {
			"enabled": true
		}	
}
  • Plugin Highmaps

"plugin": {
		"highmaps": {
			"featureIdentifier": "AREA_ID",
			"featureName": "AREA_NAME",
			"minColor": "#FFFF00",
			"maxColor": "#990041",
			"useHTML": "true"
		}	
}
  • Plugin Tinymce

"plugin": {
		"tinymce": {
			"apiURL": "https://cdn.tiny.cloud/1/{0}/tinymce/5/tinymce.min.js",
			"apiKey": ""
		}
}
  • Plugin JScookie

"plugin": {
		"jscookie": {
			"path": "/",
			"secure": "true",
			"expires": 365
		}
}
  • Plugin Datatable

"plugin": {
		"datatable": {
			"lengthMenu": [
				[
					10,
					25,
					50,
					100,
					-1
				],
				[
					10,
					25,
					50,
					100,
					"All"
				]
			],
			"responsive": true,
			"fixedHeader": true,
			"dom": "fltip",
			"deferRender": true
		}
}
  • Plugin CookieConsent

"plugin": {
		"cookieConsent": {
			"palette": {
				"popup": {
					"background": "#45c1c0",
					"text": "#ffffff"
				},
				"button": {
					"background": "#006f74",
					"text": "#ffffff"
				}
			},
			"position": "top",
			"static": true,
			"content": {}
		}
	}
}
Clone this wiki locally