Merge remote branch 'origin/master' into wosch
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 4 Nov 2014 15:34:35 +0000 (15:34 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 4 Nov 2014 15:34:35 +0000 (15:34 +0000)
42 files changed:
doc/mkws-doc.css
doc/mkws-manual.markdown
examples/htdocs/custom.css [new file with mode: 0644]
examples/htdocs/favicon.ico
examples/htdocs/heikki-motd.html
examples/htdocs/heikki.html
examples/htdocs/intro.html
examples/htdocs/jasmine-local-popup.html
examples/htdocs/jasmine-popup.html
examples/htdocs/jasmine-pp2.html
examples/htdocs/language.html
examples/htdocs/local-auto.html
examples/htdocs/lowlevel.html
examples/htdocs/mike.html
examples/htdocs/mike2.html
examples/htdocs/popup-dev.html
examples/htdocs/simple.html
examples/htdocs/wolfram.html
src/Makefile
src/mkws-core.js
src/mkws-team.js
src/mkws-widget-facets.js [new file with mode: 0644]
src/mkws-widget-main.js
src/mkws-widget-termlists.js [deleted file]
src/templates/facets.handlebars [new file with mode: 0644]
src/templates/lang.handlebars
src/templates/results.handlebars
src/templates/targets.handlebars
src/templates/termlists.handlebars [deleted file]
test/bin/bomb.pl
test/spec/mkws-pazpar2.js
test/widgets/Makefile
test/widgets/url.demos
test/widgets/url.koha
tools/apache2/mkws-live
tools/apache2/mkws-mike-mac
tools/apache2/sp-mkws-live
tools/apache2/sp-mkws-mike-mac [new file with mode: 0644]
tools/htdocs/favicon.ico
tools/htdocs/mkws.css
tools/service-proxy/README [new file with mode: 0644]
tools/service-proxy/service-proxy.properties

index 31cb2cf..00e961b 100644 (file)
@@ -26,3 +26,9 @@ body > p:last-of-type {
     text-align: right;
     font-size: small;
 }
+
+table { background: #ddd; border-collapse: collapse; }
+tr.header { color: #fff; background: #888; }
+table, th, td { border: 1px solid #ccc; }
+td { vertical-align: top; }
+td, th { padding: 0.3em 0.6em; }
index 5c0916d..0601a79 100644 (file)
@@ -57,18 +57,18 @@ Simple example
 The following is
 [a complete MKWS-based searching application](//example.indexdata.com/simple.html):
 
-    <html>
-      <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-        <title>MKWS demo client</title>
-        <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
-        <link rel="stylesheet" href="//mkws.indexdata.com/mkws.css" />
-      </head>
-      <body>
-        <div class="mkws-search"></div>
-        <div class="mkws-results"></div>
-      </body>
-    </html>
+       <html>
+         <head>
+           <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+           <title>MKWS demo client</title>
+           <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
+           <link rel="stylesheet" href="//mkws.indexdata.com/mkws.css" />
+         </head>
+         <body>
+           <div class="mkws-search"></div>
+           <div class="mkws-results"></div>
+         </body>
+       </html>
 
 Go ahead, try it! Simply put the above in a file (e.g index.html),
 drop it into a folder accessible with an ordinary web-server (e.g
@@ -141,16 +141,17 @@ The main widgets are:
 To see all of these working together, just put them all into the HTML
 `<body>` like so:
 
-        <div class="mkws-switch"></div>
-        <div class="mkws-lang"></div>
-        <div class="mkws-progress"></div>
-        <div class="mkws-search"></div>
-        <div class="mkws-results"></div>
-        <div class="mkws-targets"></div>
-        <div class="mkws-stat"></div>
+       <div class="mkws-switch"></div>
+       <div class="mkws-lang"></div>
+       <div class="mkws-progress"></div>
+       <div class="mkws-search"></div>
+       <div class="mkws-results"></div>
+       <div class="mkws-targets"></div>
+       <div class="mkws-stat"></div>
 
 The full set of supported widgets is described in the
-reference guide below.
+reference guide
+[below](#widgets).
 
 Widget team
 -----------
@@ -196,15 +197,15 @@ Many aspects of the behaviour of MKWS can be modified by setting
 parameters into the `mkws_config` object. So the HTML header looks
 like this:
 
-        <script type="text/javascript">
-          var mkws_config = {
-            lang_options: [ "en", "da" ]
-            lang: "da",
-            sort_default: "title",
-            query_width: 60
-          };
-        </script>
-        <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
+       <script type="text/javascript">
+         var mkws_config = {
+           lang_options: [ "en", "da" ]
+           lang: "da",
+           sort_default: "title",
+           query_width: 60
+         };
+       </script>
+       <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
 
 This configuration restricts the set of available UI languages English
 and Danish (omitting German), sets the default to Danish (rather than
@@ -266,7 +267,7 @@ etc., customised layouts may wish to treat each of these components
 separately. In this case, `mkws-results` can be omitted, and the
 following lower-level widgets provided instead:
 
-* `mkws-termlists` -- provides the facets
+* `mkws-facets` -- provides the facets
 
 * `mkws-ranking` -- provides the options for how records are sorted and
    how many are included on each page of results.
@@ -322,9 +323,9 @@ Inline Handlebars templates are distinguished from Javascript via a
 `type="text/x-handlebars-template"` attribute. For example, to override the
 pager template you would include this in your document:
 
-    <script class="mkws-template-pager" type="text/x-handlebars-template">
-      ...new Pager template
-    </script>
+       <script class="mkws-template-pager" type="text/x-handlebars-template">
+         ...new Pager template
+       </script>
 
 The Facet template has a special feature where you can override it on
 a per-facet basis by adding a dash and the facet name as a suffix eg.
@@ -359,7 +360,7 @@ see what is being returned with each search result in the list. In order for
 this to work you'll need to enable verbose output from Handlebars which is done
 by including this line or similar:
 
-    <script>Handlebars.logger.level = 1;</script>
+       <script>Handlebars.logger.level = 1;</script>
 
 Internationalisation
 --------------------
@@ -376,17 +377,17 @@ details inline, here's a summary template that will link directly to
 the source via the address provided in the metadata as the first
 element of `md-electronic-url`:
 
-    <script class="mkws-template-summary" type="text/x-handlebars-template">
-      <a href="{{md-electronic-url.[0]}}">
-        <b>{{md-title}}</b>
-      </a>
-      {{#if md-title-remainder}}
-        <span>{{md-title-remainder}}</span>
-      {{/if}}
-      {{#if md-title-responsibility}}
-        <span><i>{{md-title-responsibility}}</i></span>
-      {{/if}}
-    </script>
+       <script class="mkws-template-summary" type="text/x-handlebars-template">
+         <a href="{{md-electronic-url.[0]}}">
+           <b>{{md-title}}</b>
+         </a>
+         {{#if md-title-remainder}}
+           <span>{{md-title-remainder}}</span>
+         {{/if}}
+         {{#if md-title-responsibility}}
+           <span><i>{{md-title-responsibility}}</i></span>
+         {{/if}}
+       </script>
 
 For a more involved example where markup for multiple widgets is decorated with
 [Bootstrap](http://getbootstrap.com/) classes and a custom Handlebars helper is
@@ -418,10 +419,10 @@ generally visible on the page is a search box, and the results appear
 in a popup. The key part of such an application is this invocation of
 the MKWS jQuery plugin:
 
-        <div class="mkws-search"></div>
-        <div class="mkws-popup" popup_width="1024" popup_height="650">
-          <div class="mkws-results"></div>
-        </div>
+       <div class="mkws-search"></div>
+       <div class="mkws-popup" popup_width="1024" popup_height="650">
+         <div class="mkws-results"></div>
+       </div>
 
 The necessary scaffolding can be seen in an example application,
 [popup.html](http://example.indexdata.com/popup.html).
@@ -431,41 +432,37 @@ The relevant properties (`popup_width`, etc.) are documented
 in the reference section.
 
 
-Authentication and target configuration
----------------------------------------
-
-MKWS configures itself to use an account on a service hosted by
-`sp-mkws.indexdata.com`. By default, it sends no authentication
-credentials, allowing the appropriate account to be selected on the
-basis of referring URL or IP address.
-
-TODO REWRITE
-This account (username `demo`,
-password `demo`) provides access to about a dozen free data
-sources. Authentication onto this service is via an authentication URL
-on the same MKWS server, so no explicit configuration is needed.
-
-In order to search in a customised set of targets, including
-subscription resources, it's necessary to create an account with
-Index Data's hosted Service Proxy, and protect that account with
-authentication tokens (to prevent unauthorised use of subscription
-resources). For information on how to do this, see the next section.
-
-
 MKWS target selection
 =====================
 
+Introduction
+------------
+
 MKWS accesses targets using the Pazpar2 metasearching engine. Although
 Pazpar2 can be used directly, using a statically configured set of
 targets, this usage is unusual. More often, Pazpar2 is fronted by the
 Service Proxy (SP), which manages authentication, sessions, target
-selection, etc.
-
-This document assumes the SP is used, and explains how to go about
-making a set of targets (a "library") available, how to connect your
-MKWS application to that library, and how to choose which of the
-available targets to use.
+selection, etc. This document assumes the SP is used, and explains how
+to go about making a set of targets (a "library") available, how to
+connect your MKWS application to that library, and how to choose which
+of the available targets to use.
+
+By default MKWS configures itself to use an account on a service
+hosted by `sp-mkws.indexdata.com`. By default, it sends no
+authentication credentials, allowing the appropriate account to be
+selected on the basis of referring URL or IP address.
+
+If no account has been set up to recognise the referring URL of the
+application or the IP address of the client, then a default "MKWS
+Demo" account is used. This account (which can also be explicitly
+chosen by using the username `mkws`, password `mkws`) provides access
+to about a dozen free data sources.
 
+In order to search in a customised set of targets, including
+subscription resources, it's necessary to create an account with
+Index Data's hosted Service Proxy, and protect that account with
+authentication tokens (to prevent unauthorised use of subscription
+resources).
 
 Maintaining the library
 -----------------------
@@ -481,18 +478,17 @@ Libraries are maintained using MKAdmin (MasterKey
 Admin). Specifically, those used by MKWS are generally maintained on
 the "MKX Admin" installation at
 <http://mkx-admin.indexdata.com/console/>
-
 In general, Index Data will create a library for each customer, then
 give the customer a username/password pair that they can use to enter
 MKAdmin and administrate that library.
 
 Once logged in, customers can select which targets to include (from
 the list of several thousand that MKAdmin knows about), and make
-customer-specific modifications -- e.g. overriding the titles of the
-targets.
+customer-specific modifications to the target profiles --
+e.g. overriding the titles of the targets.
 
 Most importantly, customers' administrators can add authentication
-credentials that the Service Proxy will used on their behalf when
+credentials that the Service Proxy will use on their behalf when
 accessing subscription resources -- username/password pairs or proxies
 to use for IP-based authentication. Note that **it is then crucial to
 secure the library from use by unauthorised clients**, otherwise the
@@ -529,19 +525,14 @@ Log in to MKAdmin to add a User Access account for your library:
 * Create an end-user account
 * Depending on what authentication method it be used, set the
   User Access account's username and password, or referring URL, or
-  Service Proxy hostname, or IP-address range.
+  IP-address range.
 
 If your MWKS application runs at a well-known, permanent address --
 <http://yourname.com/app.html>, say -- you can set the User Access
 record so that this originating URL is recognised by setting it into
-the "Referring URL" field.
-
-If your application accesses the Service Proxy by a unique virtual
-hostname -- yourname.sp-mkws.indexdata.com, say -- you can tie the use
-of this hostname to your library by setting the User Access record's
-"Host Name" field to name of the host where the SP is accessed. **Note
-that this is not secure, as other applications can use this virtual
-hostname to gain access to your library.**
+the "Referring URL" field. Then the application will always use that
+library that this User Access record is associated with (unless it
+sends a username/password pair to override this default).
 
 Or if your application's users are coming from a well-known range of
 IP-address space, you can enter the range in the "IP Ranges"
@@ -555,74 +546,46 @@ Alternatively, your application can authenticate by username and
 password credentials. This is a useful approach in several situations,
 including when you need to specify the use of a different library from
 usual one. To arrange for this, set the username and password as a
-single string separated by a slash -- e.g. "mike/swordfish" -- into
+single string separated by a slash -- e.g. `mike/swordfish` -- into
 the User Access record's Authentication field.
 
 You can set multiple fields into a single User Access record; or
 create multiple User Access records. For example, a single User Access
-record can specify both a Referring URL a username/password pair that
-can be used when running an application from a different URL. But if
-multiple Referring URLs are needed, then each must be specified in its
-own User Access record.
-
-### Tell the application to use the library
-
-In the HTML of the application, tell MKWS to authenticate on to the
-Service Proxy. When referer-based or IP-based authentication is used,
-this is very simple:
-
-       <script type="text/javascript">
-         var mkws_config = { service_proxy_auth:
-         "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig" };
-       </script>
-
-> TODO This should be the default setting: see **MKWS-251**.
-
-And ensure that access to the MWKS application is from the correct
-Referrer URL or IP-range.
-
-### (Optional): access by a different virtual hostname
-
-When hostname-based authentication is in use, it's necessary to access
-the Service Proxy as the correctly named virtual host. This can be
-done by setting the `service_proxy_auth` configuration item to a
-URL containing that hostname, such as
-`//yourname.sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig`
-
-> TODO It should be possible to change just the hostname without
-> needing to repeat the rest of the URL (protocol, path, query): see
-> **MKWS-252**.
-
-> TODO When changing the SP authentication URL, the Pazpar2 URL should
-> in general change along with it: see **MKWS-253**.
+record can specify both a Referring URL and a username/password pair
+that can be used when running an application from a different URL. But
+if multiple Referring URLs are needed, then each must be specified in
+its own User Access record.
 
 ### (Optional): embed credentials for access to the library
 
 When credential-based authentication is in use (username and
 password), it's necessary to pass these credentials into the Service
-Proxy when establishing the session. This can most simply be done just
-by setting the `service_proxy_auth` configuration item to a URL such as
-`//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig&username=mike&password=swordfish`
+Proxy when establishing the session. This is done 
+by setting the `sp_auth_credentials` configuration item to a string
+containing the username and password separated by a slash:
 
-> TODO It should be possible to add the username and password to the
-> configuration without needing to repeat the rest of the URL: see
-> **MKWS-254**.
+       mkws_config = { sp_auth_credentials: "mike/swordfish" };
 
 ### (Optional): conceal credentials from HTML source
 
-Using a credential-based Service-Proxy authentication URL such as the
-one above reveals the the credentials to public view -- to anyone who
-does View Source on the MKWS application. This may be acceptable for
-some libraries, but is intolerable for those which provide
-authenticated access to subscription resources.
-
-In these circumstances, a more elaborate approach is necessary. The
-idea is to make a URL local to the customer that is used for
-authentication onto the Service Proxy, hiding the credentials in a
-local rewrite rule. Then local mechanisms can be used to limit access
-to that local authentication URL. Here is one way to do it when
+Using credential-based authentication settings such as those above
+reveals the the credentials to public view -- to anyone who does View
+Source on the MKWS application. This may be acceptable for some
+libraries, but is intolerable for those which provide authenticated
+access to subscription resources.
+
+In these circumstances, a different approach is
+necessary. Referer-based or IP-based authentication may be
+appropriate. But if these are not possible, then a more elaborate
+approach can be used to hide the credentials in a web-server
+configuration that is not visible to users.
+
+The idea is to make a Service Proxy authentication URL local to the
+customer, hiding the credentials in a rewrite rule in the local
+web-server's configuration. Then local mechanisms can be used to limit
+access to that local authentication URL. Here is one way to do it when
 Apache2 is the application's web-server, which we will call
-yourname.com:
+yourname.com`:
 
 Step 1: add a rewriting authentication alias to the configuration:
 
@@ -630,9 +593,9 @@ Step 1: add a rewriting authentication alias to the configuration:
        RewriteRule /spauth/ http://sp-mkws.indexdata.com/service-proxy/?command=auth&action=check,login&username=U&password=PW [P]
 
 Step 2: set the MKWS configuration item `service_proxy_auth` to
-<http://yourname.com/spauth/>
+`http://yourname.com/spauth/`.
 
-Step 3: protect access to the local path <http://yourname.com/spauth/>
+Step 3: protect access to the local path `http://yourname.com/spauth/`
 (e.g. using a `.htaccess` file).
 
 
@@ -675,6 +638,119 @@ attribute as follows:
 Reference guide
 ===============
 
+Widgets
+-------
+
+The following widgets are provided in the core set. (Others can be
+added: see the [MKWS developers' guide](mkws-developer.html).)
+
+----
+Name              Description
+----              -----------
+`auth-name`       Initially empty, it updates itself to shows the name
+                  of the library that the application is logged in as
+                  when authentication is complete.
+
+`builder`         A button which, when pressed, analyses the current
+                  settings of the team that it is a part of, and
+                  generates the HTML for an auto-searching element
+                  that will replicate the present search. This HTML is
+                  displayed in an alert box: it is intended that this
+                  widget be subclassed to store the generated widget
+                  definitions in more useful places.
+
+`categories`      Obtains from the Service Proxy a list of the target
+                  categories associated with the library in use, and
+                  displays them in a drop-down list. When a category
+                  is selected, searches are limited to the targets
+                  that are part of that category.
+
+`config`          This widget has no functionality of its own, but its
+                  configuration is copied up into its team, allowing
+                  it to affect other widgets in the team. This is the
+                  only way to set configuration items at the team
+                  level.
+
+`console-builder` Like the `builder` widget, but emits the generated
+                  HTML on the JavaScript console. This exists to
+                  provide an example of how to subclass the `builder`
+                  widget.
+
+`cover-art`       Displays cover art for a book by searching in
+                  Amazon. Often used with an `autosearch` attribute to
+                  indicate what book to display. For example,
+                  `<div class="mkws-cover-art" autosearch="isbn=1291177124"></div>`
+                  displays cover art for _All Yesterdays: Unique and
+                  Speculative Views of Dinosaurs and Other Prehistoric
+                  Animals_.
+                  For this widget to work, a library that includes the
+                  AmazonBooks target must be used. For example, the
+                  "DEMO AmazonBooks for MKWS" account, which can be
+                  selected with `sp_auth_credentials="mkws-amazon/mkws"`.
+
+`details`         This widget is generated by the toolkit itself to
+                  hold the full details of records that are initially
+                  listed in summary form.
+
+`done`            Initially empty, this widget is set to display
+                  "Search complete: found _n_ records" when all
+                  targets have completed their work, either returning
+                  a hit-count or an error. The message displayed can
+                  be changed by overriding the `done` template using
+                  `<script class="mkws-template-done" type="text/x-handlebars-template">`.
+
+`facet`           x
+
+`facets`          x
+
+`google-image`    x
+
+`images`          x
+
+`lang`            x
+
+`log`             x
+
+`lolcat`          x
+
+`motd-container`  x
+
+`motd`            x
+
+`navi`            x
+
+`pager`           x
+
+`per-page`        x
+
+`progress`        x
+
+`query`           x
+
+`ranking`         x
+
+`record`          x
+
+`records`         x
+
+`reference`       x
+
+`results`         x
+
+`search-form`     x
+
+`search`          x
+
+`sort`            x
+
+`stat`            x
+
+`switch`          x
+
+`targets`         x
+----
+
+
 Configuration object
 --------------------
 
@@ -782,13 +858,13 @@ French. Then value of this entry must be a key-value lookup table,
 mapping the English-language strings of the UI into their equivalents
 in the specified language. For example:
 
-            var mkws_config = {
-              language_French: {
-                "Authors": "Auteurs",
-                "Subjects": "Sujets",
-                // ... and others ...
-              }
-            }
+       var mkws_config = {
+         language_French: {
+           "Authors": "Auteurs",
+           "Subjects": "Sujets",
+           // ... and others ...
+         }
+       }
 
 The following strings occurring in the UI can be translated:
 `Displaying`,
@@ -798,7 +874,7 @@ The following strings occurring in the UI can be translated:
 `Search`,
 `Sort by`,
 `Targets`,
-`Termlists`,
+`Facets`,
 `and show`,
 `found`,
 `of`,
@@ -832,18 +908,18 @@ Note that when using the `popup` layout, facilities from the jQuery UI
 toolkit are used, so it's necessary to include both CSS and JavaScript
 from that toolkit. The relevant lines are:
 
-    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
-    <link rel="stylesheet" type="text/css"
-          href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
+       <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
+       <link rel="stylesheet" type="text/css"
+             href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
 
-    <div class="mkws-search"></div>
-    <div class="mkws-popup" popup_width="1024" popup_height="650" popup_modal="0" popup_autoOpen="0" popup_button="input.mkwsButton">
-      <div class="mkws-switch"></div>
-      <div class="mkws-lang"></div>
-      <div class="mkws-results"></div>
-      <div class="mkws-targets"></div>
-      <div class="mkws-stat"></div>
-    </div>
+       <div class="mkws-search"></div>
+       <div class="mkws-popup" popup_width="1024" popup_height="650" popup_modal="0" popup_autoOpen="0" popup_button="input.mkwsButton">
+         <div class="mkws-switch"></div>
+         <div class="mkws-lang"></div>
+         <div class="mkws-results"></div>
+         <div class="mkws-targets"></div>
+         <div class="mkws-stat"></div>
+       </div>
 
 ----
 Element         Type    Default             Description
@@ -873,68 +949,68 @@ In order to override the default CSS styles provided by the MasterKey Widget
 Set, it's necessary to understand that structure of the HTML elements that are
 generated within the widgets. This knowledge make it possible, for example,
 to style each `<div>` with class `term` but only when it occurs inside an
-element with class `mkws-termlists`, so as to avoid inadvertently styling other
+element with class `mkws-facets`, so as to avoid inadvertently styling other
 elements using the same class in the non-MKWS parts of the page.
 
 The HTML structure is as follows. As in CSS, #ID indicates a unique identifier
 and .CLASS indicates an instance of a class.
 
-    #mkwsSwitch
-      a*
-
-    #mkwsLang
-      ( a | span )*
-
-    #mkwsSearch
-      form
-        input#mkwsQuery type=text
-        input#mkwsButton type=submit
-
-    #mkwsBlanket
-      (no contents -- used only for masking)
-
-    #mkwsResults
-      table
-        tbody
-          tr
-            td
-              #mkwsTermlists
-                div.title
-                div.facet*
-                  div.termtitle
-                  ( a span br )*
-            td
-              div#mkwsRanking
-                form#mkwsSelect
-                  select#mkwsSort
-                  select#mkwsPerpage
-              #mkwsPager
-              #mkwsNavi
-              #mkwsRecords
-                div.record*
-                  span (for sequence number)
-                  a (for title)
-                  span (for other information such as author)
-                  div.details (sometimes)
-                    table
-                      tbody
-                        tr*
-                          th
-                          td
-    #mkwsTargets
-      #mkwsBytarget
-        table
-          thead
-            tr*
-              td*
-          tbody
-            tr*
-              td*
-
-    #mkwsStat
-      span.head
-      span.clients
-      span.records
+       #mkwsSwitch
+         a*
+       
+       #mkwsLang
+         ( a | span )*
+       
+       #mkwsSearch
+         form
+           input#mkwsQuery type=text
+           input#mkwsButton type=submit
+       
+       #mkwsBlanket
+         (no contents -- used only for masking)
+       
+       #mkwsResults
+         table
+           tbody
+             tr
+               td
+                 #mkwsTermlists
+                   div.title
+                   div.facet*
+                     div.termtitle
+                     ( a span br )*
+               td
+                 div#mkwsRanking
+                   form#mkwsSelect
+                     select#mkwsSort
+                     select#mkwsPerpage
+                 #mkwsPager
+                 #mkwsNavi
+                 #mkwsRecords
+                   div.record*
+                     span (for sequence number)
+                     a (for title)
+                     span (for other information such as author)
+                     div.details (sometimes)
+                       table
+                         tbody
+                           tr*
+                             th
+                             td
+       #mkwsTargets
+         #mkwsBytarget
+           table
+             thead
+               tr*
+                 td*
+             tbody
+               tr*
+                 td*
+       
+       #mkwsStat
+         span.head
+         span.clients
+         span.records
 
 - - -
 
diff --git a/examples/htdocs/custom.css b/examples/htdocs/custom.css
new file mode 100644 (file)
index 0000000..80eb04a
--- /dev/null
@@ -0,0 +1,6 @@
+.mkws-facets {
+    background: white;
+}
+.mkws-facet {
+    background: white;
+}
index 35c4899..7a42ce2 100644 (file)
Binary files a/examples/htdocs/favicon.ico and b/examples/htdocs/favicon.ico differ
index aa53154..843d3bc 100644 (file)
@@ -19,7 +19,7 @@
     <script type="text/javascript" src="tools/htdocs/mkws.js"></script>
 
     <style type="text/css">
-      .mkws-termlists div.facet {
+      .mkws-facets div.facet {
       float:left;
       width: 30%;
       margin: 0.3em;
index 8a92369..5138bfe 100644 (file)
@@ -21,7 +21,7 @@
     <script type="text/javascript" src="tools/htdocs/jquery.json-2.4.js"></script>
     <script type="text/javascript" src="tools/htdocs/mkws.js"></script>
     <style type="text/css">
-      .mkws-termlists div.facet {
+      .mkws-facets div.facet {
       float:left;
       width: 30%;
       margin: 0.3em;
@@ -56,7 +56,7 @@
       <tr>
         <td>
           <div style="height:300px; overflow: hidden">
-            <div class="mkws-termlists"></div>
+            <div class="mkws-facets"></div>
           </div>
         </td>
       </tr>
index 59ecd50..1bd424f 100644 (file)
@@ -16,7 +16,7 @@
     <script type="text/javascript" src="src/mkws-filter.js"></script>
     <script type="text/javascript" src="src/mkws-widget.js"></script>
     <script type="text/javascript" src="src/mkws-widget-main.js"></script>
-    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-facets.js"></script>
     <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
     <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
     <script type="text/javascript" src="src/mkws-widget-log.js"></script>
index 6bc7355..689557d 100644 (file)
@@ -18,7 +18,7 @@
     <script type="text/javascript" src="src/mkws-filter.js"></script>
     <script type="text/javascript" src="src/mkws-widget.js"></script>
     <script type="text/javascript" src="src/mkws-widget-main.js"></script>
-    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-facets.js"></script>
     <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
     <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
     <script type="text/javascript" src="src/mkws-widget-log.js"></script>
index 9c6eb86..b5e79fe 100644 (file)
@@ -18,7 +18,7 @@
     <script type="text/javascript" src="src/mkws-filter.js"></script>
     <script type="text/javascript" src="src/mkws-widget.js"></script>
     <script type="text/javascript" src="src/mkws-widget-main.js"></script>
-    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-facets.js"></script>
     <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
     <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
     <script type="text/javascript" src="src/mkws-widget-log.js"></script>
index dbe236a..8a8e64b 100644 (file)
@@ -22,7 +22,7 @@
 
     <link rel="stylesheet" type="text/css" href="tools/htdocs/mkws.css" />
     <style type="text/css">
-      .mkws-termlists div.facet {
+      .mkws-facets div.facet {
       float:left;
       width: 30%;
       margin: 0.3em;
@@ -71,7 +71,7 @@
       <tr>
         <td>
           <div style="height:300px; overflow: hidden">
-            <div class="mkws-termlists"></div>
+            <div class="mkws-facets"></div>
           </div>
         </td>
       </tr>
index d24e017..2cbd8be 100644 (file)
@@ -40,7 +40,7 @@
                        "Subject": "موضوع",
                        "Location": "موقع",
                        // Facet heading and individual facet names
-                       "Termlists": "العضو Ø§Ù„أجل",
+                       "Facets": "العضو Ø§Ù„أجل",
                        "Sources": "مصادر",
                        "Subjects": "المواضيع",
                        "Authors": "الكتاب",
index 27336ef..1c5604d 100644 (file)
@@ -30,7 +30,7 @@
        sort='relevance'
        targets='pz:id~josiah.brown.edu:210/innopac|connect.indexdata.com:9000/mit_opencourseware'
 >News will appear here</div>
-       <div class='mkws-termlists mkws-team-news'/>
+       <div class='mkws-facets mkws-team-news'/>
        </td>
        <td width="30%">
          <h2>Blog</h2>
@@ -39,7 +39,7 @@
        sort='relevance'
        targets='pz:id~josiah.brown.edu:210/innopac|connect.indexdata.com:9000/mit_opencourseware'
 >Blog entries will appear here</div>
-       <div class='mkws-termlists mkws-team-blog'/>
+       <div class='mkws-facets mkws-team-blog'/>
        </td>
       </tr>
     </table>
index ebf4043..74b55d2 100644 (file)
@@ -5,7 +5,7 @@
     <link rel="stylesheet" type="text/css" href="//mkws.indexdata.com/mkws.css" />
     <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
     <style type="text/css">
-      .mkws-termlists div.facet {
+      .mkws-facets div.facet {
       float:left;
       width: 30%;
       margin: 0.3em;
@@ -38,7 +38,7 @@
       <tr>
         <td>
           <div style="height:300px; overflow: hidden">
-            <div class="mkws-termlists"></div>
+            <div class="mkws-facets"></div>
           </div>
         </td>
       </tr>
index ee5e03d..4105b3d 100644 (file)
@@ -18,7 +18,7 @@
     <script type="text/javascript" src="src/mkws-filter.js"></script>
     <script type="text/javascript" src="src/mkws-widget.js"></script>
     <script type="text/javascript" src="src/mkws-widget-main.js"></script>
-    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-facets.js"></script>
     <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
     <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
     <script type="text/javascript" src="src/mkws-widget-log.js"></script>
@@ -30,7 +30,7 @@
   <body>
     <div class="mkws-auth-name"></div>
     <div class="mkws-switch"></div>
-    <div class="mkws-lang" data-mkws-config='{ "lang_options": [ "en", "da" ] }'></div>
+    <div class="mkws-lang" data-mkws-config='{ "lang_options": [ "en", "de" ] }'></div>
     <div class="mkws-progress"></div>
     <div class="mkws-search"></div>
     <div class="mkws-results"></div>
index 6f1387b..f596dd8 100644 (file)
@@ -18,7 +18,7 @@
     <script type="text/javascript" src="src/mkws-filter.js"></script>
     <script type="text/javascript" src="src/mkws-widget.js"></script>
     <script type="text/javascript" src="src/mkws-widget-main.js"></script>
-    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-facets.js"></script>
     <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
     <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
     <script type="text/javascript" src="src/mkws-widget-log.js"></script>
index 2ebf5ce..b79c37e 100644 (file)
@@ -26,7 +26,7 @@
     <script type="text/javascript" src="src/mkws-filter.js"></script>
     <script type="text/javascript" src="src/mkws-widget.js"></script>
     <script type="text/javascript" src="src/mkws-widget-main.js"></script>
-    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-facets.js"></script>
     <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
     <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
     <script type="text/javascript" src="src/mkws-widget-log.js"></script>
index c4c32d1..99d8e3a 100644 (file)
@@ -4,6 +4,7 @@
     <title>MKWS demo client</title>
     <script type="text/javascript" src="//mkws.indexdata.com/mkws-complete.js"></script>
     <link rel="stylesheet" href="//mkws.indexdata.com/mkws.css" />
+    <link rel="stylesheet" href="custom.css" />
   </head>
   <body>
     <div class="mkws-switch"></div>
@@ -13,6 +14,5 @@
     <div class="mkws-results"></div>
     <div class="mkws-targets"></div>
     <div class="mkws-stat"></div>
-    <div class="mkws-builder"></div>
   </body>
 </html>
index 268c414..0ae251b 100644 (file)
@@ -29,7 +29,7 @@
 
     <script type="text/javascript" src="src/mkws-widget.js"></script>
     <script type="text/javascript" src="src/mkws-widget-main.js"></script>
-    <script type="text/javascript" src="src/mkws-widget-termlists.js"></script>
+    <script type="text/javascript" src="src/mkws-widget-facets.js"></script>
     <script type="text/javascript" src="src/mkws-widget-authname.js"></script>
     <script type="text/javascript" src="src/mkws-widget-categories.js"></script>
     <script type="text/javascript" src="src/mkws-widget-log.js"></script>
index bd05b9b..51f399e 100644 (file)
@@ -22,7 +22,7 @@ COMPONENTS = mkws-handlebars.js \
        mkws-filter.js \
        mkws-widget.js \
        mkws-widget-main.js \
-       mkws-widget-termlists.js \
+       mkws-widget-facets.js \
        mkws-widget-authname.js \
        mkws-widget-categories.js \
        mkws-widget-log.js \
index 6bb98b3..6b71bc1 100644 (file)
@@ -28,7 +28,7 @@ window.mkws = {
       "Subjects": "Schlagw&ouml;rter",
       "Sources": "Daten und Quellen",
       "source": "datenquelle",
-      "Termlists": "Termlisten",
+      "Facets": "Termlisten",
       "Next": "Weiter",
       "Prev": "Zur&uuml;ck",
       "Search": "Suche",
@@ -57,7 +57,7 @@ window.mkws = {
       "Subjects": "Emner",
       "Sources": "Kilder",
       "source": "kilder",
-      "Termlists": "Termlists",
+      "Facets": "Termlists",
       "Next": "N&aelig;ste",
       "Prev": "Forrige",
       "Search": "S&oslash;g",
@@ -298,7 +298,8 @@ mkws.log("Using window.name '" + window.name + "'");
     'MOTDContainer': 'motd-container',
     'Perpage': 'per-page',
     'SearchForm': 'search-form',
-    'ReferenceUniverse': 'reference-universe'
+    'ReferenceUniverse': 'reference-universe',
+    'Termlists': 'facets'
   };
   // Annoyingly, there is no built-in way to invert a hash
   var _new2old = {};
index 7ec9c2f..43f2fbf 100644 (file)
@@ -122,7 +122,7 @@ mkws.makeTeam = function($, teamName) {
 
   function onTerm(data) {
     log("term");
-    queue("termlists").publish(data);
+    queue("facets").publish(data);
   }
 
   function onShow(data, teamName) {
@@ -172,7 +172,7 @@ mkws.makeTeam = function($, teamName) {
       params.onstat = onStat;
       log("setting stat callback");
     }
-    if (m_queues.termlists && config.facets.length) {
+    if (m_queues.facets && config.facets.length) {
       params.onterm = onTerm;
       log("setting term callback");
     }
diff --git a/src/mkws-widget-facets.js b/src/mkws-widget-facets.js
new file mode 100644 (file)
index 0000000..478bf0a
--- /dev/null
@@ -0,0 +1,81 @@
+mkws.registerWidgetType('facets', function() {
+  // Initially hide the facets; display when we get results
+  var that = this;
+  var team = this.team;
+  team.queue("facets").subscribe(function(data) {
+    that.node.addClass("active");
+  });
+
+  var template = team.loadTemplate(this.config.template || "facets");
+  this.node.html(template({
+    team: team.name(),
+    facets: this.config.facets
+  }));
+  this.autosearch();
+});
+
+
+mkws.registerWidgetType('facet', function() {
+  var facetConfig = {
+    xtargets: [ "Sources",  16, false ],
+    subject:  [ "Subjects", 10, true ],
+    author:   [ "Authors",  10, true ]
+  }
+  var that = this;
+  var team = this.team;
+  var name = that.config.facet;
+  var ref = facetConfig[name] || [ "Unknown", 10, true ];
+  var caption = this.config['facet_caption_' + name] || ref[0];
+  var max     = parseInt(this.config['facet_max_' + name] || ref[1]);
+  var pzIndex = ref[2] ? name : null;
+
+  that.toString = function() {
+    return '[Widget ' + team.name() + ':' + that.type + '(' + name + ')]';
+  };
+
+  team.queue("facets").subscribe(function(data) {
+    data = data[name];
+    var terms = [];
+    var teamName = team.name();
+    for (var i = 0; i < data.length && i < max; i++) {
+      var linkdata = "";
+      var action = "";
+      if (!pzIndex) {
+        // Special case: target selection
+        linkdata += ('target_id='+data[i].id+' ');
+        if (!team.targetFiltered(data[i].id)) {
+          action = 'mkws.limitTarget(\'' + teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)';
+        }
+      } else {
+        action = 'mkws.limitQuery(\'' + teamName + '\', \'' + pzIndex + '\', this.firstChild.nodeValue)';
+      }
+      linkdata += 'onclick="' + action + ';return false;"';
+      terms.push({
+        term: data[i].name,
+        field: data[i].id,
+        count: data[i].freq,
+        linkdata: linkdata
+      }); 
+    }
+    // configured template > facet specific template > default facet template
+    var template;
+    if (that.config.template) {
+      template = team.loadTemplate(that.config.template);
+    } else {
+      template = team.loadTemplate("facet-" + name);
+      if (template) {
+        that.log("Using facet-" + name + " template.")
+      } else {
+        that.log("No " + name + " specific template, using default.")
+        template = team.loadTemplate("facet");
+      }
+    }
+    that.node.html(template({
+      name: name,
+      caption: caption,
+      query: that.config.query,
+      terms: terms
+    }));
+  });
+  this.autosearch();
+});
index ac43dcd..8a51a4d 100644 (file)
@@ -22,6 +22,7 @@ mkws.registerWidgetType('targets', function() {
       cur.id = data[i].id;
       cur.hits = data[i].hits;
       cur.diagnostic = data[i].diagnostic;
+      cur.message = data[i].message;
       cur.records = data[i].records;
       cur.state = data[i].state;
       cleandata.push(cur);
diff --git a/src/mkws-widget-termlists.js b/src/mkws-widget-termlists.js
deleted file mode 100644 (file)
index e3dc55e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-mkws.registerWidgetType('termlists', function() {
-  // Initially hide the termlists; display when we get results
-  var that = this;
-  var team = this.team;
-  team.queue("termlists").subscribe(function(data) {
-    that.node.addClass("active");
-  });
-
-  var template = team.loadTemplate(this.config.template || "termlists");
-  this.node.html(template({
-    team: team.name(),
-    facets: this.config.facets
-  }));
-  this.autosearch();
-});
-
-
-mkws.registerWidgetType('facet', function() {
-  var facetConfig = {
-    xtargets: [ "Sources",  16, false ],
-    subject:  [ "Subjects", 10, true ],
-    author:   [ "Authors",  10, true ]
-  }
-  var that = this;
-  var team = this.team;
-  var name = that.config.facet;
-  var ref = facetConfig[name] || [ "Unknown", 10, true ];
-  var caption = this.config['facet_caption_' + name] || ref[0];
-  var max     = parseInt(this.config['facet_max_' + name] || ref[1]);
-  var pzIndex = ref[2] ? name : null;
-
-  that.toString = function() {
-    return '[Widget ' + team.name() + ':' + that.type + '(' + name + ')]';
-  };
-
-  team.queue("termlists").subscribe(function(data) {
-    data = data[name];
-    var terms = [];
-    var teamName = team.name();
-    for (var i = 0; i < data.length && i < max; i++) {
-      var linkdata = "";
-      var action = "";
-      if (!pzIndex) {
-        // Special case: target selection
-        linkdata += ('target_id='+data[i].id+' ');
-        if (!team.targetFiltered(data[i].id)) {
-          action = 'mkws.limitTarget(\'' + teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)';
-        }
-      } else {
-        action = 'mkws.limitQuery(\'' + teamName + '\', \'' + pzIndex + '\', this.firstChild.nodeValue)';
-      }
-      linkdata += 'onclick="' + action + ';return false;"';
-      terms.push({
-        term: data[i].name,
-        field: data[i].id,
-        count: data[i].freq,
-        linkdata: linkdata
-      }); 
-    }
-    // configured template > facet specific template > default facet template
-    var template;
-    if (that.config.template) {
-      template = team.loadTemplate(that.config.template);
-    } else {
-      template = team.loadTemplate("facet-" + name);
-      if (template) {
-        that.log("Using facet-" + name + " template.")
-      } else {
-        that.log("No " + name + " specific template, using default.")
-        template = team.loadTemplate("facet");
-      }
-    }
-    that.node.html(template({
-      name: name,
-      caption: caption,
-      query: that.config.query,
-      terms: terms
-    }));
-  });
-  this.autosearch();
-});
diff --git a/src/templates/facets.handlebars b/src/templates/facets.handlebars
new file mode 100644 (file)
index 0000000..8ebc91f
--- /dev/null
@@ -0,0 +1,11 @@
+{{!
+Facets, a container of all configured facets.
+
+team - the current team
+facets - array of facet names
+}}
+
+<div class="mkws-facets-title mkwsTermlistsTitle">{{mkws-translate "Facets"}}</div>
+{{#each facets}}
+  <div class="mkws-facet mkwsFacet mkws-team-{{../team}}" data-mkws-facet="{{this}}"></div>
+{{/each}}
index 26ee6da..bd6bf3e 100644 (file)
@@ -12,7 +12,7 @@ languages
   {{~else~}}
     <a href="{{{url}}}">{{code}}</a>
   {{~/if~}}
-  {{#unless last}}
+  {{#unless @last}}
     |
   {{/unless}}
 {{/each}}
index fcda1bc..fc87e4c 100644 (file)
@@ -5,8 +5,8 @@ team - team for this widget
 }}
 <table width="100%" border="0" cellpadding="6" cellspacing="0">
   <tr>
-    <td class="mkws-termlists-container-wide mkws-team-{{team}}" width="250" valign="top">
-      <div class="mkws-termlists mkwsTermlists mkws-team-{{team}}"></div>
+    <td class="mkws-facets-container-wide mkws-team-{{team}}" width="250" valign="top">
+      <div class="mkws-facets mkwsTermlists mkws-team-{{team}}"></div>
     </td>
     <td class="mkws-motd-container mkwsMOTDContainer mkws-team-{{team}}" valign="top">
       <div class="mkws-ranking mkwsRanking mkws-team-{{team}}"></div>
@@ -17,7 +17,7 @@ team - team for this widget
   </tr>
   <tr>
     <td colspan="2">
-      <div class="mkws-termlists-container-narrow mkws-team-{{team}}"></div>
+      <div class="mkws-facets-container-narrow mkws-team-{{team}}"></div>
     </td>
   </tr>
 </table>
index 132f87f..5bba8a2 100644 (file)
@@ -4,7 +4,8 @@ Target detail
 data:
   id - target id, an opaque identifier
   hits - number of hits for this target, or "Error" if an error has occurred
-  diagnostic - diagnostic code returned by target, if any. May be numeric or human-readable
+  diagnostic - numeric diagnostic code returned by target; 0 if OK
+  message - message corresponding to diagnostic code, if any.
   records - number of record retrieved from target
   state - target state (Client_Idle, Client_Working, Client_Disconnected or Client_Error)
 }}
@@ -24,7 +25,11 @@ data:
     <tr>
       <td>{{{id}}}</td>
       <td>{{hits}}</td>
-      <td>{{diagnostic}}</td>
+      <td>
+       {{#if message}}
+         {{diagnostic}} ({{message}})
+       {{/if}}
+      </td>
       <td>{{records}}</td>
       <td>{{state}}</td>
     </tr>
diff --git a/src/templates/termlists.handlebars b/src/templates/termlists.handlebars
deleted file mode 100644 (file)
index 66caa83..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{{!
-Termlists, a container of all configured facets.
-
-team - the current team
-facets - array of facet names
-}}
-
-<div class="mkws-termlists-title mkwsTermlistsTitle">Termlists</div>
-{{#each facets}}
-  <div class="mkws-facet mkwsFacet mkws-team-{{../team}}" data-mkws-facet="{{this}}"></div>
-{{/each}}
index 0f434d0..b91f049 100755 (executable)
@@ -42,26 +42,31 @@ die usage if !@system;
 # be ignored
 eval {
     require BSD::Resource;
-    BSD::Resource::setrlimit("RLIMIT_CPU", $timeout, 2*$timeout) or die "Cannot set CPU limit: $!\n";
+    BSD::Resource::setrlimit( "RLIMIT_CPU", $timeout, 2 * $timeout )
+      or die "Cannot set CPU limit: $!\n";
 };
 if ($@) {
-    warn "WARNING: things would go more nicely with the BSD::Resource package\n";
+    warn
+      "WARNING: things would go more nicely with the BSD::Resource package\n";
 }
 
-
 #
-# use fork/exec instead system()
+# configure signal handlers
 #
-$pid = fork();
-die "fork() failed: $!" unless defined $pid;
+$SIG{ALRM} = sub {
+    my $pgid = getpgrp();
 
-# child
-if ($pid) {
-    alarm($timeout);
-    exec(@system) or die "exec @system: $!\n";
-}
+    # kill process group
+    kill "INT", -$pgid;
+};
 
-# parent
-else { }
+# don't kill ourself
+$SIG{INT} = "IGNORE";
+
+alarm($timeout);
+
+system(@system) == 0
+  or die "system @system failed: $?";
 
 1;
+
index 91543c2..ccc161e 100644 (file)
@@ -227,13 +227,13 @@ describe("Check pazpar2 hit counter", function () {
     });
 });
 
-describe("Check Termlist", function () {
+describe("Check Facets", function () {
     var $ = mkws.$;
 
-    it("found Termlist", function () {
-        var termlist = $("div.mkws-termlists");
-        debug("Termlist success: " + termlist.length);
-        expect(termlist.length).toBe(1);
+    it("found Facets", function () {
+        var facets = $("div.mkws-facets");
+        debug("Facet success: " + facets.length);
+        expect(facets.length).toBe(1);
 
         waitsFor(function () {
             return $("div.mkws-facet[data-mkws-facet='xtargets']").length == 1 ? true : false;
@@ -242,7 +242,7 @@ describe("Check Termlist", function () {
         // everything displayed?
         runs(function () {
             var sources = $("div.mkws-facet[data-mkws-facet='xtargets']");
-            debug("Termlist sources success: " + sources.length);
+            debug("Facet sources success: " + sources.length);
             expect(sources.length).toBe(1);
 
             var subjects = $("div.mkws-facet[data-mkws-facet='subject']");
index 18a303c..e2d3581 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
 
 PHANTOMJS_TIMEOUT=30
-PHANTOMJS=     ../node_modules/phantomjs/bin/phantomjs
+PHANTOMJS=     perl ../bin/bomb.pl --timeout=${PHANTOMJS_TIMEOUT} ../node_modules/phantomjs/bin/phantomjs
 IMAGES=                ./images
 SCREENSHOT_WIDTH_HEIGHT=       1000 1200
 PERL_SCRIPTS=  ../bin/bomb.pl
@@ -18,6 +18,7 @@ all: help
 
 clean:
        rm -f index-*.html
+       rm -f iframe-*.html
        rm -f ${IMAGES}/*.png
 
 distclean: clean
@@ -30,7 +31,7 @@ screenshot:
          ${PHANTOMJS} ${PROG} ${PHANTOMJS_URL} ${IMAGES}/tmp.$$file.png ${SCREENSHOT_WIDTH_HEIGHT} ${TIMEOUT}; \
          mv -f  ${IMAGES}/tmp.$$file.png  ${IMAGES}/$$file.png
 
-screenshots: clean estimate-time
+screenshots: clean estimate-time iframe
        for t in ${TESTS}; do \
            for i in $$(cat url.$$t); do \
                ${MAKE} PHANTOMJS_URL="$$i" TIMEOUT=4 PREFIX=$$t screenshot; \
@@ -45,10 +46,14 @@ estimate-time:
 index:
        ( cd ${IMAGES}; ls -tr ${PREFIX}.*.png | perl -ne 'chomp; print qq{<h2>$$_</h2><img src="'${IMAGES}/'$$_"/><br/><br/><p/>\n}' ) > index-${PREFIX}.html
 
+iframe: index-iframe-demo
+index-iframe-demo:
+       ( cat url.demos | perl -ne 'chomp; print qq{<h2>$$_</h2><iframe width="900px" height="600px" src="$$_"></iframe>\n}' ) > iframe-demos.html
+
 help:
        @echo "make [ all | clean | distclean ]"
        @echo "     [ screenshots ]"
-       @echo "     [ screenshot | index ]"
+       @echo "     [ screenshot | index | iframe ]"
        @echo ""
        @echo "Examples: "
        @echo ""
index 1087ee7..6ef9d58 100644 (file)
@@ -7,3 +7,6 @@ http://example.indexdata.com/dict.html
 http://example.indexdata.com/popup.html
 http://example.indexdata.com/auto.html
 http://example.indexdata.com/localauth.html
+http://www.indexdata.com/news/2014/06/using-smart-widgets-integrate-information-access
+http://example.indexdata.com/topic.html?q=sushi
+http://example.indexdata.com/prettysimple.html
index c5b8207..2ebec85 100644 (file)
@@ -2,6 +2,3 @@ http://cph.koha.indexdata.com/cgi-bin/koha/opac-search.pl?q=sushi
 http://demo.koha.indexdata.com/cgi-bin/koha/opac-search.pl?q=sushi
 http://demo.koha.indexdata.com/cgi-bin/koha/opac-search.pl?q=sushi2
 http://boston.koha.indexdata.com/cgi-bin/koha/opac-search.pl?q=sushi
-http://example.indexdata.com/topic.html?q=sushi
-http://example.indexdata.com/simple.html
-
index 74c384f..989e2ef 100644 (file)
@@ -3,13 +3,15 @@
 
 <VirtualHost *:80>
     ServerName mkws.indexdata.com
+    ServerAlias mkws01.indexdata.com
+    ServerAlias mkws02.indexdata.com
 
     ErrorLog /var/log/apache2/mkws-error.log
     CustomLog /var/log/apache2/mkws-access.log combined
 
     DocumentRoot /home/indexdata/mkws/tools/htdocs
     Alias /libjs-pz2/ /home/indexdata/libjs-pz2/
-    Alias /pazpar2/ /home/indexdata/pazpar2/
+    Alias /pazpar2/ /usr/share/pazpar2/
 
     RewriteEngine on
     RewriteLogLevel 1
index d756148..7db0c62 100644 (file)
@@ -3,16 +3,16 @@
 
 <VirtualHost *:80>
     ServerName x.mkws.indexdata.com
-    ErrorLog /opt/local/apache2/logs/mkws-error.log
-    CustomLog /opt/local/apache2/logs/mkws-access.log combined
+    ErrorLog /var/log/apache2/mkws-error.log
+    CustomLog /var/log/apache2/mkws-access.log combined
 
-    DocumentRoot /usr/local/src/git/mkws/tools/htdocs
-    Alias /libjs-pz2/ /usr/local/src/git/libjs-pz2/
-    Alias /pazpar2/ /usr/local/src/git/pazpar2/
+    DocumentRoot /Users/mike/git/work/mkws/tools/htdocs
+    Alias /libjs-pz2/ /Users/mike/git/work/libjs-pz2/
+    Alias /pazpar2/ /Users/mike/git/work/pazpar2/
 
     RewriteEngine on
     RewriteLogLevel 1
-    RewriteLog /opt/local/apache2/logs/spclient-rewrite.log 
+    RewriteLog /var/log/apache2/spclient-rewrite.log 
     RewriteRule /service-proxy-auth(/)?(;jsessionid=.+)? /service-proxy/$2?command=auth&action=login&username=guest&password=guest [P] # [NE,P]
 
     # For MKC Service Proxy
         Allow from all
     </Directory>
 </VirtualHost>
-
-<VirtualHost *:80>
-    ServerName x.example.indexdata.com
-    ErrorLog /opt/local/apache2/logs/example-error.log
-    CustomLog /opt/local/apache2/logs/example-access.log combined
-
-    DocumentRoot /usr/local/src/git/mkws/examples/htdocs
-    Alias /tools/htdocs/ /usr/local/src/git/mkws/tools/htdocs/
-    Alias /src/ /usr/local/src/git/mkws/src/
-    Alias /jasmine/ /usr/local/src/git/mkws/examples/jasmine/
-    Alias /test/ /usr/local/src/git/mkws/test/
-
-    # Needed on Mac, which locks Apache down hard by default.
-    <Directory />
-        Allow from all
-    </Directory>
-</VirtualHost>
index f335d96..3ad151b 100644 (file)
@@ -7,6 +7,8 @@
 #
 <VirtualHost *:80>
     ServerName sp-mkws.indexdata.com
+    ServerAlias sp-mkws01.indexdata.com
+    ServerAlias sp-mkws02.indexdata.com
 
     ErrorLog /var/log/apache2/sp-mkws-error.log
     CustomLog /var/log/apache2/sp-mkws-access.log combined
diff --git a/tools/apache2/sp-mkws-mike-mac b/tools/apache2/sp-mkws-mike-mac
new file mode 100644 (file)
index 0000000..e942550
--- /dev/null
@@ -0,0 +1,25 @@
+<VirtualHost *:80>
+    ServerName x.sp-mkws.indexdata.com
+
+    ErrorLog /var/log/apache2/sp-mkws-error.log
+    CustomLog /var/log/apache2/sp-mkws-access.log combined
+
+    DocumentRoot /Users/mike/git/work/mkws/tools/sp-htdocs
+
+    Header set Access-Control-Allow-Credentials true
+
+    ProxyPreserveHost On
+    # We could use any of the following:
+    ProxyPass        /service-proxy/ http://x.sp-mkws.indexdata.com:8585/service-proxy/
+    ProxyPassReverse /service-proxy/ http://x.sp-mkws.indexdata.com:8585/service-proxy/
+
+    <Directory />
+        Allow from all
+    </Directory>
+
+#    PerlOptions +Parent
+#    PerlSwitches -I/home/indexdata/mkws/tools/mod_perl
+#    <Location /service-proxy>
+#        PerlOutputFilterHandler MyApache2::SetACAO
+#    </Location>
+</VirtualHost>
index 35c4899..7a42ce2 100644 (file)
Binary files a/tools/htdocs/favicon.ico and b/tools/htdocs/favicon.ico differ
index db7bffa..5964b65 100644 (file)
@@ -1,7 +1,7 @@
 .mkwsLang, .mkws-lang,
 .mkwsSwitch, .mkws-switch,
 .mkwsSearch, .mkws-search,
-.mkwsTermlists, .mkws-termlists,
+.mkwsTermlists, .mkws-facets,
 .mkwsFacet, .mkws-facet,
 .mkwsRanking, .mkws-ranking,
 .mkwsPager, .mkws-pager,
@@ -10,7 +10,8 @@
 .mkwsRecord, .mkws-record,
 .mkwsTargets, .mkws-targets,
 .mkwsStat, .mkws-stat,
-.mkwsMOTD, .mkws-motd {
+.mkwsMOTD, .mkws-motd,
+.mkwsAuthname, .mkws-auth-name {
     font-family: Gill Sans, "Gillius ADF", Gillius, GilliusADF, Verdana, Sans-Serif;
 }
 
     cursor: pointer;
 }
 
+.mkwsAuthname, .mkws-auth-name {
+    color: #132194;
+}
+
 .mkwsSearch input.mkwsQuery, .mkws-search input.mkws-query {
     border: 2px inset #e0f0ff;
     padding: 3px;
     background: #f0f8ff;
 }
 
-.mkwsTermlistsTitle, .mkws-termlists-title {
+.mkwsTermlistsTitle, .mkws-facets-title {
     font-size: large;
     font-weight: bold;
     text-transform: uppercase;
 }
 
-.mkwsTermlists, .mkws-termlists {
+.mkwsTermlists, .mkws-facets {
     background: #d0e0ff;
     padding: 0.7em;
     font-size: small;
     -webkit-border-top-right-radius: 10px;
 }
 
-.mkwsTermlists.active, .mkws-termlists.active {
+.mkwsTermlists.active, .mkws-facets.active {
     display: block;
 }
 
diff --git a/tools/service-proxy/README b/tools/service-proxy/README
new file mode 100644 (file)
index 0000000..d68a159
--- /dev/null
@@ -0,0 +1,3 @@
+After editing the Service Proxy definition, it must be updated on both
+sansa and arya: see the Twiki entry on hosted search production boxes:
+https://twiki.indexdata.com/twiki/bin/view/ID/HostedSearchProd
index a3b92e4..8332385 100644 (file)
@@ -9,7 +9,7 @@ plugins.ils        = com.indexdata.serviceproxy.plugins.ILSPlugin
 plugins.statistics = com.indexdata.serviceproxy.plugins.StatisticsPlugin
 
 
-# Configuration properties for individual plug-ins 
+# Configuration properties for individual plug-ins
 
 # relay plugin, proxies commands through to Pazpar2
 relay.PROXY_MODE = 3
@@ -22,11 +22,11 @@ relay.STREAMBUFF_SIZE = 4096
 relay.PARSE_RESPONSES = true
 relay.CF_ENGINE_ADDRESS = localhost:9003
 
-# authn plugin, for torus based authentication 
+# authn plugin, for torus based authentication
 authn.TORUS_URL        = http://mkc-admin.indexdata.com/torus2/identity.USERS/records/
 authn.MASTER_TORUS_URL = http://mkc-admin.indexdata.com/torus2/admin.admin/records/
-authn.ACTION_SEQUENCE = check,login,referrer,constraint,ipauth
-authn.SPECIFIC_CONSTRAINT = hostName=${thisHost} 
+authn.ACTION_SEQUENCE = check,login,referrer,ipauth,constraint
+authn.SPECIFIC_CONSTRAINT = token="mkws-default"
 
 # categories plugin, for Torus-based target categories
 categories.TORUS_BASEURL            = http://mkc-admin.indexdata.com/torus2/