[Cartoweb-users] search plugin?
Oliver Christen
oliver.christen at camptocamp.com
Mon Mar 12 04:21:28 EST 2007
the encodingContext is simply a name attributed to the search plugin so all
encoding/decoding of string are done in the same type of encoding (utf-8,
ISO-8859-1, ASCII, ...)
the name reffer to the encoding set in client.ini, for exemple:
EncoderClass.vaudDb = EncoderISO <- this mean the database encoding is
ISO-8859-1
This is only needed if, for exemple, your database data is in
ISO-8859-1 and specials characters are not displayed correctly in the page
(which usually is in UTF-8)
see
http://www.cartoweb.org/doc/cw3.3/xhtml/user.i18n.html#user.i18n.encoding
for more info
This parameter is not mandatory, it should work without
it.
Regards
Oliver
----- Original Message ----- From: "wochter"
<wochter at seznam.cz>
To: "Oliver Christen" <oliver.christen at camptocamp.com>;
<cartoweb-users at lists.maptools.org>
Sent: Monday, March 12, 2007 9:53 AM
Subject: Re: [Cartoweb-users] search plugin?
hi,
thank you for advice.
I will try it.
Please, what does vaudDb mean in this line?
encodingContext = vaudDb
What string I have to use for postgres?
I found only this:
$encodingContext =
[line 169]
Tags:
var: context for the encoding
access: public
Type: string
Thanx a lot.
wochter
Oliver Christen wrote / napísal(a):
> small correction, the error seems to come from the sql query itself.
> im not familiar with that plugin either, so im not sure whats the cause.
> I suspect its related to the syntax of the ".where" part in the search
> config file
>
> my advice would be to wait for the documentation, which should be ready
> soon
> in the meantime, im joining an exemple of configuration file for that
> plugin, have a look, maybe it help.
>
> sorry for the inconvenience
>
> regards
> Oliver
>
>
>> Hello,
>>
>> the plugin is quite new and the documentation is not ready yet but should
>> be soon, this week maybe.
>>
>> concerning the error you are getting, I suppose the database request
>> return nothing and the code doesnt seem to like that (empty array, fail
>> with characters encoding)
>>
>> Regards
>> Oliver
>>
>> ----- Original Message ----- From: "wochter" <wochter at seznam.cz>
>> To: "Oliver Christen" <oliver.christen at camptocamp.com>
>> Sent: Friday, March 09, 2007 4:52 PM
>> Subject: Re: [Cartoweb-users] search plugin?
>>
>>
>> Yes, it's better. Thank you!
>> Do you have any hints, how to setup this plugin?
>> I have found no manual.
>> Here is the actual error log:
>>
>> Failure
>>
>> CartoWeb version: HEAD [$Revision: 1.5 $]
>> class: CartocommonException
>> message: Error [8, Undefined index: ,
>> /var/www/cartoweb3/common/Encoding.php, 79]
>> Backtrace:
>>
>> file: 79 - /var/www/cartoweb3/common/Encoding.php
>> call: Common::cartowebErrorHandler(8, "Undefined index: ",
>> "/var/www/cartoweb3/common/Encoding.php", 79, Array(1))
>>
>> file: 117 - /var/www/cartoweb3/common/Encoding.php
>> call: Encoder::getEncoder(Null)
>>
>> file: 272 -
>> /var/www/cartoweb3/projects/wochter/plugins/search/common/Search.php
>> call: Encoder::decode("1", Null)
>>
>> file: 269 -
>> /var/www/cartoweb3/projects/wochter/plugins/search/client/ClientSearch.php
>>
>> call: DbResultProvider->getResult(Object(SearchRequest))
>>
>> file: 265 - /var/www/cartoweb3/client/ClientPluginHelper.php
>> call: ClientSearch->initializeResult(Null)
>>
>> file: UNKNOWN - UNKNOWN
>> call: ServerCallerHelper->initializeResultHelper(Object(ClientSearch),
>> Object(MapResult))
>>
>> file: 267 - /var/www/cartoweb3/common/PluginManager.php
>> call: call_user_func_array(Array(2), Array(2))
>>
>> file: 320 - /var/www/cartoweb3/common/PluginManager.php
>> call: PluginManager->callPluginImplementing(Object(ClientSearch),
>> "ServerCaller", "initializeResult", Array(1))
>>
>> file: 711 - /var/www/cartoweb3/client/Cartoclient.php
>> call: PluginManager->callEnabledPluginsImplementing(2, "ServerCaller",
>> "initializeResult", Array(1))
>>
>> file: 1088 - /var/www/cartoweb3/client/Cartoclient.php
>> call: Cartoclient->callEnabledPluginsImplementing(2, "ServerCaller",
>> "initializeResult", Object(MapResult))
>>
>> file: 1251 - /var/www/cartoweb3/client/Cartoclient.php
>> call: Cartoclient->doMain()
>>
>> file: 38 - /var/www/cartoweb3/htdocs/client.php
>> call: Cartoclient->main()
>>
>>
>>
>>
>> Oliver Christen wrote / napísal(a):
>>> dont ask me why but it seems the parameter must be set on client side
>>> (client_conf/search.ini)
>>> and simply:
>>> dsn = pgsql://siro:h@localhost:5432/gisdata
>>>
>>> if this doesnt work, I will have to bug the guy who coded that plugin
>>> for some more complet documentations
>>>
>>> regards,
>>> Oliver
>>>
>>>
>>>
>>> ----- Original Message ----- From: "wochter" <wochter at seznam.cz>
>>> To: "Oliver Christen" <oliver.christen at camptocamp.com>
>>> Sent: Friday, March 09, 2007 3:30 PM
>>> Subject: Re: [Cartoweb-users] search plugin?
>>>
>>>
>>> yes, sure. session was reseted.
>>>
>>> -this is my client_conf/search.ini:
>>> config.katc0606_par_bb.provider.type = server
>>> config.katc0606_par_bb.formatter.type = smarty
>>> config.katc0606_par_bb.formatter.template = search_results
>>>
>>> -this is my server_conf/search.ini:
>>> dbType = pgsql
>>> dsn = siro:h at localhost:5432/gisdata
>>> config.katc0606_par_bb.provider.type = fulltextTable
>>> config.katc0606_par_bb.provider.table = katc0606_par_bb
>>> config.katc0606_par_bb.provider.id = id
>>> config.katc0606_par_bb.provider.columns = id, parcis
>>> config.katc0606_par_bb.provider.fulltextColumns = parcis
>>>
>>> -this is part of my mapfile:
>>> LAYER #katc0606_par_bb
>>> NAME katc0606_par_bb
>>> TYPE POLYGON
>>> STATUS ON
>>> CONNECTIONTYPE postgis
>>> CONNECTION 'user=siro password=h dbname=gisdata host=localhost
>>> port=5432'
>>> DATA "the_geom from katc0606_par_bb"
>>> LABELITEM "PARCIS"
>>> LABELMAXSCALE 2000
>>> CLASS
>>> NAME 'Kat C 0606 BB'
>>> TEMPLATE 'ttt'
>>> COLOR 183 188 222
>>> OUTLINECOLOR 0 0 0
>>> LABEL
>>> TYPE TRUETYPE
>>> FONT "Vera"
>>> SIZE 8
>>> COLOR 0 0 0
>>> POSITION cc
>>> BACKGROUNDCOLOR 230 230 10
>>> BACKGROUNDSHADOWCOLOR 55 55 55
>>> BACKGROUNDSHADOWSIZE 1 1
>>> SHADOWCOLOR 155 0 0
>>> WRAP " "
>>> END
>>> END
>>> METADATA
>>> 'exported_values' 'recenter_name_string,id_attribute_string'
>>> 'recenter_name_string' 'parcis'
>>> 'id_attribute_string' 'id|int'
>>> 'query_returned_attributes' 'parcis'
>>> END
>>> END
>>>
>>>
>>>
>>> Oliver Christen wrote / napísal(a):
>>>> did you reset the session after you changed the parameters ?
>>>>
>>>>
>>>> ----- Original Message ----- From: "wochter" <wochter at seznam.cz>
>>>> To: "Oliver Christen" <oliver.christen at camptocamp.com>;
>>>> <cartoweb-users at lists.maptools.org>
>>>> Sent: Friday, March 09, 2007 2:36 PM
>>>> Subject: Re: [Cartoweb-users] search plugin?
>>>>
>>>>
>>>> I tried:
>>>> dbType = pgsql
>>>> dsn = user:pass at localhost:5432/gisdata
>>>>
>>>> but with the same result:
>>>>
>>>> Failure
>>>>
>>>> CartoWeb version: HEAD [$Revision: 1.5 $]
>>>> class: CartocommonException
>>>> message: Either DSN or DB type must be defined
>>>> Backtrace:
>>>>
>>>> file: 267 -
>>>> /var/www/cartoweb3/projects/wochter/plugins/search/common/Search.php
>>>> call: DbResultProvider->getDsn()
>>>>
>>>> file: 269 -
>>>> /var/www/cartoweb3/projects/wochter/plugins/search/client/ClientSearch.php
>>>>
>>>>
>>>> call: DbResultProvider->getResult(Object(SearchRequest))
>>>>
>>>> file: 265 - /var/www/cartoweb3/client/ClientPluginHelper.php
>>>> call: ClientSearch->initializeResult(Null)
>>>>
>>>> file: UNKNOWN - UNKNOWN
>>>> call: ServerCallerHelper->initializeResultHelper(Object(ClientSearch),
>>>> Object(MapResult))
>>>>
>>>> file: 267 - /var/www/cartoweb3/common/PluginManager.php
>>>> call: call_user_func_array(Array(2), Array(2))
>>>>
>>>> file: 320 - /var/www/cartoweb3/common/PluginManager.php
>>>> call: PluginManager->callPluginImplementing(Object(ClientSearch),
>>>> "ServerCaller", "initializeResult", Array(1))
>>>>
>>>> file: 711 - /var/www/cartoweb3/client/Cartoclient.php
>>>> call: PluginManager->callEnabledPluginsImplementing(2, "ServerCaller",
>>>> "initializeResult", Array(1))
>>>>
>>>> file: 1088 - /var/www/cartoweb3/client/Cartoclient.php
>>>> call: Cartoclient->callEnabledPluginsImplementing(2, "ServerCaller",
>>>> "initializeResult", Object(MapResult))
>>>>
>>>> file: 1251 - /var/www/cartoweb3/client/Cartoclient.php
>>>> call: Cartoclient->doMain()
>>>>
>>>> file: 38 - /var/www/cartoweb3/htdocs/client.php
>>>> call: Cartoclient->main()
>>>>
>>>>
>>>>
>>>>
>>>> Oliver Christen wrote / napísal(a):
>>>>> Hello,
>>>>> if I understand correctly whats is happening in the getDsn() function,
>>>>> it seems the parameters should be:
>>>>>
>>>>> dbType = pgsql
>>>>> dsn = user:pass at localhost:5432/gisdata
>>>>>
>>>>> regards
>>>>> Oliver
>>>>>
>>>>> hi,
>>>>>
>>>>> I use this:
>>>>> dbType = db
>>>>> dsn = pgsql://user:pass@localhost:5432/gisdata
>>>>>
>>>>> and here is the error log:
>>>>>
>>>>> Failure
>>>>>
>>>>> CartoWeb version: HEAD [$Revision: 1.5 $]
>>>>> class: CartocommonException
>>>>> message: Either DSN or DB type must be defined
>>>>> Backtrace:
>>>>>
>>>>> file: 267 -
>>>>> /var/www/cartoweb3/projects/wochter/plugins/search/common/Search.php
>>>>> call: DbResultProvider->getDsn()
>>>>>
>>>>> file: 269 -
>>>>> /var/www/cartoweb3/projects/wochter/plugins/search/client/ClientSearch.php
>>>>>
>>>>>
>>>>>
>>>>> call: DbResultProvider->getResult(Object(SearchRequest))
>>>>>
>>>>> file: 265 - /var/www/cartoweb3/client/ClientPluginHelper.php
>>>>> call: ClientSearch->initializeResult(Null)
>>>>>
>>>>> file: UNKNOWN - UNKNOWN
>>>>> call: ServerCallerHelper->initializeResultHelper(Object(ClientSearch),
>>>>> Object(MapResult))
>>>>>
>>>>> file: 267 - /var/www/cartoweb3/common/PluginManager.php
>>>>> call: call_user_func_array(Array(2), Array(2))
>>>>>
>>>>> file: 320 - /var/www/cartoweb3/common/PluginManager.php
>>>>> call: PluginManager->callPluginImplementing(Object(ClientSearch),
>>>>> "ServerCaller", "initializeResult", Array(1))
>>>>>
>>>>> file: 711 - /var/www/cartoweb3/client/Cartoclient.php
>>>>> call: PluginManager->callEnabledPluginsImplementing(2, "ServerCaller",
>>>>> "initializeResult", Array(1))
>>>>>
>>>>> file: 1088 - /var/www/cartoweb3/client/Cartoclient.php
>>>>> call: Cartoclient->callEnabledPluginsImplementing(2, "ServerCaller",
>>>>> "initializeResult", Object(MapResult))
>>>>>
>>>>> file: 1251 - /var/www/cartoweb3/client/Cartoclient.php
>>>>> call: Cartoclient->doMain()
>>>>>
>>>>> file: 38 - /var/www/cartoweb3/htdocs/client.php
>>>>> call: Cartoclient->main()
>>>>>
>>>>>
>>>>> Oliver Christen wrote / napísal(a):
>>>>>> hello,
>>>>>> if you set your project profile to development, you should be able to
>>>>>> see the detail of the error received by ajax (the so called malformed
>>>>>> response).
>>>>>> let me know what the content of the error message, that will help to
>>>>>> know what happened.
>>>>>>
>>>>>> regards
>>>>>> Oliver
>>>>>>
>>>>>> ----- Original Message ----- From: "wochter" <wochter at seznam.cz>
>>>>>> To: "Oliver Christen" <oliver.christen at camptocamp.com>
>>>>>> Sent: Friday, March 09, 2007 1:26 PM
>>>>>> Subject: Re: [Cartoweb-users] search plugin?
>>>>>>
>>>>>>
>>>>>> Ou, thank you, that is what I need.
>>>>>> This plugin in cw3demo uses sqlite db.
>>>>>>
>>>>>> dbType = sqlite
>>>>>> dbFile = "projects/demoCW3/server_conf/demoCW3/sql/airports.db"
>>>>>> encodingContext = searchDb
>>>>>>
>>>>>> Can I use postgres/postgis?
>>>>>>
>>>>>> I tried this:
>>>>>> dbType = db
>>>>>> dsn = pgsql://user:pass@localhost:5432/gisdata
>>>>>>
>>>>>>
>>>>>> Error: AjaxHandler.actionRequest(): received response is malformed!
>>>>>>
>>>>>> How to use it please?
>>>>>>
>>>>>> thanx
>>>>>> wochter
>>>>>>
>>>>>>
>>>>>> Oliver Christen wrote / napísal(a):
>>>>>>> Hi,
>>>>>>> in the lasted cvs version of Cartoweb there is a new search plugin,
>>>>>>> but
>>>>>>> obviously it is designed for generic search. If you want more
>>>>>>> specific
>>>>>>> interface, you will need to extend the plugin to suit your needs.
>>>>>>>
>>>>>>> Regards
>>>>>>> Oliver
>>>>>>>
>>>>>>> ----- Original Message -----
>>>>>>> *From:* Štefan Voskár <mailto:uhabb.voskar at zmail.sk>
>>>>>>> *To:* cartoweb-users at lists.maptools.org
>>>>>>> <mailto:cartoweb-users at lists.maptools.org>
>>>>>>> *Sent:* Thursday, March 08, 2007 8:42 AM
>>>>>>> *Subject:* [Cartoweb-users] search plugin?
>>>>>>>
>>>>>>> I would be pleased at this possibility too...
>>>>>>>
>>>>>>> My vision is:
>>>>>>> step 1: possibility in "SEARCH TAB" to select from drop-down
>>>>>>> menu
>>>>>>> layer of interest
>>>>>>>
>>>>>>> step 2: Its columns wold be loaded on another drop-down..
>>>>>>>
>>>>>>> step 3: possibility to choose =, <, > (for numerics fields) and
>>>>>>> LIKE
>>>>>>> or IS (for text)
>>>>>>>
>>>>>>> step 4: field to enter searched string
>>>>>>>
>>>>>>> ...and result should create table of elements matching selected
>>>>>>> criteria. Some attribute (ID or name...) would be active as
>>>>>>> link to
>>>>>>> recenter it in map window...
>>>>>>>
>>>>>>> If somebody likewise do this job, please help with some tips.
>>>>>>> Thaks
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Cartoweb-users mailing list
>>>>>>> Cartoweb-users at lists.maptools.org
>>>>>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Cartoweb-users mailing list
>>>>>>> Cartoweb-users at lists.maptools.org
>>>>>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
More information about the Cartoweb-users
mailing list