Skip to content

Commit

Permalink
Added QUERYFORMAT to the webObj and updated the template code to use …
Browse files Browse the repository at this point in the history
…it. It basically allows you to specify the MIME type of any query output. It's a bandaid though. I really prefer Frank's outputFormatObj, but mapoutput.c needs to be generalized a bit. Perhaps for 4.2.

git-svn-id: http://svn.osgeo.org/mapserver/trunk@2532 7532c77e-422f-0410-93f4-f0b67bdd69e2
  • Loading branch information
sdlime committed Nov 11, 2003
1 parent 2f82670 commit 50593ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion map.h
Expand Up @@ -380,7 +380,7 @@ typedef struct {
double minscale, maxscale;
char *mintemplate, *maxtemplate;

char *queryformat; // what format is the query to be returned (e.g. HTML, SVG, ...), given as the name of an output format
char *queryformat; // what format is the query to be returned, given as a MIME type

#ifndef SWIG
hashTableObj metadata;
Expand Down
2 changes: 1 addition & 1 deletion mapfile.c
Expand Up @@ -3532,7 +3532,7 @@ void initWeb(webObj *web)
web->imageurl = strdup("");
web->metadata = NULL;
web->map = NULL;
web->queryformat = NULL;
web->queryformat = strdup("text/html");
}

void freeWeb(webObj *web)
Expand Down
4 changes: 2 additions & 2 deletions mapserv.c
Expand Up @@ -1028,7 +1028,7 @@ int main(int argc, char *argv[]) {
writeError();

if(QueryFile) {
if (msReturnQuery(msObj, "text/html", NULL) != MS_SUCCESS)
if (msReturnQuery(msObj, msObj->Map->web.queryformat, NULL) != MS_SUCCESS)
writeError();
} else {
if(TEMPLATE_TYPE(msObj->Map->web.template) == MS_FILE) { /* if thers's an html template, then use it */
Expand Down Expand Up @@ -1329,7 +1329,7 @@ int main(int argc, char *argv[]) {

}
else { // process the query through templates
if (msReturnTemplateQuery(msObj, "text/html", NULL) != MS_SUCCESS) writeError();
if (msReturnTemplateQuery(msObj, msObj->Map->web.queryformat, NULL) != MS_SUCCESS) writeError();

if(msObj->SaveQuery) {
sprintf(buffer, "%s%s%s%s", msObj->Map->web.imagepath, msObj->Map->name, msObj->Id, MS_QUERY_EXTENSION);
Expand Down

0 comments on commit 50593ba

Please sign in to comment.