[mapserver-users] One template for every text type

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Mon Jul 9 11:05:19 PDT 2012


The QUERYABLE parameter was never implemented so you still must define a layer TEMPLATE to mark a layer as being queryable. The template need not exist so typically I just do:

  TEMPLATE 'void'

The link between layers and OUTPUTFORMAT templates are in the templates themselves via the [resultset] tag.

Steve

From: Andrea Peri [mailto:aperi2007 at gmail.com]
Sent: Monday, July 09, 2012 5:15 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] One template for every text type

Hi Steve,
thx for hint.

I read the doc and also the RFC 36.
I'm having also some doubt.

I try to set this output format:

  OUTPUTFORMAT
    NAME "delimitazione_fogli_xml"
    MIMETYPE "text/xml"
    DRIVER "TEMPLATE"
    FORMATOPTION "FILE=/pat-to-ex-template-on-layer-level/template_xml.tmpl"
  END

  at WEB level I set this value:
WEB
   METADATA
      "wms_feature_info_mime_type" "text/xml"
   END
END

And how explained from RFC I comment the template from layer level and try to add the tag
QUERYABLE TRUE
(But this option seem to be not supported from MapServer 6.2 trunk)

If I remove the template tag from layer level I have this error:

msWMSFeatureInfo(): WMS server error. Requested layer(s) are not queryable.

And if I try to add the QUERYABLE TRUE tag I have
this error:

>Unknown identifier. Parsing error near (QUERYABLE)

So I need to maintain the template ad Layer level. This force the layer to use the template from that tag instead of the tag from FORMATOPTION.

Also I don't understand how to link the specific format option the a specific layer.

Thx,

Andrea.

2012/7/6 Lime, Steve D (DNR) <Steve.Lime at state.mn.us<mailto:Steve.Lime at state.mn.us>>
Hi Andrea: You can define multiple output formats that use the template driver. They can each have different names and mime-types. You can even use mime subtypes if you needed, say, two XML formats. The MapServer CGI supports a parameter called qformat that allows you to change the query template to be used. I'm not sure how this works with WFS, probably via mime-type.

Steve

From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org>] On Behalf Of Andrea Peri
Sent: Tuesday, July 03, 2012 5:42 PM
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: [mapserver-users] One template for every text type

Hi,

As report from documentation, MapServer will allow to define a template to set the return from an identify.

I need to define almost two distinct kind of returns:
One for user (text/plain or text/html) and one for business application (text/xml).

So I like to define not only a template for return an XML but also a template for return an html page.

I don't know how to say to MapServer what template us for text/html and what for text/xml.

Is this possibile ?

Thx.

--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120709/713950a0/attachment.html>


More information about the mapserver-users mailing list