src/net/nodeMetadataUrlHelperMixin.js
/**
	 * Generate a URL for searching for node metadata.
	 * 
	 * @param {number|number[]} [nodeId] a specific node ID, or array of node IDs, to use; if not provided the 
	 *                                   `nodeIds` property of this class will be used, unless `null`
	 *                                   is passed in which case no node IDs will be added to the URL so that all available
	 *                                   node metadata objects will be returned
	 * @param {module:domain~SortDescriptor[]} [sorts] optional sort settings to use
	 * @param {module:domain~Pagination} [pagination] optional pagination settings to use
	 * @returns {string} the URL
	 */
Generate a URL for searching for node metadata.

@param {number|number[]} [nodeId] a specific node ID, or array of node IDs, to use; if not provided the
`nodeIds` property of this class will be used, unless `null`
is passed in which case no node IDs will be added to the URL so that all available
node metadata objects will be returned
@param {module:domain~SortDescriptor[]} [sorts] optional sort settings to use
@param {module:domain~Pagination} [pagination] optional pagination settings to use
@returns {string} the URL
Generate a URL for searching for node metadata . @param { number|number [] } [ nodeId ] a specific node ID or array of node IDs to use ; if not provided the ` nodeIds ` property of this class will be used unless ` null ` is passed in which case no node IDs will be added to the URL so that all available node metadata objects will be returned @param { module : domain~SortDescriptor [] } [ sorts ] optional sort settings to use @param { module : domain~Pagination } [ pagination ] optional pagination settings to use @returns { string } the URL
findNodeMetadataUrl(nodeId, sorts, pagination) {
		const nodeIds = (Array.isArray(nodeId) ? nodeId : nodeId ? [nodeId] : nodeId !== null ? this.nodeIds : undefined);
		let result = this.baseUrl() + '/nodes/meta';
		let params = '';
		if ( Array.isArray(nodeIds) ) {
			params += 'nodeIds=' +nodeIds.join(',');
		}
		if ( Array.isArray(sorts) ) {
			sorts.forEach((sort, i) => {
				if ( sort instanceof SortDescriptor ) {
					if ( params.length > 0 ) {
						params += '&';
					}
					params += sort.toUriEncoding(i);
				}
			});
		}
		if ( pagination instanceof Pagination ) {
			if ( params.length > 0 ) {
				params += '&';
			}
			params += pagination.toUriEncoding();
		}
		if ( params.length > 0 ) {
			result += '?' + params;
		}
		return result;
	}
findNodeMetadataUrl ( nodeId , sorts , pagination ) { const nodeIds = ( Array . isArray ( nodeId ) ? nodeId : nodeId ? [ nodeId ] : nodeId !== null ? this . nodeIds : undefined ) ; let result = this . baseUrl ( ) + '/nodes/meta' ; let params = '' ; if ( Array . isArray ( nodeIds ) ) { params += 'nodeIds=' + nodeIds . join ( ',' ) ; } if ( Array . isArray ( sorts ) ) { sorts . forEach ( ( sort , i ) => { if ( sort instanceof SortDescriptor ) { if ( params . length > 0 ) { params += '&' ; } params += sort . toUriEncoding ( i ) ; } } ) ; } if ( pagination instanceof Pagination ) { if ( params . length > 0 ) { params += '&' ; } params += pagination . toUriEncoding ( ) ; } if ( params . length > 0 ) { result += '?' + params ; } return result ; }
Generate a URL for searching for node metadata.
Generate a URL for searching for node metadata .