Class: DataFormatsManager

Kekule.IO. DataFormatsManager

new DataFormatsManager()

Manager class of data formats. Generally data format item is a hash containing the following fields: { id: String, unique ID of format. dataType: type of data, text, binary or other. fileExts: Array, possible file extension associated with this format. mimeType: String, MIME type associated with this format. }
Source:

Methods

(static) findFormat(mimeType, fileExt) → {Hash}

Find format detail item by mimeType or fileExt.
Parameters:
Name Type Description
mimeType String
fileExt String
Source:
Returns:
Type
Hash

(static) findFormatId(mimeType, fileExt) → {String}

Find format ID by mimeType or fileExt.
Parameters:
Name Type Description
mimeType String
fileExt String
Source:
Returns:
Type
String

(static) getAllIds()

Returns all registered
Source:

(static) getFileExts(id) → {Array}

Returns file extensions of format id.
Parameters:
Name Type Description
id String
Source:
Returns:
Type
Array

(static) getFormatInfo(id) → {Hash}

Returns format detail information. If id not found, null will be returned.
Parameters:
Name Type Description
id String
Source:
Returns:
Type
Hash

(static) getMimeType(id) → {String}

Returns MIME type of format id.
Parameters:
Name Type Description
id String
Source:
Returns:
Type
String

(static) register(id, mimeType, fileExts, title, description, additionalInfo)

Register a new data format. If the mimeType already exists, settings will be merged.
Parameters:
Name Type Description
id String
mimeType String
fileExts Array
title String
description String
additionalInfo Hash
Source:

(static) unregister(id)

Unregister a data format.
Parameters:
Name Type Description
id String
Source: