Skip to content

Client Code Configuration

DeclanBuckley edited this page Dec 8, 2023 · 91 revisions

Home / Configuration / Client Code

How to configure and customise the Client Interface.

The Client configuration is stored and managed under the Client Tier.

/config.

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

The application always reads the configuration from the config.json. By default, the config.json contains the configuration parameters for the Development environment.

Each deployment environment has a specific version of the config.json file, named after their environment (.test, .UAT, .live). During deployment, simply replace the config.json with the relevant file.

URL.

  • url.application. The base URL of the application with a 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 the publishing of embargo releases.
"embargo": {
		"day": [
			1,
			2,
			3,
			4,
			5
		]
	}

Mask

  • Mask.datetime How to format datetimes.
  • Mask.datetime.ajax Datetime format used in Ajax-JSON-RPC requests.
  • Mask.datetime.display Datetime format used for display in the browser.
  • Mask.datetime.file Datetime format used for download file names.
  • Mask.daterangepicker Datetime 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.

  • Upload.treshold: 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.UnitsPerSeconds: Settings for estimating upload progress bar in units per second.
  • Upload.UnitsPerSeconds.read: Estimate for server read speed.
  • Upload.UnitsPerSeconds.validate: Estimate for server validation speed.
  • Upload.UnitsPerSeconds.upload: Estimate for server upload speed.
  • Upload.UnitsPerSeconds.update: Estimate for server uupdate speed.
"upload": {
		"unitsPerSecond": {
			"read": 250000,
			"validate": 500000,
			"upload": 70000,
			"update": 40000
		}
	}
  • Upload.Timeout: Time in milliseconds to abort upload request.
"upload": {
		"timeout": 3600000
	}

Regex.

  • Regex.phone.pattern: Regex of local phone pattern to validate phone numbers against.
  • Regex.phone.Placeholder: Placeholder to display as an example of a valid phone number.
"regex": {
		"phone": {
			"pattern": "\\(\\+\\d{1,3}\\)\\s\\d+\\s\\d+\\s\\d+",
			"placeholder": "(+353) 21 452 2253"
		}
	}

Entity.

  • Entity.data.datatable: Datatable settings for data entity.

  • Entity.data.datatable.length: Default length of datatable.

  • Entity.data.datatable.null: What string to display in datatable when value is null.

  • Entity.data.threshold: Threshold for displaying data results.

  • Entity.data.threshold.soft: Number of records before warning is displayed when viewing data.

  • Entity.data.threshold.hard: Number of records before viewing data is not allowed.

  • Entity.data.pagination: Number of search result to display per page.

"entity": {
		"data": {
			"datatable": {
				"length": 100,
				"null": ".."
			},
			"threshold": {
				"soft": 1000,
				"hard": 1000000
			},
			"pagination": 10
		}
	}
  • Entity.build.officialstatistics: Default setting for official statistics in create.

  • Entity.build.geojsonlookup: Setting for searching for geoJSON files to include in px files.

  • Entity.build.geojsonlookup.enabled: Whether to include geoJSON lookup or not.

  • Entity.build.geojsonlookup.href: URL of geoJSON lookup resource.

"entity": {
		"build": {
			"officialStatistics": true,
			"geoJsonLookup": {
				"enabled": true,
				"href": "https://geojson.doamin.extension/"
			}
		}
		
		
  • Entity.release.comparison.threshold.soft: Threshold before warning user about size of comparison.
  • Entity.release.comparison.differentclass: Bootstrap class to highlight differences in comparison report.
 "entity": {
		
		"release": {
			"comparison": {
				"threshold": {
					"soft": 1048576
				},
				"differenceClass": "table-danger"
			}
		}
		
		}
			
  • Entity.Analytics.datarangepicker: Default date from date in number of days previous for data range picker.
"entity": {
		
		"analytic": {
			"dateRangePicker": 29
		}
	}

Plugin

  • Plugin.sharethis: Setting for share this plugin.
  • Plugin.sharethis.enabled: Whether or not to enable sharethis.
  • Plugin.sharethis.apiURL: URL to sharethis library with api key replaced with (0).
  • Plugin.sharethis.apiKey: Your unique sharethis api key.
"plugin": {
		"sharethis": {
			"enabled": false,
			"apiURL": "https://platform-api.sharethis.com/js/sharethis.js#property={0}&product=inline-share-buttons",
			"apiKey": ""
		}
}
  • Plugin.highcharts: The default option for rendering highcharts.
"plugin": {
		"highcharts": {
			"enabled": true
		}	
}
  • Plugin.highmaps: The default option for rendering highmaps.
"plugin": {
		"highmaps": {
			"featureIdentifier": "AREA_ID",
			"featureName": "AREA_NAME",
			"minColor": "#FFFF00",
			"maxColor": "#990041",
			"useHTML": "true"
		}	
}
  • Plugin.tinymce: The default option for initiating the tinymce text editor.
"plugin": {
		"tinymce": {
			"apiURL": "https://cdn.tiny.cloud/1/{0}/tinymce/5/tinymce.min.js",
			"apiKey": ""
		}
}
  • Plugin.jscookie: The default settings for the jscookie plugin.
"plugin": {
		"jscookie": {
			"path": "/",
			"secure": "true",
			"expires": 365
		}
}
  • Plugin.datatable: Default datatable options that all datatables inherit. Can be overwritten by local options when initiating datatable.
"plugin": {
		"datatable": {
			"lengthMenu": [
				[
					10,
					25,
					50,
					100,
					-1
				],
				[
					10,
					25,
					50,
					100,
					"All"
				]
			],
			"responsive": true,
			"fixedHeader": true,
			"dom": "fltip",
			"deferRender": true
		}
}
  • Plugin.cookieConsent: Default settings for Cookie Consent options.
"plugin": {
		"cookieConsent": {
			"palette": {
				"popup": {
					"background": "#45c1c0",
					"text": "#ffffff"
				},
				"button": {
					"background": "#006f74",
					"text": "#ffffff"
				}
			},
			"position": "top",
			"static": true,
			"content": {}
		}
	}
}
Clone this wiki locally