Changeset 5201 for MILK


Ignore:
Timestamp:
20/04/09 09:36:43 (10 years ago)
Author:
cbyrom
Message:

Add functionality to allow vocab term searches to be done via an
ajax enabled, autocomplete text input. Add new controller and template
packages for this as well as javascript and style sheets. Also update
routing and add (commented out) example of usage in layout + add
documentation on how to use.

Location:
MILK/trunk/milk_server
Files:
9 added
4 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/README.txt

    r5198 r5201  
    7373paster serve --reload development.ini 
    7474 
     75Vocab server autocomplete client 
     76------------------- 
     77Also included in the codebase is a client for doing ajax based autocomplete vocab 
     78term searches against a vocab server for an input text field.  Details on how 
     79to set this up for use are available in milk_server/controllers/vocabsearch/README.txt. 
     80 
    7581Further Notes 
    7682----------------- 
  • MILK/trunk/milk_server/milk_server/config/milkMiddleware.py

    r5198 r5201  
    55from ndg.common.src.models.myconfig import myConfig 
    66from ndg.common.src.lib.atomvalidator import AtomValidator 
     7from ndg.common.src.clients.http.vocabserverclient import VocabServerClient 
    78import milk_server.lib.helpers as h 
    89 
     
    8384                                               isDebug = self.globals.debugModeOn, 
    8485                                               loadAllCollections = False) 
     86 
     87        # initialise client to vocab server - to do vocab term searches 
     88        self.globals.vocabServerClient = VocabServerClient(proxyServer = self.globals.proxyServer) 
    8589 
    8690        # initialise collection to store re-usable connections to the eXist DB 
  • MILK/trunk/milk_server/milk_server/config/routing.py

    r5158 r5201  
    6161    map.connect('correct/:uri', controller='trackback/trackback', action='correct') 
    6262 
     63    # routing for the autocomplete vocab server search input 
     64    map.connect('doVocabSearch', controller = 'vocabsearch/vocabsearch', action='doVocabSearch') 
     65 
    6366 
    6467    #do this last or else you'll get bizarre behaviour 
  • MILK/trunk/milk_server/milk_server/templates/layout.html

    r5158 r5201  
    33        xmlns:xi="http://www.w3.org/2001/XInclude" py:strip=""> 
    44<xi:include href="ndgPage.html" /> 
     5<!--  to see the vocab server autocomplete working, uncomment this line and the line further down 
     6<xi:include href="vocabsearch/vocabsearch.html" /> 
     7--> 
    58<?python from milk_server.controllers.atom_editor.editorconstants import *?> 
    69 
     
    1114      </title> 
    1215                ${Markup(h.javascript_include_tag(builtins=True))} 
    13                 <script type="text/javascript" src="$g.server/js/yui/build/yui/yui-min.js" ></script>  
     16                <script type="text/javascript" src="$g.server/js/yui/build/yui/yui-min.js" /> 
    1417            <script type="text/javascript" src="$g.server/js/toggleDiv.js"/> 
    1518        <script type="text/javascript" src="$g.server/js/ndgJavascript.js"/> 
     
    3841            <div py:replace="localTextSearch()"/> 
    3942          </div> 
     43<!--  to see the vocab server autocomplete working, uncomment this line and the line further up 
     44          <div py:replace="vocabSearchAutoComplete()" /> 
     45--> 
    4046      <div id="content"> 
    4147                <table py:if="g.atomEditorEnabled and c.title != ATOM_HOME_TITLE" class="homeHelpBar"> 
Note: See TracChangeset for help on using the changeset viewer.