X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fmkws-developer.txt;h=693df63ae9a4521c7f29c9881aacee6e8a3a7a3d;hb=e6fc2ba40e38fd0d2a746082be32d2578460174c;hp=8859767c0c100f0e1f90756390a144fe236f17ce;hpb=e9a2d3fe831ccdbb4aa9395954af91e4e7776fca;p=mkws-moved-to-github.git diff --git a/doc/mkws-developer.txt b/doc/mkws-developer.txt index 8859767..693df63 100644 --- a/doc/mkws-developer.txt +++ b/doc/mkws-developer.txt @@ -71,10 +71,11 @@ that you want to specialise from -- in this case, "Records" -- using the promotion function that's been registered for that type. Once this has been done, the specialisations can be introduced. In -this case, it's a very matter of changing the "maxrecs" configuration -setting to 1 unless it's already been given an explicit value. (That -would occur if the HTML used an element like
, though it's not obvious why anyone would do that.) +this case, it's a very simple matter of changing the "maxrecs" +configuration setting to 1 unless it's already been given an explicit +value. (That would occur if the HTML used an element like
, though it's not obvious why anyone +would do that.) WIDGET PROPERTIES AND METHODS @@ -108,6 +109,9 @@ Void this.log(string) is written on the browser console, and also published to any "log" subcribers. +String this.value() + A function returning the value of the widget's HTML element. + TEAM METHODS ============ @@ -122,6 +126,7 @@ Num team.perpage() Num team.totalRecordCount() Num team.currentPage(); String team.currentRecordId() +String team.currentRecordData() Simple accessor functions that provide the ability to read properties of the team. @@ -149,13 +154,35 @@ Queue team.queue(eventName) used to subscribe to the event (or more rarely to publish it). Bool team.targetFiltered(targetId) - - -team.log(string) -team.newSearch(query, sortOrder, maxrecs, perpage, limit, targets, targetfilter) -team.recordElementId(recordId) -team.currentRecordData() -team.renderDetails(recordData) -team.loadTemplate(templateName) -team.resetPage() -team.reShow() + Indicates whether the specified target has been filtered by + selection as a facet. + +Void team.newSearch(query, sortOrder, maxrecs, perpage, limit, targets, targetfilter) + Starts a new search with the specified parameters. All but the + query may be omitted, in which case the prevailing defaults + are used. + +Void team.reShow() + Using the existing search, re-shows the result records after a + change in sort-order, per-page count, etc. + +String team.recordElementId(recordId) + Utility function for converting a record identifer (returned + from Pazpar2) into a version suitable for use as an HTML + element ID. + +String team.renderDetails(recordData) + Utility function returns an HTML rendering of the record + represented by the specified data. + +Template team.loadTemplate(templateName) + Loads (or retrieves from cache) the named Handlebars template, + and returns it in a form that can be invoked as a function, + passed a data-set. + +Some of these methods either (A) are really too low-level and should +not be exposed, or (B) should be widget-level methods. The present +infelicities reflect the fact that some code that rightly belongs in +widgets is still in the team. When we finish migrating it, the widget +API should get simpler. +