1 /*global $k*/ 2 3 /** 4 * @class Configuration of a table 5 * @extends $k.AbstractEditorConfiguration 6 **/ 7 $k.TableConfiguration = function() { }; 8 9 /** 10 * Returns the columns of the table 11 * 12 * @function 13 * @returns {object[]} 14 **/ 15 $k.TableConfiguration.prototype.columns = function() { }; 16 17 /** 18 * Filters the elements by the given column values 19 * 20 * @function 21 * @param {$k.SemanticElement[]} elements 22 * @param {object[]} filterDescriptions Column index/name and value 23 * @param {boolean} [disableInheritance] True if the query should only match direct instances/subtypes 24 * @returns {$k.SemanticElement[]} The filtered elements 25 * @throws {$k.exception.InvalidValue} If the filter values are invalid 26 * @throws {$k.exception.MissingParameter} If the filter value for a column is missing 27 * @throws {$k.exception.QueryError} If filtering was not possible 28 * @example configuration.filter(elements, [ {column: "familyName", value: "Doe" }]) 29 **/ 30 $k.TableConfiguration.prototype.filter = function(elements, filterDescriptions, disableInheritance) { }; 31 32 /** 33 * Renders the elements as literal objects 34 * 35 * @function 36 * @param {$k.SemanticElement[]} elements 37 * @param {object} [keyFilter] A filter that defines which property names that are included. 38 * <pre class="code">{"exclude": ["key1", ...]}</pre> includes all but the listed properties, while <pre class="code">{"include": ["key1", ...]}</pre> or <pre class="code">["key1", ...]</pre> includes only the listed properties. 39 * <br/>Non-optional properties are always included 40 * @returns {object[]} The rendered objects 41 **/ 42 $k.TableConfiguration.prototype.render = function(elements, keyFilter) { }; 43 44 /** 45 * Render the elements as a JSON object 46 * 47 * @function 48 * @deprecated Use <code>render(elements, {"exclude": excludedKeys})</code> instead 49 * @param {$k.SemanticElement[]} elements 50 * @param {string[]} [excludedKeys] Collection of property names that are excluded 51 * @returns {object} The rendered JSON object 52 **/ 53 $k.TableConfiguration.prototype.renderJSON = function(elements, excludedKeys) { }; 54 55 /** 56 * Find the elements by the given column values 57 * 58 * @function 59 * @param {$k.Domain} domain Domain of the table 60 * @param {object[]} filterDescriptions Column index/name and value 61 * @param {boolean} [disableInheritance] True if the query should only match direct instances/subtypes 62 * @returns {$k.SemanticElement[]} 63 * @throws {$k.exception.InvalidValue} If the filter values are invalid 64 * @throws {$k.exception.MissingParameter} If the filter value for a column is missing 65 * @throws {$k.exception.QueryError} If filtering was not possible 66 * @example configuration.search([ {column: "dateOfBirth", value: "1970", operator: "less" }]) 67 **/ 68 $k.TableConfiguration.prototype.search = function(domain, filterDescriptions, disableInheritance) { }; 69 70 /** 71 * Returns the elements sorted by the given columns and sort orders 72 * 73 * @function 74 * @param {$k.SemanticElement[]} semanticElements 75 * @param {object[]} sortDescriptions Column index/name and optional sort order (ascending) 76 * @returns {$k.SemanticElement[]} The sorted elements 77 * @example configuration.sort(elements, [ {column: "familyName", ascending: false }, {column: "givenName" }]) 78 **/ 79 $k.TableConfiguration.prototype.sort = function(semanticElements, sortDescriptions) { }; 80 81 /** 82 * Returns the configured sort descriptions of the table 83 * 84 * @function 85 * @returns {object[]} 86 **/ 87 $k.TableConfiguration.prototype.sortDescriptions = function() { }; 88 89 /** 90 * Returns the table confguration for the domain and the optional context) 91 * 92 * @function 93 * @param {$k.Domain[]} domain Domain of the table 94 * @param {$k.SemanticElement} [context] Context of the configuration 95 * @returns {$k.TableConfiguration} 96 **/ 97 $k.TableConfiguration.forDomain = function(domain, context) { }; 98 99 /** 100 * Returns the confguration defined by the element 101 * 102 * @function 103 * @param {$k.SemanticElement} configurationElement The configuration element 104 * @returns {$k.TableConfiguration} 105 **/ 106 $k.TableConfiguration.from = function(configurationElement) { }; 107 108