[mapserver-commits] r13119 - in trunk/mapserver/tinyows: . src/ows src/wfs

svn at osgeo.org svn at osgeo.org
Wed Feb 8 20:29:24 EST 2012


Author: colivier
Date: 2012-02-08 17:29:24 -0800 (Wed, 08 Feb 2012)
New Revision: 13119

Modified:
   trunk/mapserver/tinyows/config.xml
   trunk/mapserver/tinyows/src/ows/ows_config.c
   trunk/mapserver/tinyows/src/ows/ows_get_capabilities.c
   trunk/mapserver/tinyows/src/ows/ows_metadata.c
   trunk/mapserver/tinyows/src/wfs/wfs_get_capabilities.c
Log:
metadata contact and server fixes
ol | 2007-09-26 15:05:45 +0200 (Wed, 26 Sep 2007)

Modified: trunk/mapserver/tinyows/config.xml
===================================================================
--- trunk/mapserver/tinyows/config.xml	2012-02-09 01:29:15 UTC (rev 13118)
+++ trunk/mapserver/tinyows/config.xml	2012-02-09 01:29:24 UTC (rev 13119)
@@ -1,110 +1,80 @@
-<!-- TinyOWS' configuration -->
+<!-- TinyOWS WFS OGC TEST configuration -->
 <tinyows>
+
 <!-- metadata about the organization operating the server -->
+
+ <metadata
+   name="TinyOWS"
+   title="TinyOWS Service"
+   keywords="tinyows,ows,wfs,ogc"
+   online_resource="http://www.tinyows.org/"
+   fees="free"
+   access_constraint="nope" >
+   <abstract>
+    Here a text abstract related to the service...
+   </abstract>
    <contact
-   name="Camptocamp"
-   site="http://camptocamp.com"
-   individual_name="Barbara Philippot"
-   position="stagiaire"
-   phone="04.79.00.00.00"
-   address="Savoie Technolac, le Square, bat.Suroit"
-   postcode="73370"
-   city="Le Bourget du Lac"
-   country="France"
-   email="barbara.philippot at camptocamp.com" />
+     name="Camptocamp"
+     site="http://www.camptocamp.com/"
+     individual_name="Barbara Philippot"
+     position="Developper"
+     phone="+33 (0)4.79.44.44.94"
+     address="Savoie Technolac, BP 352"
+     postcode="73370"
+     city="Le Bourget du Lac"
+     country="France"
+     email="barbara.philippot at camptocamp.com" />
+ </metadata>
+
 <!-- limits of the service -->
   <limits 
     layers="12" 
-    features="500" 
+    features="1000"
     width="800"  
     height="600" 
- />
+   />
+
 <!-- information about database connection  -->
   <pg 
     host="127.0.0.1" 
     user="postgres" 
     password="postgres" 
-    dbname="base_spatiale" 
+    dbname="tinyows_test" 
     port="5432" />
-<!-- information about SLD  -->
-  <style sld="url_or_filepath" writable="bool" />
+
 <!-- layers' definition  -->
-  <layer name="root" title="root" srid="4326" queryable="1" retrievable ="1" writable ="1">
- <layer name="mydata" title="mydata" geobbox="-180,20,180,60" prefix="tinyows" srid="27561" server="http://dev.camptocamp.com/~tinyows/ows">
-    <layer 
-      name="us_lakes"
-      title="USA lakes"
-      opaque="0" />
-    <layer name="group" title="group">
-      <layer 
-        name="us_urban_areas"
-        title="USA urban areas" />
-      <layer 
-        name="us_states"
-        title="USA states" />
+  <layer name="root" title="root" srid="4326" 
+         queryable="1" retrievable ="1" writable ="1">
+
+    <layer name="OGCfeatures" title="OGCfeatures" prefix="cdf" 
+           server="http://www.opengis.net/cite/data" srid="32615">
+       <layer name="Nulls" title="Nulls" />
+       <layer name="Seven" title="Seven" />
+       <layer name="Fifteen" title="Fifteen" />
+       <layer name="Other" title="Other" />
+       <layer name="Inserts" title="Inserts" />
+       <layer name="Updates" title="Updates" />
+       <layer name="Deletes" title="Deletes" />
+       <layer name="Locks" title="Locks" />
     </layer>
