Data Sources: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 43: Line 43:
However, when the search may return several or many matching objects, the user must see these results and select an individual item, and then a full set of data for that item may be requested. This is analogous to the search results page of a Google or other Web search. This information hopefully gives the user enough information to make the decision to choose a single result from among others. Once the user has selected the desired item, a second request can be issued to obtain a full set of data for the individual object.
However, when the search may return several or many matching objects, the user must see these results and select an individual item, and then a full set of data for that item may be requested. This is analogous to the search results page of a Google or other Web search. This information hopefully gives the user enough information to make the decision to choose a single result from among others. Once the user has selected the desired item, a second request can be issued to obtain a full set of data for the individual object.


Given this, the Memento custom data source provides for both scenarios. If the search yields a single matching object, the script may issue another request for a full set of data right away, if necessary. If there are multiple matching objects, the script may return enough information to allow the user to choose the one of interest. Then, a function in the script may be called to fetch a full set of data for the selected object.
Given this, the Memento custom data source provides for both scenarios. If the search yields a single matching object, the script may issue another request for a full set of data right away, if necessary, and call the result() function with a single argument — result(). If there are multiple matching objects, the script may return enough information to allow the user to choose the one of interest. Then, a function in the script may be called to fetch a full set of data for the selected object.


To support user selection, the necessary properties of the source object are:
To support user selection, the necessary properties of the source object are: