35 #ifdef HAVE_SERVER_PYTHON_PLUGINS
39 const QDomDocument *capabilitiesDocument =
nullptr;
41 #ifdef HAVE_SERVER_PYTHON_PLUGINS
43 if ( cacheManager && cacheManager->
getCachedDocument( &doc, project, request, accessControl ) )
45 capabilitiesDocument = &doc;
55 capabilitiesDocument = &doc;
59 capabilitiesDocument = &doc;
61 response.
setHeader( QStringLiteral(
"Content-Type" ), QStringLiteral(
"text/xml; charset=utf-8" ) );
62 response.
write( capabilitiesDocument->toByteArray() );
74 QDomElement wcsCapabilitiesElement = doc.createElement( QStringLiteral(
"WCS_Capabilities" ) );
75 wcsCapabilitiesElement.setAttribute( QStringLiteral(
"xmlns" ),
WCS_NAMESPACE );
76 wcsCapabilitiesElement.setAttribute( QStringLiteral(
"xmlns:xsi" ), QStringLiteral(
"http://www.w3.org/2001/XMLSchema-instance" ) );
77 wcsCapabilitiesElement.setAttribute( QStringLiteral(
"xsi:schemaLocation" ),
WCS_NAMESPACE +
" http://schemas.opengis.net/wcs/1.0.0/wcsCapabilities.xsd" );
78 wcsCapabilitiesElement.setAttribute( QStringLiteral(
"xmlns:gml" ),
GML_NAMESPACE );
79 wcsCapabilitiesElement.setAttribute( QStringLiteral(
"xmlns:xlink" ), QStringLiteral(
"http://www.w3.org/1999/xlink" ) );
81 wcsCapabilitiesElement.setAttribute( QStringLiteral(
"updateSequence" ), QStringLiteral(
"0" ) );
82 doc.appendChild( wcsCapabilitiesElement );
88 QDomElement capabilityElement = doc.createElement( QStringLiteral(
"Capability" ) );
89 wcsCapabilitiesElement.appendChild( capabilityElement );
92 QDomElement requestElement = doc.createElement( QStringLiteral(
"Request" ) );
93 capabilityElement.appendChild( requestElement );
96 QDomElement getCapabilitiesElement = doc.createElement( QStringLiteral(
"GetCapabilities" ) );
97 requestElement.appendChild( getCapabilitiesElement );
99 QDomElement dcpTypeElement = doc.createElement( QStringLiteral(
"DCPType" ) );
100 getCapabilitiesElement.appendChild( dcpTypeElement );
101 QDomElement httpElement = doc.createElement( QStringLiteral(
"HTTP" ) );
102 dcpTypeElement.appendChild( httpElement );
105 QString hrefString =
serviceUrl( request, project );
107 QDomElement getElement = doc.createElement( QStringLiteral(
"Get" ) );
108 httpElement.appendChild( getElement );
109 QDomElement onlineResourceElement = doc.createElement( QStringLiteral(
"OnlineResource" ) );
110 onlineResourceElement.setAttribute( QStringLiteral(
"xlink:type" ), QStringLiteral(
"simple" ) );
111 onlineResourceElement.setAttribute( QStringLiteral(
"xlink:href" ), hrefString );
112 getElement.appendChild( onlineResourceElement );
114 QDomElement getCapabilitiesDhcTypePostElement = dcpTypeElement.cloneNode().toElement();
115 getCapabilitiesDhcTypePostElement.firstChild().firstChild().toElement().setTagName( QStringLiteral(
"Post" ) );
116 getCapabilitiesElement.appendChild( getCapabilitiesDhcTypePostElement );
118 QDomElement describeCoverageElement = getCapabilitiesElement.cloneNode().toElement();
119 describeCoverageElement.setTagName( QStringLiteral(
"DescribeCoverage" ) );
120 requestElement.appendChild( describeCoverageElement );
122 QDomElement getCoverageElement = getCapabilitiesElement.cloneNode().toElement();
123 getCoverageElement.setTagName( QStringLiteral(
"GetCoverage" ) );
124 requestElement.appendChild( getCoverageElement );
136 QDomElement serviceElem = doc.createElement( QStringLiteral(
"Service" ) );
139 QDomElement nameElem = doc.createElement( QStringLiteral(
"name" ) );
140 QDomText nameText = doc.createTextNode(
"WCS" );
141 nameElem.appendChild( nameText );
142 serviceElem.appendChild( nameElem );
145 if ( !title.isEmpty() )
147 QDomElement titleElem = doc.createElement( QStringLiteral(
"label" ) );
148 QDomText titleText = doc.createTextNode( title );
149 titleElem.appendChild( titleText );
150 serviceElem.appendChild( titleElem );
154 if ( !
abstract.isEmpty() )
156 QDomElement abstractElem = doc.createElement( QStringLiteral(
"description" ) );
157 QDomText abstractText = doc.createCDATASection(
abstract );
158 abstractElem.appendChild( abstractText );
159 serviceElem.appendChild( abstractElem );
163 if ( !keywords.isEmpty() )
165 QDomElement keywordsElem = doc.createElement( QStringLiteral(
"keywords" ) );
166 for (
int i = 0; i < keywords.size(); ++i )
168 QDomElement keywordElem = doc.createElement( QStringLiteral(
"keyword" ) );
169 QDomText keywordText = doc.createTextNode( keywords.at( i ) );
170 keywordElem.appendChild( keywordText );
171 keywordsElem.appendChild( keywordElem );
173 serviceElem.appendChild( keywordsElem );
183 if ( !contactPerson.isEmpty() ||
184 !contactOrganization.isEmpty() ||
185 !contactPosition.isEmpty() ||
186 !contactMail.isEmpty() ||
187 !contactPhone.isEmpty() ||
188 !onlineResource.isEmpty() )
190 QDomElement responsiblePartyElem = doc.createElement( QStringLiteral(
"responsibleParty" ) );
191 if ( !contactPerson.isEmpty() )
193 QDomElement contactPersonElem = doc.createElement( QStringLiteral(
"individualName" ) );
194 QDomText contactPersonText = doc.createTextNode( contactPerson );
195 contactPersonElem.appendChild( contactPersonText );
196 responsiblePartyElem.appendChild( contactPersonElem );
198 if ( !contactOrganization.isEmpty() )
200 QDomElement contactOrganizationElem = doc.createElement( QStringLiteral(
"organisationName" ) );
201 QDomText contactOrganizationText = doc.createTextNode( contactOrganization );
202 contactOrganizationElem.appendChild( contactOrganizationText );
203 responsiblePartyElem.appendChild( contactOrganizationElem );
205 if ( !contactPosition.isEmpty() )
207 QDomElement contactPositionElem = doc.createElement( QStringLiteral(
"positionName" ) );
208 QDomText contactPositionText = doc.createTextNode( contactPosition );
209 contactPositionElem.appendChild( contactPositionText );
210 responsiblePartyElem.appendChild( contactPositionElem );
212 if ( !contactMail.isEmpty() ||
213 !contactPhone.isEmpty() ||
214 !onlineResource.isEmpty() )
216 QDomElement contactInfoElem = doc.createElement( QStringLiteral(
"contactInfo" ) );
217 if ( !contactMail.isEmpty() )
219 QDomElement contactAddressElem = doc.createElement( QStringLiteral(
"address" ) );
220 QDomElement contactAddressMailElem = doc.createElement( QStringLiteral(
"electronicMailAddress" ) );
221 QDomText contactAddressMailText = doc.createTextNode( contactMail );
222 contactAddressMailElem.appendChild( contactAddressMailText );
223 contactAddressElem.appendChild( contactAddressMailElem );
224 contactInfoElem.appendChild( contactAddressElem );
226 if ( !contactPhone.isEmpty() )
228 QDomElement contactPhoneElem = doc.createElement( QStringLiteral(
"phone" ) );
229 QDomElement contactVoiceElem = doc.createElement( QStringLiteral(
"voice" ) );
230 QDomText contactVoiceText = doc.createTextNode( contactPhone );
231 contactVoiceElem.appendChild( contactVoiceText );
232 contactPhoneElem.appendChild( contactVoiceElem );
233 contactInfoElem.appendChild( contactPhoneElem );
235 if ( !onlineResource.isEmpty() )
237 QDomElement onlineResourceElem = doc.createElement( QStringLiteral(
"onlineResource" ) );
238 onlineResourceElem.setAttribute( QStringLiteral(
"xmlns:xlink" ), QStringLiteral(
"http://www.w3.org/1999/xlink" ) );
239 onlineResourceElem.setAttribute( QStringLiteral(
"xlink:type" ), QStringLiteral(
"simple" ) );
240 onlineResourceElem.setAttribute( QStringLiteral(
"xlink:href" ), onlineResource );
241 contactInfoElem.appendChild( onlineResourceElem );
243 responsiblePartyElem.appendChild( contactInfoElem );
245 serviceElem.appendChild( responsiblePartyElem );
248 QDomElement feesElem = doc.createElement( QStringLiteral(
"fees" ) );
249 QDomText feesText = doc.createTextNode( QStringLiteral(
"None" ) );
251 if ( !fees.isEmpty() )
253 feesText = doc.createTextNode( fees );
255 feesElem.appendChild( feesText );
256 serviceElem.appendChild( feesElem );
258 QDomElement accessConstraintsElem = doc.createElement( QStringLiteral(
"accessConstraints" ) );
259 QDomText accessConstraintsText = doc.createTextNode( QStringLiteral(
"None" ) );
261 if ( !accessConstraints.isEmpty() )
263 accessConstraintsText = doc.createTextNode( accessConstraints );
265 accessConstraintsElem.appendChild( accessConstraintsText );
266 serviceElem.appendChild( accessConstraintsElem );
274 #ifdef HAVE_SERVER_PYTHON_PLUGINS
282 QDomElement contentMetadataElement = doc.createElement( QStringLiteral(
"ContentMetadata" ) );
285 for (
int i = 0; i < wcsLayersId.size(); ++i )
296 #ifdef HAVE_SERVER_PYTHON_PLUGINS
306 contentMetadataElement.appendChild( layerElem );
310 return contentMetadataElement;