-    <layer 
-      name="us_interstate"
-      title="USA interstate" 
-      />
-</layer>
- <layer name="OGCfeatures" title="OGCfeatures" prefix="cdf" server="http://www.opengis.net/cite/data" srid="32615">
-       <layer 
-        name="Nulls"
-        title="Nulls" />
-<layer 
-        name="Seven"
-        title="Seven" />
-<layer 
-        name="Fifteen"
-        title="Fifteen" />
-<layer 
-        name="Other"
-        title="Other" />
-<layer 
-        name="Inserts"
-        title="Inserts" />
-<layer 
-        name="Updates"
-        title="Updates" />
-<layer 
-        name="Deletes"
-        title="Deletes" />
-<layer 
-        name="Locks"
-        title="Locks" />
-</layer>
- <layer name="OGCgeometries" title="OGCgeometries" prefix="cgf" server="http://www.opengis.net/cite/geometry" srid="32615" >
- <layer 
-        name="Points"
-        title="Points" />
-<layer 
-        name="Lines"
-        title="Lines" />
-<layer 
-        name="Polygons"
-        title="Polygons" />
-<layer 
-        name="MPoints"
-        title="MPoints" />
-<layer 
-        name="MLines"
-        title="MLines" />
-<layer 
-        name="MPolygons"
-        title="MPolygons" />
-</layer>
- <layer name="SimpleFeatures" title="features110" prefix="sf" server="http://cite.opengeospatial.org/gmlsf" >
-<layer 
-        name="AggregateGeoFeature"
-        title="AggregateGeoFeature" />
-<layer 
-        name="EntitéGénérique"
-        title="EntitéGénérique" />
-<layer 
-        name="PrimitiveGeoFeature"
-        title="PrimitiveGeoFeature" />
- </layer>
+
+    <layer name="OGCgeometries" title="OGCgeometries" prefix="cgf" 
+           server="http://www.opengis.net/cite/geometry" srid="32615" >
+       <layer name="Points" title="Points" />
+       <layer name="Lines" title="Lines" />
+       <layer name="Polygons" title="Polygons" />
+       <layer name="MPoints" title="MPoints" />
+       <layer name="MLines" title="MLines" />
+       <layer name="MPolygons" title="MPolygons" />
+    </layer>
+
+    <layer name="SimpleFeatures" title="features110" prefix="sf" 
+           server="http://cite.opengeospatial.org/gmlsf" >
+      <layer name="AggregateGeoFeature" title="AggregateGeoFeature" />
+      <layer name="EntitéGénérique" title="EntitéGénérique" />
+      <layer name="PrimitiveGeoFeature" title="PrimitiveGeoFeature" />
+    </layer>
+
   </layer>
 
 </tinyows>

Modified: trunk/mapserver/tinyows/src/ows/ows_config.c
===================================================================
--- trunk/mapserver/tinyows/src/ows/ows_config.c	2012-02-09 01:29:15 UTC (rev 13118)
+++ trunk/mapserver/tinyows/src/ows/ows_config.c	2012-02-09 01:29:24 UTC (rev 13119)
@@ -35,14 +35,12 @@
 void ows_parse_config_contact(ows * o, xmlTextReaderPtr r)
 {
 	xmlChar *a;
-	buffer *b;
 	ows_contact *contact;
 
 	assert(o != NULL);
 	assert(r != NULL);
 
 	contact = ows_contact_init();
-	b = buffer_init();
 
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "name");
 	if (a != NULL)
@@ -166,12 +164,94 @@
 	}
 
 	o->contact = contact;
+}
 
