Fork me on GitHub

Plugin geocodes client

Introduction

The purpose of this plug-in is to provide a local REST service to call geocodes services.

Configuration

The httpTransport bean must be injected in context (see the plugin context xml file for example).

Set the properties to specify APIM gateway url, AM token url, and credentials.

Usage

Use the lutece @autocomplete macro, with the local suggestion URLs :

  • GET /rest/geocodesclient/api/v1/cities
  • GET /rest/geocodesclient/api/v1/countries

Example :

  •  	<@input type='date' id='birthdate' name='birthdate'  />  	
  •  	<@input type='text' id='birthplace_code' name='birthplace_code' /> 
  •  	<@input type='text' id='birthplace' name='birthplace'  /> 
  •  	<@autocomplete id="autocompleteBirthPlace" name="" itemValueFieldName="displayValue"
    					suggestionsUrl="rest/geocodesclient/api/v1/cities?search="
    					suggestionsPath="result"
    					itemTitleFieldNames='["value","codeZone"]' 
    					minimumInputLength=3 
    					additionnalRequestParamInputId="birthdate"
    					copyFields='[{"inputName":"birthplace_code","resultFieldName":"code"},{"inputName":"birthplace","resultFieldName":"value"}]' /> 
    					
  •  	<@input type='text' id='birthcountry_code' name='birthcountry_code' /> 
  •  	<@input type='text' id='birthcountry' name='birthcountry'  /> 
  •  	<@autocomplete id="autocompleteBirthCoutnry" name="" itemValueFieldName="value"
    					suggestionsUrl="rest/geocodesclient/api/v1/countries?search="
    					suggestionsPath="result"
    					itemTitleFieldNames='["value"]' 
    					minimumInputLength=3 
    					additionnalRequestParamInputId="birthdate"
    					copyFields='[{"inputName":"birthcountry_code","resultFieldName":"code"},{"inputName":"birthcountry","resultFieldName":"value"}]' />