Ignore vim swap files.
[mkws-moved-to-github.git] / doc / mkws-developer.txt
index 8859767..693df63 100644 (file)
@@ -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 <div class="mkwsRecord"
-maxrecs="2">, 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 <div
+class="mkwsRecord" maxrecs="2">, 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.
+