-	buffer_free(b);
+
+/* 
+ * Parse the configuration file's metadata element
+ */
+void ows_parse_config_metadata(ows * o, xmlTextReaderPtr r)
+{
+	xmlChar *a;
+
+	assert(o != NULL);
+	assert(r != NULL);
+
+	o->metadata = ows_metadata_init();
+
+	a = xmlTextReaderGetAttribute(r, (xmlChar *) "name");
+	if (a != NULL)
+	{
+		o->metadata->name = buffer_init();
+		buffer_add_str(o->metadata->name, (char *) a);
+		free(a);
+	}
+
+	a = xmlTextReaderGetAttribute(r, (xmlChar *) "title");
+	if (a != NULL)
+	{
+		o->metadata->title = buffer_init();
+		buffer_add_str(o->metadata->title, (char *) a);
+		free(a);
+	}
+    
+	a = xmlTextReaderGetAttribute(r, (xmlChar *) "keywords");
+	if (a != NULL)
+	{
+        o->metadata->keywords = list_explode_str(',', (char *) a);
+		free(a);
+	}
+
+	a = xmlTextReaderGetAttribute(r, (xmlChar *) "online_resource");
+	if (a != NULL)
+	{
+		o->metadata->online_resource = buffer_init();
+		buffer_add_str(o->metadata->online_resource, (char *) a);
+		free(a);
+	}
+    
+	a = xmlTextReaderGetAttribute(r, (xmlChar *) "fees");
+	if (a != NULL)
+	{
+		o->metadata->fees = buffer_init();
+		buffer_add_str(o->metadata->fees, (char *) a);
+		free(a);
+	}
+    
+	a = xmlTextReaderGetAttribute(r, (xmlChar *) "access_constraints");
+	if (a != NULL)
+	{
+		o->metadata->access_constraints = buffer_init();
+		buffer_add_str(o->metadata->access_constraints, (char *) a);
+		free(a);
+	}
 }
 
 
 /* 
+ * Parse the configuration file's abstract metadata element
+ */
+void ows_parse_config_abstract(ows * o, xmlTextReaderPtr r)
+{
+	xmlChar *v;
+
+	assert(o != NULL);
+	assert(o->metadata != NULL);
+	assert(r != NULL);
+
+    /* FIXME should use XmlTextReader expand on metadata parent */
+	xmlTextReaderRead(r);
+	v = xmlTextReaderValue(r);
+	if (v != NULL)
+	{
+		o->metadata->abstract = buffer_init();
+		buffer_add_str(o->metadata->abstract, (char *) v);
+		free(v);
+    }
+}
+
+
+/* 
  * Parse the configuration file's limits element
  */
 void ows_parse_config_limits(ows * o, xmlTextReaderPtr r)
@@ -259,6 +339,7 @@
 		free(a);
 	}
 	while (xmlTextReaderMoveToNextAttribute(r) == 1);
+    buffer_pop(b,1); /* remove unused last space */
 
 	o->pg_dsn = b;
 }
@@ -342,7 +423,8 @@
 		buffer_free(b);
 	}
 
-	/* inherits from layer parent and replaces with specified value if defined */
+	/* inherits from layer parent and replaces with specified value 
+       if defined */
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "queryable");
 	if (a != NULL && atoi((char *) a) == 1)
 	{
@@ -355,7 +437,8 @@
 	else
 		free(a);
 
-	/* inherits from layer parent and replaces with specified value if defined */
+	/* inherits from layer parent and replaces with specified value 
+       if defined */
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "retrievable");
 	if (a != NULL && atoi((char *) a) == 1)
 	{
@@ -368,7 +451,8 @@
 	else
 		free(a);
 
-	/* inherits from layer parent and replaces with specified value if defined */
+	/* inherits from layer parent and replaces with specified value
+       if defined */
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "writable");
 	if (a != NULL && atoi((char *) a) == 1)
 	{
@@ -381,7 +465,8 @@
 	else
 		free(a);
 
-	/* inherits from layer parent and replaces with specified value if defined */
+	/* inherits from layer parent and replaces with specified value
+       if defined */
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "opaque");
 	if (a != NULL && atoi((char *) a) == 1)
 	{
@@ -434,7 +519,8 @@
 		list_free(l);
 	}
 
