|
|
|
let {sourcetype, dateadded, language, author, publicationd, theme, readingd} = input;
|
|
|
|
const {globalFunc} = customJS
|
|
|
|
const DataType = 'Source'
|
|
|
|
let page = dv.pages()
|
|
|
|
.filter(p => {return !p.file.path.contains('00.01') && p.DocType !== undefined && p.DocType !== null && p.DocType.contains(DataType) && p.Source.Type !== undefined && p.Source.Type !== null && p.Source.Type.contains(`${sourcetype}`)})
|
|
|
|
|
|
|
|
const iArray = [sourcetype, dateadded, language, author, publicationd, theme, readingd];
|
|
|
|
const dArray = ["sourcetype", "dateadded", "language", "author", "publicationd", "theme", "readingd"];
|
|
|
|
|
|
|
|
if (page.length === 0) {
|
|
|
|
return '"No result matching your query"'
|
|
|
|
}
|
|
|
|
|
|
|
|
dv.table(globalFunc.GetTableHeaders(DataType, 0), page
|
|
|
|
.where(p => p && globalFunc.IsInSearch(p, DataType, dArray, iArray))
|
|
|
|
.sort(p => p.file.name, `asc`)
|
|
|
|
.map(p => globalFunc.GetTableMap(DataType, 0,p)));
|
|
|
|
|