[Geoserver-users] Geoserver environment variables ?

Hi everybody,

Someone knows where could I find the list of environment variables like ${GSUSER,geoserver}.

My version of Geoserver is 2.4.4

Thanks,

Regards,
Kamardine

On Fri, Feb 6, 2015 at 3:21 PM, Kamardine YOUSSOUFA <
Kamardine.YOUSSOUFA@anonymised.com> wrote:

Hi everybody,

Someone knows where could I find the list of environment variables like
${GSUSER,geoserver}.

You mean for the impersonation code paths?
http://docs.geoserver.org/stable/en/user/data/database/sqlsession.html#data-sqlsession

As far as I can see you also have any variable that was put in the &env=...
KVP parameter
(thus, usable only in GET requests), and, strictly limited to the WMS
GetMap calls, also
the following ones (I'm going to paste a code snipped here):

public static void setupEnvironmentVariables(WMSMapContent mapContent) {
        // setup some SLD variable substitution environment used by
rendering transformations
        EnvFunction.setLocalValue("wms_bbox",
mapContent.getRenderingArea());
        EnvFunction.setLocalValue("wms_crs", mapContent.getRenderingArea()
                .getCoordinateReferenceSystem());
        EnvFunction.setLocalValue("wms_srs",
mapContent.getRequest().getSRS());
        EnvFunction.setLocalValue("wms_width", mapContent.getMapWidth());
        EnvFunction.setLocalValue("wms_height", mapContent.getMapHeight());
        try {
            double scaleDenominator = mapContent.getScaleDenominator(true);
            EnvFunction.setLocalValue("wms_scale_denominator",
scaleDenominator);
        } catch (Exception e) {
            LOGGER.log(
                    Level.SEVERE,
                    "Failed to compute the scale denominator,
wms_scale_denominator env variable is unset",
                    e);
        }
    }

That said, the above snippet is valid for GeoServer 2.6.x, it's may not be
available in 2.4.x
(these variables were added to support certain types of rendering
transformations)

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

Hi,
Sorry, but in fact, I just want to know if exist an other variable like GSUSER which can contains a parameter past on request URL.
I would want to use this variable in a sql script of session startup to customize the managing of authorizations on database level.

Thanks.
Kamardine,

···

De : andrea.aime@anonymised.com andrea.aime@anonymised.com de la part de Andrea Aime <andrea.aime@anonymised.com1107…>
Envoyé : vendredi 6 février 2015 18:40
À : Kamardine YOUSSOUFA
Cc : geoserver-users@lists.sourceforge.net
Objet : Re: [Geoserver-users] Geoserver environment variables ?

On Fri, Feb 6, 2015 at 3:21 PM, Kamardine YOUSSOUFA <Kamardine.YOUSSOUFA@anonymised.com> wrote:

Hi everybody,

Someone knows where could I find the list of environment variables like ${GSUSER,geoserver}.

You mean for the impersonation code paths?
http://docs.geoserver.org/stable/en/user/data/database/sqlsession.html#data-sqlsession

As far as I can see you also have any variable that was put in the &env=… KVP parameter

(thus, usable only in GET requests), and, strictly limited to the WMS GetMap calls, also
the following ones (I’m going to paste a code snipped here):

public static void setupEnvironmentVariables(WMSMapContent mapContent) {
// setup some SLD variable substitution environment used by rendering transformations
EnvFunction.setLocalValue(“wms_bbox”, mapContent.getRenderingArea());
EnvFunction.setLocalValue(“wms_crs”, mapContent.getRenderingArea()
.getCoordinateReferenceSystem());
EnvFunction.setLocalValue(“wms_srs”, mapContent.getRequest().getSRS());
EnvFunction.setLocalValue(“wms_width”, mapContent.getMapWidth());
EnvFunction.setLocalValue(“wms_height”, mapContent.getMapHeight());
try {
double scaleDenominator = mapContent.getScaleDenominator(true);
EnvFunction.setLocalValue(“wms_scale_denominator”, scaleDenominator);
} catch (Exception e) {
LOGGER.log(
Level.SEVERE,
“Failed to compute the scale denominator, wms_scale_denominator env variable is unset”,
e);
}
}

That said, the above snippet is valid for GeoServer 2.6.x, it’s may not be available in 2.4.x
(these variables were added to support certain types of rendering transformations)

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


On Mon, Feb 9, 2015 at 6:40 PM, Kamardine YOUSSOUFA <
Kamardine.YOUSSOUFA@anonymised.com> wrote:

Hi,
Sorry, but in fact, I just want to know if exist an other variable like
GSUSER which can contains a parameter past on request URL.

Nope, I've listed all the ones that are currently available in my previous
answer.

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------