-	/* inherits from layer parent and replaces with specified value if defined */
+	/* inherits from layer parent and replaces with specified value
+       if defined */
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "geobbox");
 	if (a != NULL)
 	{
@@ -454,7 +540,8 @@
 	else
 		free(a);
 
-	/* inherits from layer parent and replaces with specified value if defined */
+	/* inherits from layer parent and replaces with specified value
+       if defined */
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "prefix");
 	if (a != NULL)
 	{
@@ -471,7 +558,8 @@
 	else
 		free(a);
 
-	/* inherits from layer parent and replaces with specified value if defined */
+	/* inherits from layer parent and replaces with specified value
+       if defined */
 	a = xmlTextReaderGetAttribute(r, (xmlChar *) "server");
 	if (a != NULL)
 	{
@@ -552,6 +640,12 @@
 		{
 			name = xmlTextReaderConstLocalName(r);
 
+			if (strcmp((char *) name, "metadata") == 0)
+				ows_parse_config_metadata(o, r);
+
+			if (strcmp((char *) name, "abstract") == 0)
+				ows_parse_config_abstract(o, r);
+
 			if (strcmp((char *) name, "contact") == 0)
 				ows_parse_config_contact(o, r);
 
@@ -578,7 +672,6 @@
 
 	xmlFreeTextReader(r);
 	xmlCleanupParser();
-
 }
 
 

Modified: trunk/mapserver/tinyows/src/ows/ows_get_capabilities.c
===================================================================
--- trunk/mapserver/tinyows/src/ows/ows_get_capabilities.c	2012-02-09 01:29:15 UTC (rev 13118)
+++ trunk/mapserver/tinyows/src/ows/ows_get_capabilities.c	2012-02-09 01:29:24 UTC (rev 13119)
@@ -86,7 +86,7 @@
 		for (ln = o->metadata->keywords->first; ln->next != NULL;
 		   ln = ln->next)
 			fprintf(o->output, "%s,", ln->value->buf);
-		fprintf(o->output, "%s </Keywords>\n", ln->value->buf);
+		fprintf(o->output, "%s</Keywords>\n", ln->value->buf);
 	}
 
 	fprintf(o->output, "  <OnlineResource>%s</OnlineResource>\n",
@@ -132,13 +132,10 @@
 
 	if (o->metadata->keywords != NULL)
 	{
-		fprintf(o->output, "  <ows:Keywords>");
+		fprintf(o->output, "  <ows:Keywords>\n");
 		for (ln = o->metadata->keywords->first; ln != NULL; ln = ln->next)
-		{
-			fprintf(o->output, "  <ows:Keyword>");
-			fprintf(o->output, "%s", ln->value->buf);
-			fprintf(o->output, "  </ows:Keyword>");
-		}
+			fprintf(o->output, "   <ows:Keyword>%s</ows:Keyword>\n",
+                    ln->value->buf);
 		fprintf(o->output, "  </ows:Keywords>\n");
 	}
 
@@ -152,7 +149,7 @@
 		if (ln->next != NULL)
 			fprintf(o->output, ",");
 	}
-	fprintf(o->output, "  </ows:ServiceTypeVersion>\n");
+	fprintf(o->output, "</ows:ServiceTypeVersion>\n");
 
 	if (o->metadata->fees != NULL)
 		fprintf(o->output, "  <ows:Fees>%s</ows:Fees>\n",
@@ -169,7 +166,7 @@
 
 /*
  * Provides metadata about the organisation operating the server
- * Assume that provuider name figures in the metadata
+ * Assume that provider name figures in the metadata
  * Used for version 1.1.0 de WFS GetCapabilities
  */
 void ows_service_provider(const ows * o)
@@ -186,12 +183,12 @@
 		fprintf(o->output, "  <ows:ProviderSite xlink:href=\"%s\" />\n",
 		   o->contact->site->buf);
 
-	fprintf(o->output, "<ows:ServiceContact>");
+	fprintf(o->output, "  <ows:ServiceContact>\n");
 	if (o->contact->indiv_name != NULL)
-		fprintf(o->output, "<ows:IndividualName>%s</ows:IndividualName>",
+		fprintf(o->output, "   <ows:IndividualName>%s</ows:IndividualName>\n",
 		   o->contact->indiv_name->buf);
 	if (o->contact->position != NULL)
-		fprintf(o->output, "<ows:PositionName>%s</ows:PositionName>",
+		fprintf(o->output, "   <ows:PositionName>%s</ows:PositionName>\n",
 		   o->contact->position->buf);
 
 	if (o->contact->phone != NULL
@@ -205,18 +202,18 @@
 	   || o->contact->online_resource != NULL
 	   || o->contact->hours != NULL || o->contact->instructions != NULL)
 	{
-		fprintf(o->output, "<ows:ContactInfo>");
+		fprintf(o->output, "   <ows:ContactInfo>\n");
 
 		if (o->contact->phone != NULL || o->contact->fax != NULL)
 		{
-			fprintf(o->output, "<ows:Phone>");
+			fprintf(o->output, "    <ows:Phone>\n");
 			if (o->contact->phone != NULL)
-				fprintf(o->output, "<ows:Voice>%s</ows:Voice>",
+				fprintf(o->output, "     <ows:Voice>%s</ows:Voice>\n",
 				   o->contact->phone->buf);
 			if (o->contact->fax != NULL)
-				fprintf(o->output, "<ows:Facsimile>%s</ows:Facsimile>",
+				fprintf(o->output, "     <ows:Facsimile>%s</ows:Facsimile>\n",
 				   o->contact->fax->buf);
-			fprintf(o->output, "</ows:Phone>");
+			fprintf(o->output, "    </ows:Phone>\n");
 		}
 
 		if (o->contact->address != NULL
@@ -225,47 +222,47 @@
 		   || o->contact->state != NULL
 		   || o->contact->country != NULL || o->contact->email != NULL)
 		{
-			fprintf(o->output, "<ows:Address>");
+			fprintf(o->output, "    <ows:Address>\n");
 			if (o->contact->address != NULL)
 				fprintf(o->output,
-				   "<ows:DeliveryPoint>%s</ows:DeliveryPoint>",
+				   "     <ows:DeliveryPoint>%s</ows:DeliveryPoint>\n",
 				   o->contact->address->buf);
 			if (o->contact->city != NULL)
-				fprintf(o->output, "<ows:City>%s</ows:City>",
+				fprintf(o->output, "     <ows:City>%s</ows:City>\n",
 				   o->contact->city->buf);
 			if (o->contact->state != NULL)
 				fprintf(o->output,
-				   "<ows:AdministrativeArea>%s</ows:AdministrativeArea>",
+				   "     <ows:AdministrativeArea>%s</ows:AdministrativeArea>\n",
 				   o->contact->state->buf);
 			if (o->contact->postcode != NULL)
-				fprintf(o->output, "<ows:PostalCode>%s</ows:PostalCode>",
+				fprintf(o->output, "     <ows:PostalCode>%s</ows:PostalCode>\n",
 				   o->contact->postcode->buf);
 			if (o->contact->country != NULL)
-				fprintf(o->output, "<ows:Country>%s</ows:Country>",
+				fprintf(o->output, "     <ows:Country>%s</ows:Country>\n",
 				   o->contact->country->buf);
 			if (o->contact->email != NULL)
 				fprintf(o->output,
-				   "<ows:ElectronicMailAddress>%s</ows:ElectronicMailAddress>",
+				   "    <ows:ElectronicMailAddress>%s</ows:ElectronicMailAddress>\n",
 				   o->contact->email->buf);
-			fprintf(o->output, "</ows:Address>");
+			fprintf(o->output, "    </ows:Address>\n");
 		}
 		if (o->contact->online_resource != NULL)
-			fprintf(o->output, "<ows:OnlineResource xlink:href=\"%s\" />",
+			fprintf(o->output, "    <ows:OnlineResource xlink:href=\"%s\" />\n",
 			   o->contact->online_resource->buf);
 
 		if (o->contact->hours != NULL)
 			fprintf(o->output,
-			   "<ows:HoursOfService>%s</ows:HoursOfService>",
+			   "    <ows:HoursOfService>%s</ows:HoursOfService>\n",
 			   o->contact->hours->buf);
 
 		if (o->contact->instructions != NULL)
 			fprintf(o->output,
-			   "<ows:ContactInstructions>%s</ows:ContactInstructions>",
+			   "    <ows:ContactInstructions>%s</ows:ContactInstructions>\n",
 			   o->contact->instructions->buf);
 
-		fprintf(o->output, "</ows:ContactInfo>");
+		fprintf(o->output, "   </ows:ContactInfo>\n");
 	}
-	fprintf(o->output, "</ows:ServiceContact>");
+	fprintf(o->output, "  </ows:ServiceContact>\n");
 
 	fprintf(o->output, " </ows:ServiceProvider>\n");
 }

Modified: trunk/mapserver/tinyows/src/ows/ows_metadata.c
===================================================================
--- trunk/mapserver/tinyows/src/ows/ows_metadata.c	2012-02-09 01:29:15 UTC (rev 13118)
+++ trunk/mapserver/tinyows/src/ows/ows_metadata.c	2012-02-09 01:29:24 UTC (rev 13119)
@@ -121,8 +121,8 @@
 ows_meta *ows_metadata_init()
 {
 	ows_meta *metadata;
-	metadata = malloc(sizeof(ows_meta));
 
+	metadata = malloc(sizeof(ows_meta));
 	assert(metadata != NULL);
 
 	metadata->name = NULL;
@@ -183,84 +183,54 @@
  */
 void ows_metadata_fill(ows * o, array * cgi)
 {
-	ows_meta *metadata;
 	buffer *b;
 
 	assert(o != NULL);
+	assert(o->metadata != NULL);
 	assert(cgi != NULL);
 
-	metadata = ows_metadata_init();
-
 	/* retrieve the requested service from request */
 	if (array_is_key(cgi, "xmlns"))
 	{
 		b = array_get(cgi, "xmlns");
 		if (buffer_case_cmp(b, "http://www.opengis.net/wfs"))
 		{
-			metadata->type = buffer_init();
-			buffer_add_str(metadata->type, "WFS");
-			metadata->name = buffer_init();
-			buffer_add_str(metadata->name, "WFS");
+			o->metadata->type = buffer_init();
+			buffer_add_str(o->metadata->type, "WFS");
+			o->metadata->name = buffer_init();
+			buffer_add_str(o->metadata->name, "WFS");
 		}
-		else if (buffer_case_cmp(b, "http://www.opengis.net/wms"))
-		{
-			metadata->type = buffer_init();
-			buffer_add_str(metadata->type, "WMS");
-			metadata->name = buffer_init();
-			buffer_add_str(metadata->name, "WMS");
-		}
 	}
 	else if (array_is_key(cgi, "service"))
 	{
 		b = array_get(cgi, "service");
-		metadata->type = buffer_init();
-		buffer_copy(metadata->type, b);
-		metadata->name = buffer_init();
-		buffer_copy(metadata->name, b);
+		o->metadata->type = buffer_init();
+		buffer_copy(o->metadata->type, b);
+		o->metadata->name = buffer_init();
+		buffer_copy(o->metadata->name, b);
 	}
 	else
 	{
-		ows_metadata_free(metadata);
 		ows_error(o, OWS_ERROR_MISSING_PARAMETER_VALUE,
 		   "service unknown", "service");
 	}
 
 	/* initialize supported versions from service type */
-	if (metadata->type != NULL)
+	if (o->metadata->type != NULL)
 	{
-		if (buffer_case_cmp(metadata->type, "WFS"))
+		if (buffer_case_cmp(o->metadata->type, "WFS"))
 		{
-			metadata->versions = list_init();
-			list_add_str(metadata->versions, "1.0.0");
-			list_add_str(metadata->versions, "1.1.0");
+			o->metadata->versions = list_init();
+			list_add_str(o->metadata->versions, "1.0.0");
+			list_add_str(o->metadata->versions, "1.1.0");
 		}
-		else if (buffer_case_cmp(metadata->type, "WMS"))
+		else if (buffer_case_cmp(o->metadata->type, "WMS"))
 		{
-			metadata->versions = list_init();
-			list_add_str(metadata->versions, "1.1.0");
-			list_add_str(metadata->versions, "1.3.0");
+			o->metadata->versions = list_init();
+			list_add_str(o->metadata->versions, "1.1.0");
+			list_add_str(o->metadata->versions, "1.3.0");
 		}
 	}
-
-	/* change here metadata information */
-	metadata->title = buffer_init();
-	buffer_add_str(metadata->title, "TinyOWS");
-
-	metadata->abstract = buffer_init();
-	buffer_add_str(metadata->abstract,
-	   "TinyOWS : a Web Feature Server maintained by Camptocamp");
-
-	metadata->keywords = list_init();
-	list_add_str(metadata->keywords, "WFS");
-	list_add_str(metadata->keywords, "WMS");
-	list_add_str(metadata->keywords, "Camptocamp");
-	list_add_str(metadata->keywords, "TinyOWS");
-
-	metadata->online_resource = buffer_init();
-	buffer_add_str(metadata->online_resource,
-	   "http://dev.camptocamp.com/~tinyows/tinyows");
-
-	o->metadata = metadata;
 }
 
 
@@ -277,101 +247,101 @@
 	if (contact->name != NULL)
 	{
 		fprintf(output, "name: ");
-		buffer_flush(contact->name, stdout);
+		buffer_flush(contact->name, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->site != NULL)
 	{
 		fprintf(output, "site: ");
-		buffer_flush(contact->site, stdout);
+		buffer_flush(contact->site, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->indiv_name != NULL)
 	{
 		fprintf(output, "individual name: ");
-		buffer_flush(contact->indiv_name, stdout);
+		buffer_flush(contact->indiv_name, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->position != NULL)
 	{
 		fprintf(output, "position: ");
-		buffer_flush(contact->position, stdout);
+		buffer_flush(contact->position, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->phone != NULL)
 	{
 		fprintf(output, "phone: ");
-		buffer_flush(contact->phone, stdout);
+		buffer_flush(contact->phone, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->fax != NULL)
 	{
 		fprintf(output, "fax: ");
-		buffer_flush(contact->fax, stdout);
+		buffer_flush(contact->fax, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->online_resource != NULL)
 	{
 		fprintf(output, "online_resource: ");
-		buffer_flush(contact->online_resource, stdout);
+		buffer_flush(contact->online_resource, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->address != NULL)
 	{
 		fprintf(output, "address: ");
-		buffer_flush(contact->address, stdout);
+		buffer_flush(contact->address, output);
 		fprintf(output, "\n");
 	}
 	if (contact->postcode != NULL)
 	{
 		fprintf(output, "postcode: ");
-		buffer_flush(contact->postcode, stdout);
+		buffer_flush(contact->postcode, output);
 		fprintf(output, "\n");
 	}
 	if (contact->city != NULL)
 	{
 		fprintf(output, "city: ");
-		buffer_flush(contact->city, stdout);
+		buffer_flush(contact->city, output);
 		fprintf(output, "\n");
 	}
 	if (contact->state != NULL)
 	{
 		fprintf(output, "administrative_area: ");
-		buffer_flush(contact->city, stdout);
+		buffer_flush(contact->city, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->country != NULL)
 	{
 		fprintf(output, "country: ");
-		buffer_flush(contact->country, stdout);
+		buffer_flush(contact->country, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->email != NULL)
 	{
 		fprintf(output, "email: ");
-		buffer_flush(contact->email, stdout);
+		buffer_flush(contact->email, output);
 		fprintf(output, "\n");
 	}
 	if (contact->hours != NULL)
 	{
 		fprintf(output, "hours_of_service: ");
-		buffer_flush(contact->hours, stdout);
+		buffer_flush(contact->hours, output);
 		fprintf(output, "\n");
 	}
 
 	if (contact->instructions != NULL)
 	{
 		fprintf(output, "contact_instructions: ");
-		buffer_flush(contact->instructions, stdout);
+		buffer_flush(contact->instructions, output);
 		fprintf(output, "\n");
 	}
 
@@ -392,63 +362,63 @@
 	if (metadata->name != NULL)
 	{
 		fprintf(output, "name: ");
-		buffer_flush(metadata->name, stdout);
+		buffer_flush(metadata->name, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->type != NULL)
 	{
 		fprintf(output, "type: ");
-		buffer_flush(metadata->type, stdout);
+		buffer_flush(metadata->type, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->versions != NULL)
 	{
 		fprintf(output, "version: ");
-		list_flush(metadata->versions, stdout);
+		list_flush(metadata->versions, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->title != NULL)
 	{
 		fprintf(output, "title: ");
-		buffer_flush(metadata->title, stdout);
+		buffer_flush(metadata->title, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->abstract != NULL)
 	{
 		fprintf(output, "abstract: ");
-		buffer_flush(metadata->abstract, stdout);
+		buffer_flush(metadata->abstract, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->keywords != NULL)
 	{
 		fprintf(output, "keywords: ");
-		list_flush(metadata->keywords, stdout);
+		list_flush(metadata->keywords, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->online_resource != NULL)
 	{
 		fprintf(output, "online_resource: ");
-		buffer_flush(metadata->online_resource, stdout);
+		buffer_flush(metadata->online_resource, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->fees != NULL)
 	{
 		fprintf(output, "fees: ");
-		buffer_flush(metadata->fees, stdout);
+		buffer_flush(metadata->fees, output);
 		fprintf(output, "\n");
 	}
 
 	if (metadata->access_constraints != NULL)
 	{
 		fprintf(output, "access_constraints: ");
-		buffer_flush(metadata->access_constraints, stdout);
+		buffer_flush(metadata->access_constraints, output);
 		fprintf(output, "\n");
 	}
 }

Modified: trunk/mapserver/tinyows/src/wfs/wfs_get_capabilities.c
===================================================================
--- trunk/mapserver/tinyows/src/wfs/wfs_get_capabilities.c	2012-02-09 01:29:15 UTC (rev 13118)
+++ trunk/mapserver/tinyows/src/wfs/wfs_get_capabilities.c	2012-02-09 01:29:24 UTC (rev 13119)
@@ -493,18 +493,18 @@
 	else
 		fprintf(o->output, "Content-Type: application/xml\n\n");
 	fprintf(o->output, "<?xml version='1.0' encoding='UTF-8'?>\n");
-	fprintf(o->output, "<WFS_Capabilities\n");
-	fprintf(o->output, "version='1.1.0' updateSequence='0'\n");
+	fprintf(o->output, "<WFS_Capabilities");
+	fprintf(o->output, " version='1.1.0' updateSequence='0'\n");
 
-	fprintf(o->output, " xmlns='http://www.opengis.net/wfs'\n");
+	fprintf(o->output, "  xmlns='http://www.opengis.net/wfs'\n");
 	fprintf(o->output,
-	   " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n");
-	fprintf(o->output, " xmlns:ogc='http://www.opengis.net/ogc'");
-	fprintf(o->output, " xmlns:gml='http://www.opengis.net/gml'");
-	fprintf(o->output, " xmlns:ows='http://www.opengis.net/ows'");
-	fprintf(o->output, " xmlns:xlink='http://www.w3.org/1999/xlink'");
-	fprintf(o->output, " xsi:schemaLocation='http://www.opengis.net/wfs");
-	fprintf(o->output, " http://schemas.opengis.net/wfs/1.1.0/wfs.xsd' >\n");
+	   "  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n");
+	fprintf(o->output, "  xmlns:ogc='http://www.opengis.net/ogc'\n");
+	fprintf(o->output, "  xmlns:gml='http://www.opengis.net/gml'\n");
+	fprintf(o->output, "  xmlns:ows='http://www.opengis.net/ows'\n");
+	fprintf(o->output, "  xmlns:xlink='http://www.w3.org/1999/xlink'\n");
+	fprintf(o->output, "  xsi:schemaLocation='http://www.opengis.net/wfs\n");
+	fprintf(o->output, "  http://schemas.opengis.net/wfs/1.1.0/wfs.xsd' >\n");
 
 	name = buffer_init();
 



More information about the mapserver-commits mailing list