public Object read(Object request, Map kvp, Map rawKvp) throws Exception { // let super do its thing request = super.read(request, kvp, rawKvp); DescribeCoverageType describeCoverage = (DescribeCoverageType) request; // we need at least one coverage final String identifiersValue = (String) rawKvp.get("identifiers"); final List identifiers = KvpUtils.readFlat(identifiersValue); if(identifiers == null || identifiers.size() == 0) { throw new WcsException("Required paramer, identifiers, missing", WcsExceptionCode.MissingParameterValue, "identifiers"); } // all right, set into the model (note there is a mismatch between the kvp name and the // xml name, that's why we have to parse the identifiers by hand) describeCoverage.getIdentifier().addAll(identifiers); // if not specified, throw a resounding exception (by spec) if(!describeCoverage.isSetVersion()) throw new WcsException("Version has not been specified", WcsExceptionCode.MissingParameterValue, "version"); return request; } }
public DescribeCoverageTransformer describeCoverage(DescribeCoverageType request) { final String version = request.getVersion(); if ("1.1.0".equals(version) || "1.1.1".equals(version)) { DescribeCoverageTransformer describeTransformer = new DescribeCoverageTransformer(wcs, catalog); describeTransformer.setEncoding(wcs.getCharSet()); return describeTransformer; } throw new WcsException("Could not understand version:" + version); }
+ " " + buildSchemaURL( request.getBaseUrl(), "wcs/1.1.1/wcsDescribeCoverage.xsd"); for (Iterator it = request.getIdentifier().iterator(); it.hasNext(); ) { String coverageId = (String) it.next();
assertEquals("WCS", cap.getService()); assertEquals("1.1.1", cap.getVersion()); assertEquals(1, cap.getIdentifier().size()); assertEquals("wcs:BlueMarble", cap.getIdentifier().get(0));
@Test public void testWCS11DescribeCoverage() throws Exception { net.opengis.wcs11.DescribeCoverageType dc = Wcs11Factory.eINSTANCE.createDescribeCoverageType(); dc.getIdentifier().add("acme:foo"); dc.getIdentifier().add("acme:bar"); callback.operationDispatched(new Request(), op("DescribeCoverage", "WCS", "1.1.0", dc)); assertEquals("acme:foo", data.getResources().get(0)); assertEquals("acme:bar", data.getResources().get(1)); }
protected void handleMetadataLink(MetadataLinkInfo mdl, String linkType) { AttributesImpl attributes = new AttributesImpl(); if ((mdl.getAbout() != null) && (mdl.getAbout() != "")) { attributes.addAttribute("", "about", "about", "", mdl.getAbout()); } if ((mdl.getMetadataType() != null) && (mdl.getMetadataType() != "")) { attributes.addAttribute( "", "metadataType", "metadataType", "", mdl.getMetadataType()); } if ((linkType != null) && (linkType != "")) { attributes.addAttribute("", "xlink:type", "xlink:type", "", linkType); } if ((mdl.getContent() != null) && (mdl.getContent() != "")) { attributes.addAttribute( "", "xlink:href", "xlink:href", "", ResponseUtils.proxifyMetadataLink(mdl, request.getBaseUrl())); } if (attributes.getLength() > 0) { element("ows:Metadata", null, attributes); } }
@Test public void testWCS11DescribeCoverage() throws Exception { net.opengis.wcs11.DescribeCoverageType dc = Wcs11Factory.eINSTANCE.createDescribeCoverageType(); dc.getIdentifier().add("acme:foo"); dc.getIdentifier().add("acme:bar"); callback.operationDispatched(new Request(), op("DescribeCoverage", "WCS", "1.1.0", dc)); assertEquals("acme:foo", data.getResources().get(0)); assertEquals("acme:bar", data.getResources().get(1)); }
public Object read(Object request, Map kvp, Map rawKvp) throws Exception { // let super do its thing request = super.read(request, kvp, rawKvp); DescribeCoverageType describeCoverage = (DescribeCoverageType) request; // we need at least one coverage final String identifiersValue = (String) rawKvp.get("identifiers"); final List identifiers = KvpUtils.readFlat(identifiersValue); if (identifiers == null || identifiers.size() == 0) { throw new WcsException( "Required paramer, identifiers, missing", WcsExceptionCode.MissingParameterValue, "identifiers"); } // all right, set into the model (note there is a mismatch between the kvp name and the // xml name, that's why we have to parse the identifiers by hand) describeCoverage.getIdentifier().addAll(identifiers); // if not specified, throw a resounding exception (by spec) if (!describeCoverage.isSetVersion()) throw new WcsException( "Version has not been specified", WcsExceptionCode.MissingParameterValue, "version"); return request; } }
.toString(); proxifiedBaseUrl = RequestUtils.proxifiedBaseURL(request.getBaseUrl(), wcs .getGeoServer().getProxyBaseUrl()); final String locationDef = WCS_URI + " " + proxifiedBaseUrl for (Iterator it = request.getIdentifier().iterator(); it.hasNext();) { String coverageId = (String) it.next();
@Override protected void qualifyRequest( WorkspaceInfo ws, PublishedInfo l, Operation operation, Request request) { GetCapabilitiesType caps = parameter(operation, GetCapabilitiesType.class); if (caps != null) { return; } DescribeCoverageType dcov = parameter(operation, DescribeCoverageType.class); if (dcov != null) { qualifyLayerNames(dcov.getIdentifier(), ws); return; } GetCoverageType gcov = parameter(operation, GetCoverageType.class); if (gcov != null) { if (gcov.getIdentifier() != null && gcov.getIdentifier().getValue() != null) { gcov.getIdentifier().setValue(qualifyName(gcov.getIdentifier().getValue(), ws)); } } } }
public DescribeCoverageTransformer describeCoverage(DescribeCoverageType request) { final String version = request.getVersion(); if ("1.1.0".equals(version) || "1.1.1".equals(version)) { WCSInfo wcs = getServiceInfo(); DescribeCoverageTransformer describeTransformer = new DescribeCoverageTransformer(wcs, catalog, responseFactory); describeTransformer.setEncoding( Charset.forName(wcs.getGeoServer().getSettings().getCharset())); return describeTransformer; } throw new WcsException("Could not understand version:" + version); }