Dear Thomas,

Now it works!

I am aware that the bugreport with the countries shape layer does´nt make any 
sense
but with a postgis layer you can do nice configurations in search.xml with an 
option field (kg)
and an input field (gstnr) and there values are concatenated in the select 
string

<!-- ms POSTGIS layer search kgnr inline option gstnr sql -->

    <searchitem name="kg_inline_options_gstnr_pg" description="Grundstück">
        <layer type="postgis" name="grundstuecksflaechen">
        <field type="s" name="kg" description="KG:" >
              <definition type="options" connectiontype="inline" 
firstoption="0" >
                 <option name="92001" value="92001"/>
                 <option name="92002" value="92002"/>
                 <option name="92003" value="92003"/>
              </definition>
        </field>
        <field type="s" name="gstnr" description="Gstnr:" />
        <sql_from>grundstuecksflaechen</sql_from>
        <sql_where>label='[kg]'||'[gstnr]'</sql_where>
        </layer>
    </searchitem>

the message in pm_debug.log is then

[08-May-2009 17:28:32] P.MAPPER debug info 
Searcharray in search.php->getSearchParameters() 
 Array
(
    [kg] => 92001
    [gstnr] => 7382
    [mode] => search
    [PHPSESSID] => f40b49a429d2c6fd5b62613641f8fb30
)

[08-May-2009 17:28:32] P.MAPPER debug info 
Parameters for searchArray 
file: query.php->q_execAttributeQuery 

 Array
(
    [kg] => 92001
    [gstnr] => 7382
    [mode] => search
    [PHPSESSID] => f40b49a429d2c6fd5b62613641f8fb30
)

[08-May-2009 17:28:32] P.MAPPER debug info 
Parameters for searchParams 
file: query.php->q_execAttributeQuery
 Array
(
    [layerName] => grundstuecksflaechen
    [layerType] => postgis
    [firstFld] => kg
    [qStr] => label='92001'||'7382'
)

[08-May-2009 17:28:32] P.MAPPER debug info 
P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
 SELECT gid, 
                         xmin(box3d(the_geom)), 
                         ymin(box3d(the_geom)), 
                         xmax(box3d(the_geom)), 
                         ymax(box3d(the_geom)), 
                         gid,label 
                    FROM grundstuecksflaechen 
                   WHERE label='92001'||'7382'
                   LIMIT 301

In this case it is important not to set the wildcard attribute in the field 
element.
If you set for instance wildcard="2" in the field element, [qStr] will result in
[qStr] => label='^92001$'||'^7382$' 

Thanks for the help ! 

Karl 

-----Ursprüngliche Nachricht-----
Von: Thomas Raffin [mailto:traf...@sirap.fr] 
Gesendet: Donnerstag, 07. Mai 2009 10:04
An: Hermann Karl
Cc: pmapper-users@lists.sourceforge.net
Betreff: Re: [pmapper-users] Problem with elements sql_from and sql_where in 
search.xml

Hello,

The <sql_where> seems to be unused. If you want to specify the where clause in 
the <sql_where>, you have to modify the 'pmapper-dir/incphp/query/search.php' 
file and replace "return $sql_where"
 with
"$qs = $sql_where".

Thomas

Hermann Karl a écrit :
> Dear List,
>
> searchitem in the file "search.xml"
> .......
> .......
>    <searchitem name="countries_sql" description="Country_sql">
>         <layer type="shape" name="countries">
>               <field type="s" name="ISO2_CODE" description="Country"
> wildcard="2" />
>                 <sql_from>countries</sql_from>
>                 <sql_where>ISO2_CODE="[ISO2_CODE]"</sql_where>
>       </layer>
>     </searchitem>
> .....
> .....
>
> the result is an error message in pm_debug.log
>
> [06-May-2009 18:42:25] P.MAPPER debug info Searcharray in 
> search.php->getSearchParameters()  Array (
>     [ISO2_CODE] => AT
>     [mode] => search
>     [PHPSESSID] => 2f37d01495a7c65ffbc5349808adef09
> )
>
> [06-May-2009 18:42:25] P.MAPPER debug info Parameters for searchArray
> file: query.php->q_execAttributeQuery
>
>  Array
> (
>     [ISO2_CODE] => AT
>     [mode] => search
>     [PHPSESSID] => 2f37d01495a7c65ffbc5349808adef09
> )
>
> [06-May-2009 18:42:25] P.MAPPER debug info Parameters for searchParams
> file: query.php->q_execAttributeQuery
>  ISO2_CODE="^AT$"
>
> any idea whats wrong ?
>
>
> Thanks
>
> Karl
>
>
> ----------------------------------------------------------------------
> -------- The NEW KODAK i700 Series Scanners deliver under ANY 
> circumstances! Your production scanning environment may not be a 
> perfect world - but thanks to Kodak, there's a perfect scanner to get 
> the job done! With the NEW KODAK i700 Series Scanner you'll get full 
> speed at 300 dpi even with all image processing features enabled. 
> http://p.sf.net/sfu/kodak-com 
> _______________________________________________
> pmapper-users mailing list
> pmapper-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
>
>
>
>
>   

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to