Data Sources: Difference between revisions

m
mNo edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Stamp|2017-03-05|4.3.0|1.1.0}}
{{Stamp|2023-08-12|5.0|2.0}}
{{BannerMenu}}
{{PageTitle|Data Sources}}


The Autofill facility in Memento allows users to look up information from data sources on the Web, in Memento libraries, or from other data sources. Certain Web data sources are included by default in the Memento application for the convenience of users. For other lookups, a custom data source is needed.
The Autofill facility in Memento allows users to look up information from data sources on the Web, in Memento libraries, or from other data sources. Certain Web data sources are included by default in the Memento application for the convenience of users. For other lookups, a custom data source is needed.
Line 27: Line 29:
The result of the script should be returned as an array object.
The result of the script should be returned as an array object.


See [[#Scripting Details|Scripting Details]] below for details on script writing.
See [[#Scripting details|Scripting Details]] below for details on script writing.


=== Step 3 — Set Autofill data load rules (Map data to fields) ===
=== Step 3 — Set Autofill data load rules (Map data to fields) ===
Line 96: Line 98:


<source lang="JavaScript">
<source lang="JavaScript">
var anotherLib = libByName(“AnotherLib”)          // Replace with yours
var anotherLib = libByName(“AnotherLib”);         // Replace with yours
var entries = anotherLib.find(query);
var entries = anotherLib.find(query);
var resultArray = [];
var resultArray = [];
Line 118: Line 120:
# Click '''Add JavaScript libraries'''
# Click '''Add JavaScript libraries'''
# Click on tab '''Repositories'''
# Click on tab '''Repositories'''
# Select repository '''''github.com/mementodatabase/script/data-sources'''''
# Select repository '''''github.com/mementodatabase/scripts/data-sources'''''
# Select '''''discogs.js'''''
# Select '''''discogs.js'''''


Line 132: Line 134:
* If the search in the data source is done by barcode, use ''discogs.barcode(query)'' instead of ''discogs.search(query)''.
* If the search in the data source is done by barcode, use ''discogs.barcode(query)'' instead of ''discogs.search(query)''.


[[Category:Spec]]
[[Category:en]] [[Category:Spec]] [[Category:Sc]]