Merge branch 'master' into wosch
authorWolfram Schneider <wosch@indexdata.dk>
Fri, 16 Aug 2013 11:17:59 +0000 (11:17 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Fri, 16 Aug 2013 11:17:59 +0000 (11:17 +0000)
README
examples/htdocs/index-jakub.html [new file with mode: 0644]
examples/htdocs/index-mike.html
tools/apache2/mkws-jakub [new file with mode: 0644]
tools/htdocs/.gitignore
tools/htdocs/Makefile
tools/htdocs/README.markdown
tools/htdocs/mkws-doc.css [new file with mode: 0644]
tools/htdocs/whitepaper.markdown [new file with mode: 0644]

diff --git a/README b/README
index c3996cb..3b99f61 100644 (file)
--- a/README
+++ b/README
@@ -14,15 +14,11 @@ and a high-level description can be found at
 WHAT'S WHAT
 ===========
 
-experiments -- a directory containing code experiments:
-       jquery-ui -- Using a JQuery UI element
-       jsdemo -- The basic pazpar2 client, running locally
-       spclient -- Mike's hardly-there sketch
-       spdemo -- Wolfram's functioning jsdemo-targeted-at-SP
-
-etc -- configuration files for the various experiments
-       apache2 -- configuration for running spdemo
-       service-proxy -- config for running a local Service Proxy
+README -- this file
+Makefile -- delegates to tools/htdocs/Makefile
+tools -- the tools that make up the Widget Set
+examples -- examples of applications that use MKWS
+notes -- internal documents, not for customers
 
 
 Required devel tools
diff --git a/examples/htdocs/index-jakub.html b/examples/htdocs/index-jakub.html
new file mode 100644 (file)
index 0000000..fc2539a
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo client</title>
+    <link rel="stylesheet" type="text/css" href="http://mkws-origin/mkwsStyle.css" />
+    <script type="text/javascript">
+      var mkws_config = {
+        service_proxy_url: "http://mkws-origin/service-proxy/",
+        service_proxy_auth: "http://mkws-origin/service-proxy-auth/"
+      };
+    </script>
+    <script type="text/javascript" src="http://mkws-origin/mkws-complete.js"></script>
+  </head>
+  <body>
+    <div id="mkwsSwitch"></div>
+    <div id="mkwsLang"></div>
+    <div id="mkwsSearch"></div>
+    <div id="mkwsResults"></div>
+    <div id="mkwsTargets"></div>
+    <div id="mkwsStat"></div>
+  </body>
+</html>
index aac01ea..22b4624 100644 (file)
@@ -6,7 +6,8 @@
     <script type="text/javascript">
       var mkws_config = {
        responsive_design: true,
-       responsive_design_width: 600
+       responsive_design_width: 600,
+       switch_menu: true
       };
     </script>
     <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
     <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
   </head>
   <body>
-    <div id="mkwsSwitch"></div>
-    <div id="mkwsLang"></div>
-    <div id="mkwsSearch"></div>
-    <div id="mkwsResults"></div>
+    <div id="mkwsSwitch"></div><!-- ### does not work -->
+    <div id="mkwsLang"></div><!-- optional -->
+    <div id="mkwsSearch"></div><!-- MANDATORY -->
+    <div id="mkwsResults"></div><!-- MANDATORY but components may be used -->
     <div id="mkwsTargets"></div>
-    <div id="mkwsStat"></div>
+    <div id="mkwsStat"></div><!-- optional -->
   </body>
 </html>
diff --git a/tools/apache2/mkws-jakub b/tools/apache2/mkws-jakub
new file mode 100644 (file)
index 0000000..6672676
--- /dev/null
@@ -0,0 +1,17 @@
+<VirtualHost *:80>
+  ServerName mkws-origin
+  DocumentRoot /Users/jakub/code/mkws/tools/htdocs
+
+  # auth
+  RewriteEngine on
+  RewriteRule /service-proxy-auth/ /service-proxy/?command=auth&action=login&use
+  rname=demo&password=demo [P] # [NE,P]
+
+  # allow cors
+  Header set Access-Control-Allow-Origin *
+
+  # For MKC Service Proxy
+  ProxyPass        /service-proxy/ http://mk2-test.indexdata.com/service-proxy/
+  ProxyPassReverse /service-proxy/ http://mk2-test.indexdata.com/service-proxy/
+</VirtualHost>
+
index 6ed54ea..824fa4a 100644 (file)
@@ -1,2 +1,7 @@
 mkws-complete.js
 README.html
+README.odt
+README.pdf
+whitepaper.html
+whitepaper.odt
+whitepaper.pdf
index 5f265aa..e63209b 100644 (file)
@@ -14,18 +14,21 @@ JQUERY_UI_URL=      http://code.jquery.com/ui/1.10.3/jquery-ui.js
 #JQUERY_UI_URL=        http://code.jquery.com/ui/1.8.0/jquery-ui.min.js
 
 MKWS_JS=       mkws-complete.js
-all: ${MKWS_JS} README.html
+DOCS = README.html README.odt README.pdf \
+       whitepaper.html whitepaper.odt whitepaper.pdf
+**default**: ${MKWS_JS} README.html whitepaper.html
+all: ${MKWS_JS} $(DOCS)
 
 mkws-js ${MKWS_JS}: ../../../libjs-pz2/pz2api.1.js mkws.js
        ( echo "/* created at: $$(date)"; \
-         echo "   mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,') */"; \
+         echo "   mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,') */"; \
          curl -sSf ${JQUERY_URL}; \
          cat ../../../libjs-pz2/pz2api.1.js mkws.js ) > ${MKWS_JS}.new 
        mv -f ${MKWS_JS}.new ${MKWS_JS}
 
 distclean: clean
 clean:
-       rm -f ${MKWS_JS} README.html
+       rm -f ${MKWS_JS} $(DOCS)
 
 help:
        @echo "make [ help | mkws-js | clean ]"
@@ -38,8 +41,18 @@ help:
 # For a description of pandoc's markdown format, see:
 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html -->
 
-README.html: README.markdown
+%.html: %.markdown
        rm -f $@
-       pandoc --standalone $< > $@
+       pandoc --standalone -c mkws-doc.css $< -o $@
+       chmod ugo-w $@
+
+%.odt: %.markdown
+       rm -f $@
+       pandoc --standalone $< -o $@
+       chmod ugo-w $@
+
+%.pdf: %.markdown
+       rm -f $@
+       pandoc --standalone $< -o $@
        chmod ugo-w $@
 
index 0b0e42a..7ca160f 100644 (file)
@@ -11,24 +11,19 @@ pazpar2, but it is now far removed from those beginnnings.
 How this works
 --------------
 
-The goal is to make it that as much of the searching functionality as
-possible is hosted on
+As much of the searching functionality as possible is hosted on
        <http://mkws.indexdata.com/>
 so that very simple websites such as
        <http://example.indexdata.com/>
 can have MasterKey searching with minimal effort.
 
-The following files are hosted on mkws.indexdata.com:
+The following files are hosted on `mkws.indexdata.com`:
 
-* `mkws.js`
 * `mkwsStyle.css`
+* `mkws.js`
 * `/libjs-pz2/pz2api.1.js`
-
-The following files make up an application:
-
-* `index.html`
-* `favicon.ico` [_optional_]
-* `robots.txt` [_optional_]
+* `mkws-complete.js` -- a single file consisting of `mkws.js`,
+  jQuery (which it uses) and `pz2api.1.js`
 
 
 Configuring a client
diff --git a/tools/htdocs/mkws-doc.css b/tools/htdocs/mkws-doc.css
new file mode 100644 (file)
index 0000000..f769329
--- /dev/null
@@ -0,0 +1,47 @@
+body {
+    font-family: Times, "Times Roman", "Times New Roman";
+}
+
+h1, h2, h3 {
+    color: #68a;
+    font-weight: bold;
+    font-family: Gill Sans, "Gillius ADF", Gillius, GilliusADF, Verdana, Sans-Serif;
+}
+
+h1 {
+    background: #e0e8f8;
+    padding: 0.2em;
+    font-weight: normal;
+}
+
+h2.author {
+    font-size: 120%;
+    color: black
+}
+
+h3.date {
+    font-size: 100%;
+    color: black
+}
+
+body > p, ul, pre {
+    margin-left: 10%;
+}
+
+p, ul {
+    max-width: 40em;
+}
+
+pre {
+    background: #eee;
+}
+
+/*
+ * Works with the HTML emitted by pandoc. It would better if pandoc
+ * were to emit class names that we can use. But it doesn't.
+ */  
+body > p:last-of-type {
+    font-size: small;
+    max-width: none;
+    text-align: right;
+}
diff --git a/tools/htdocs/whitepaper.markdown b/tools/htdocs/whitepaper.markdown
new file mode 100644 (file)
index 0000000..6998d08
--- /dev/null
@@ -0,0 +1,73 @@
+% Using the MasterKey Widget Set to embed metasearching functionality in any web-site
+% Mike Taylor
+% 26 July 2013
+
+Introduction
+------------
+
+There are lots of practical problems in building resource discovery
+solutions. One of the biggest, and most ubiquitous is incorporating
+metasearching functionality into existing web-sites -- for example,
+content-management systems, library catalogues or intranets. In
+general, even when access to metasearching is provided by simple
+web-services such as [Pazpar2](http://www.indexdata.com/pazpar2),
+integration work is seen as a major part of most projects.
+
+Index Data provides several different toolkits for communicating with
+its metasearching middleware, trading off varying degrees of
+flexibility against convenience:
+
+* libpz2.js -- a low-level JavaScript library for interrogating the
+  Service Proxy and Pazpar2. It allows the HTML/JavaScript programmer
+  to implement simple JavaScript functions to display facets, records,
+  etc.
+
+* masterkey-ui-core -- a higher-level, complex JavaScript library that
+  uses libpz2.js to provide the pieces needed for building a
+  full-featured JavaScript application.
+
+* MasterKey Demo UI -- an example of a searching application built on
+  top of masterkey-ui-core. Available as a public demo at
+  http://mk2.indexdata.com/
+
+* MKDru -- a toolkit for embedding MasterKey-like searching into
+  Drupal sites.
+
+All of these approaches require programming to a greater or lesser
+extent. Against this backdrop, we introduced MKWS (the MasterKey
+Widget Set) -- a set of simple, very high-level HTML+CSS+JavaScript
+components that can be incorporated into any web-site to provide
+MasterKey searching facilities. By placing `<div>`s with well-known
+identifiers in any HTML page, the various components of an application
+can be embedded: search-boxes, results areas, target information, etc.
+
+
+Simple Example
+--------------
+
+The following is a complete MKWS-based searching application:
+
+    <html>
+      <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <title>MKWS demo client</title>
+        <link rel="stylesheet" href="http://mkws.indexdata.com/mkwsStyle.css" />
+        <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
+      </head>
+      <body>
+        <div id="mkwsSwitch"></div>
+        <div id="mkwsLang"></div>
+        <div id="mkwsSearch"></div>
+        <div id="mkwsResults"></div>
+        <div id="mkwsTargets"></div>
+        <div id="mkwsStat"></div>
+      </body>
+    </html>
+
+More sophisticated applications will not simply place the `<div>`s
+together, but position them carefully within an existing page
+framework -- such as a Drupal template, an OPAC or a SharePoint page.
+
+- - -
+
+Copyright (C) 2013 by IndexData ApS, <http://www.indexdata.com>