[Qgis-developer] URL Rewriting and qgis-web-client

2013-02-26 Thread Emilio Loi
Hi everybody, I hope you can help me.
I'm trying to enable URL Rewriting in Qgis-web-client as described at point
5 of the configuration guide (https://github.com/qgis/qgis-web-client)
I'm using this rule:

RewriteRule wms/([^/]+)$
cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs

It works well: when I browse http://THE_HOST/wms/example on firefox the
server returns the cgi script result whit parameter
map=/var/www/.../example.qgs
Then I've set

var serverAndCGI = "http://THE_HOST/wms/";

in GlobalOptions.js instead of the full url.

The problem shows up when Qgis-web-client trys to use the cgi script:
instead of call /wms/example/?params it calls /wms/NOTHING/?params. (as you
can see)

[16:09:20.950] GET
http://THE_HOST/wms//?&_dc=1361891360854&SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings[HTTP/1.1
404 Not Found 126ms]

What am I forgetting to configure?
Thanks in advance.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] URL Rewriting and qgis-web-client

2013-02-26 Thread Emilio Loi
Thanks for your answer.
First, I'd corrected serverAndCGI value.

Without any redirect rule all works perfectly.
Currently I have only one RedirectRule that redirects any
*/wms/project*request to
*qgis_mapserv.fcgi* script),

 
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
RewriteEngine On
RewriteRule wms/([^/]+)$
http://vega.faunalia.it/cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs[QSA,L]

  


so I access to QGIS web client at this url (the actual one):

http://vega.faunalia.it/qgis-web-client/site/qgiswebclient.html?map=/var/www/qgis-web-client/projects/candela.qgs


Is it correct? It has full project path with project name in *map* request
parameter.
Bye,


2013/2/26 Andreas Neumann 

> Hi,
>
> You always have to specify a project path and project name with QGIS web
> client. Regardless whether you use URL rewriting or not. The client does
> not work without project path and name.
>
> So a correct URL to start the client would be:
>
> http://hostname/maps/projectpath/projectname?optionalParameters
>
> Of course this all depends on your setup.
>
> This whole URL rewriting is a bit complex to set up. Before you do it I
> would recommend you test the client without URL rewriting, e.g. with a
> URL like:
>
>
> http://hostname/qgiswebclient.html?map=/home/web/qgis-web-client/projects/naturalearth_110million.qgs&format=image/png&visibleLayers=Rivers,Glaciated%20Areas,Lakes,Land,Ocean
>
> For 'var serverAndCGI = "http://THE_HOST/wms/";' I recommend to not
> specify the servername, in case you move the whole thing to another
> server. Better would be:
>
> var serverAndCGI = "/wms/"
>
> Hope this helps a bit?
>
> Andreas
>
>
> Am 26.02.2013 16:33, schrieb Emilio Loi:
> > Hi everybody, I hope you can help me.
> > I'm trying to enable URL Rewriting in Qgis-web-client as described at
> point
> > 5 of the configuration guide (https://github.com/qgis/qgis-web-client)
> > I'm using this rule:
> >
> > RewriteRule wms/([^/]+)$
> > cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs
> >
> > It works well: when I browse http://THE_HOST/wms/example on firefox the
> > server returns the cgi script result whit parameter
> > map=/var/www/.../example.qgs
> > Then I've set
> >
> > var serverAndCGI = "http://THE_HOST/wms/";
> >
> > in GlobalOptions.js instead of the full url.
> >
> > The problem shows up when Qgis-web-client trys to use the cgi script:
> > instead of call /wms/example/?params it calls /wms/NOTHING/?params. (as
> you
> > can see)
> >
> > [16:09:20.950] GET
> >
> http://THE_HOST/wms//?&_dc=1361891360854&SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings[HTTP/1.1
> > 404 Not Found 126ms]
> >
> > What am I forgetting to configure?
> > Thanks in advance.
> >
> >
> >
> > ___
> > Qgis-developer mailing list
> > Qgis-developer@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] URL Rewriting and qgis-web-client

2013-02-26 Thread Emilio Loi
Ok, now I have one rule for wms

RewriteRule ^wms/([^/]+)$
> /cgi-bin/qgis_mapserv.fcgi?map=/path-to-projects/$1.qgs [QSA,PT,L]

(it works, you can see it in action here
http://vega.faunalia.it/wms/candela?REQUEST=GetCapabilities)

one to have a short url with the project name

RewriteRule ^maps/([^./]+)/?$
> /path-to-qgiswc/qgiswebclient.html?map=/path-to-projects/$1.qgs [PT,L]


and one for html/js/css

RewriteRule ^maps/(.*) /path-to-qgiswc/$1 [PT]


running the webapp with an example project I get an error about some
not-well-specified missing parameters (i think the only one is missing is
the project full path)
you can try here:

http://vega.faunalia.it/maps/candela


Do you think my rewrite engine configuration is right or not?
Goodnight,


2013/2/26 Andreas Neumann 

> Hi,
>
> If you do the redirects, I recommend to always do two redirects:
>
> * one for the WMS
> * one for the HTML/JSS/CSS files
>
> Here is what I use (modified to hide my paths):
>
> 
>
> #Rewrite Rules for QGIS webclient
> # Map /wms to qgis_mapserv.fcgi
> RewriteEngine On
> RewriteLog /var/log/apache2/webgis_rewrite.log
> RewriteLogLevel 0
>  #handle WMS requests to QGIS server
> RewriteRule ^/wms/(.+)$
> /cgi-bin/qgis_mapserv.fcgi?map=/www/projects/$1.qgs [QSA,PT,L]
> # Map /maps to /qgis-web-client
> # First handle the mapping of the starting html file - works for 1 to 7
> levels
> RewriteRule ^/maps/([^/.]+/{0,1}){1,7}$
> /qgis-web-client/qgiswebclient.html [PT,L]
>
> Hope this helps?
>
> Andreas
>
>
> Am 26.02.2013 17:32, schrieb Emilio Loi:
> > Thanks for your answer.
> > First, I'd corrected serverAndCGI value.
> >
> > Without any redirect rule all works perfectly.
> > Currently I have only one RedirectRule that redirects any
> > */wms/project*request to
> > *qgis_mapserv.fcgi* script),
> >
> >  
> > Options Indexes FollowSymLinks MultiViews
> > AllowOverride all
> > Order allow,deny
> > allow from all
> > RewriteEngine On
> > RewriteRule wms/([^/]+)$
> >
> http://vega.faunalia.it/cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs[QSA,L]
> >
> >   
> >
> >
> > so I access to QGIS web client at this url (the actual one):
> >
> >
> http://vega.faunalia.it/qgis-web-client/site/qgiswebclient.html?map=/var/www/qgis-web-client/projects/candela.qgs
> >
> >
> > Is it correct? It has full project path with project name in *map*
> request
> > parameter.
> > Bye,
> >
> >
> > 2013/2/26 Andreas Neumann 
> >
> >> Hi,
> >>
> >> You always have to specify a project path and project name with QGIS web
> >> client. Regardless whether you use URL rewriting or not. The client does
> >> not work without project path and name.
> >>
> >> So a correct URL to start the client would be:
> >>
> >> http://hostname/maps/projectpath/projectname?optionalParameters
> >>
> >> Of course this all depends on your setup.
> >>
> >> This whole URL rewriting is a bit complex to set up. Before you do it I
> >> would recommend you test the client without URL rewriting, e.g. with a
> >> URL like:
> >>
> >>
> >>
> http://hostname/qgiswebclient.html?map=/home/web/qgis-web-client/projects/naturalearth_110million.qgs&format=image/png&visibleLayers=Rivers,Glaciated%20Areas,Lakes,Land,Ocean
> >>
> >> For 'var serverAndCGI = "http://THE_HOST/wms/";' I recommend to not
> >> specify the servername, in case you move the whole thing to another
> >> server. Better would be:
> >>
> >> var serverAndCGI = "/wms/"
> >>
> >> Hope this helps a bit?
> >>
> >> Andreas
> >>
> >>
> >> Am 26.02.2013 16:33, schrieb Emilio Loi:
> >>> Hi everybody, I hope you can help me.
> >>> I'm trying to enable URL Rewriting in Qgis-web-client as described at
> >> point
> >>> 5 of the configuration guide (https://github.com/qgis/qgis-web-client)
> >>> I'm using this rule:
> >>>
> >>> RewriteRule wms/([^/]+)$
> >>> cgi-bin/qgis_mapserv.fcgi?map=/var/www/qgis-web-client/projects/$1.qgs
> >>>
> >>> It works well: when I browse http://THE_HOST/wms/example on firefox
> the
> >>> server returns the cgi script result whit parameter
> >>> map=/var/www/.../example.qgs
> >>> Then I've set
> >>>
> >>> var serverAndCGI =

[Qgis-developer] Qgis-Web-Client Search

2013-03-18 Thread Emilio Loi
Hi to all,
I was configuring search panel in qgis-web-cilent following the readmin you
can find on gh

https://github.com/qgis/qgis-web-client

I noticed that search panels are configured statically in GlobalOptions.js
declaring vars as following

var simpleWmsSearch =  {
 /* ... */
  formItems: [
{
 /* ... */
  fieldLabel: "fieldname",
}
  ],
  /*... */
  selectionLayer: 'layername',
};

var mapSearchPanelConfigs = {
  "projectname": [simpleWmsSearch]
};

It's ok for a limited number of projects, but what if I wish to make it
indipendent from projects? (so I can have a search panel for any project I
have on the server without touch GlobalOptions.js).
Is there any way to do this dynamically in qgis-web-client or it needs to
be implemented?

Thanks,
-- 
Emilio Loi
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] apply() in saveStyleAs()

2013-04-12 Thread Emilio Loi
Hi, I noticed this statement in QgsVectorLayerProperties::saveStyleAs()
method

apply(); // make sure the style to save is uptodate

just after the file dialog launch.
So, every time you want to export a style to a file, qgis applies it to the
layer, losing precedent applied style.
But if the statement is removed, qgis simply crashs :) but I didn't managed
why (in QgsRendererRangeV2::symbol() method).
I'm using part of saveStyleAs() (and related) code to create a qml style
and save it into a postgis db.
Is it so important to apply the style before saving it? Is there any way to
save avoiding to apply?

Thanks,

Emilio Loi - l...@faunalia.it
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Null feature is added using a custom UI

2013-05-07 Thread Emilio Loi
Hi to all,
when I add a new feature to a vector layer (from file) using a custom UI
file ("Attribute editor layout" set to "Provide ui-file") a new row full of
NULL values is added to Attribute Tables. It doesn't happen with an
autogenerated UI.
The ui file is correct.
QGIS is 1.9.0 rev 12b39d6
Does it happen only to me?

Regards,

Emilio Loi - l...@faunalia.it
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer