Package org.geowebcache.config.meta

Examples of org.geowebcache.config.meta.ServiceInformation


        return str.toString();
    }

    private void service(StringBuilder str) {
        ServiceInformation servInfo = tld.getServiceInformation();
        str.append("<Service>\n");
        str.append("  <Name>OGC:WMS</Name>\n");

        if (servInfo == null) {
            str.append("  <Title>Web Map Service - GeoWebCache</Title>\n");
View Full Code Here


        str.append("</Service>\n");
    }

    private void serviceContact(StringBuilder str) {
        ServiceInformation servInfo = tld.getServiceInformation();
        ServiceProvider servProv = null;
        ServiceContact servCont = null;

        if (servInfo != null) {
            servProv = servInfo.serviceProvider;
View Full Code Here

        return str.toString();
    }

    private void serviceIdentification(StringBuilder str) {
        ServiceInformation servInfo = tld.getServiceInformation();
       
        str.append("<ows:ServiceIdentification>\n");
       
        if (servInfo != null) {
            appendTag(str, "  ", "ows:Title", servInfo.title, "Web Map Tile Service - GeoWebCache");
View Full Code Here

        str.append("</ows:ServiceIdentification>\n");
    }
   
    private void serviceProvider(StringBuilder str) {
        ServiceInformation servInfo = tld.getServiceInformation();
        ServiceProvider servProv = null;
        if(servInfo != null) {
            servProv = servInfo.serviceProvider;
        }
        str.append("<ows:ServiceProvider>\n");
View Full Code Here

            throw new IllegalStateException(e);
        }
    }

    private void serviceIdentification(XMLBuilder xml) throws IOException {
        ServiceInformation servInfo = tld.getServiceInformation();
       
        xml.indentElement("ows:ServiceIdentification");
       
        if (servInfo != null) {
            appendTag(xml, "ows:Title", servInfo.getTitle(), "Web Map Tile Service - GeoWebCache");
            appendTag(xml, "ows:Abstract", servInfo.getDescription(), null);
           
            if (servInfo != null && servInfo.getKeywords() != null) {
                xml.indentElement("ows:Keywords");
                Iterator<String> keywordIter = servInfo.getKeywords().iterator();
                while(keywordIter.hasNext()) {
                    appendTag(xml, "ows:Keyword", keywordIter.next(), null);
                }
                xml.endElement();
            }
        } else {
            xml.simpleElement("ows:Title","Web Map Tile Service - GeoWebCache", true);
        }
        xml.simpleElement("ows:ServiceType","OGC WMTS", true);
        xml.simpleElement("ows:ServiceTypeVersion","1.0.0", true);
       
        if (servInfo != null) {
            appendTag(xml, "ows:Fees", servInfo.getFees(), null);
            appendTag(xml, "ows:AccessConstraints", servInfo.getAccessConstraints(), null);
        }

        xml.endElement("ows:ServiceIdentification");
    }
View Full Code Here

        xml.endElement("ows:ServiceIdentification");
    }
   
    private void serviceProvider(XMLBuilder xml) throws IOException {
        ServiceInformation servInfo = tld.getServiceInformation();
        ServiceProvider servProv = null;
        if(servInfo != null) {
            servProv = servInfo.getServiceProvider();
        }
        xml.indentElement("ows:ServiceProvider");
       
        if(servProv != null) {
            appendTag(xml, "ows:ProviderName", servProv.getProviderName(), null);
View Full Code Here

        HttpServletRequest servReq = createMock(HttpServletRequest.class);
        HttpServletResponse response = createMock(HttpServletResponse.class);
        String baseUrl = "http://example.com/geowebcache/";
        String contextPath = "service/";
        URLMangler urlMangler = new NullURLMangler();
        ServiceInformation servInfo = createMock(ServiceInformation.class);
       
        Map<String, String[]> parameterMap = new HashMap<>();
        parameterMap.put("SERVICE", new String[]{"WMS"});
        parameterMap.put("VERSION", new String[]{"1.1.1"});
        parameterMap.put("REQUEST", new String[]{"getcapabilities"});
        parameterMap.put("TILED", new String[]{"true"});
       
        expect(servReq.getParameterMap()).andStubReturn(Collections.unmodifiableMap(parameterMap));
        expect(servReq.getCharacterEncoding()).andStubReturn("UTF-8");
       
        expect(servInfo.getTitle()).andStubReturn("Title & \"stuff\"");
        expect(servInfo.getDescription()).andStubReturn("This \"description\" contains <characters> which & should be \'escaped\'.");
        expect(servInfo.getKeywords()).andStubReturn(null);
        expect(servInfo.getServiceProvider()).andStubReturn(null);
        expect(servInfo.getFees()).andStubReturn("NONE");
        expect(servInfo.getAccessConstraints()).andStubReturn("NONE");
        expect(tld.getServiceInformation()).andStubReturn(servInfo);
       
        expect(tld.getLayerList()).andStubReturn(Collections.<TileLayer>emptyList());

        replay(tld, servReq, response, servInfo);
View Full Code Here

        return str.toString();
    }

    private void service(XMLBuilder xml) throws IOException {
        ServiceInformation servInfo = tld.getServiceInformation();
        xml.indentElement("Service");
        xml.indentElement("Name").text("OGC:WMS").endElement();

        if (servInfo == null) {
            xml.indentElement("Title").text("Web Map Service - GeoWebCache").endElement();
        } else {
            xml.indentElement("Title").text(servInfo.getTitle()).endElement();
            xml.indentElement("Abstract").text(servInfo.getDescription()).endElement();

            if (servInfo.getKeywords() != null) {
                xml.indentElement("KeywordList");
                Iterator<String> keywordIter = servInfo.getKeywords().iterator();
                while (keywordIter.hasNext()) {
                    xml.indentElement("Keyword").text(keywordIter.next()).endElement();
                }
                xml.endElement();
            }
        }
        onlineResource(xml, urlStr);

        serviceContact(xml);

        if (servInfo != null) {
            xml.indentElement("Fees").text(servInfo.getFees()).endElement();
            xml.indentElement("AccessConstraints").text(servInfo.getAccessConstraints()).endElement();
        }

        xml.endElement();
    }
View Full Code Here

        xml.endElement();
    }

    private void serviceContact(XMLBuilder xml) throws IOException {
        ServiceInformation servInfo = tld.getServiceInformation();
        if (servInfo == null) {
            return;
        }

        ServiceProvider servProv = servInfo.getServiceProvider();
        if (servProv == null) {
            return;
        }

        ServiceContact servCont = servProv.getServiceContact();
View Full Code Here

    public void testLoad126() throws Exception {

        XMLConfiguration config = loadConfig("geowebcache_126.xml");

        ServiceInformation serviceInfo = config.getServiceInformation();
        assertNotNull(serviceInfo);
        assertEquals("GeoWebCache", serviceInfo.getTitle());
        assertEquals("GeoWebCache description.", serviceInfo.getDescription());

        // check transform from <keyowrds><keyword>... to <keywords><string>...
        assertEquals(asList("WFS", "WMS", "WMTS", "GEOWEBCACHE"), serviceInfo.getKeywords());

        assertNotNull(serviceInfo.getAccessConstraints());
        assertNotNull(serviceInfo.getFees());
        assertNotNull(serviceInfo.getServiceProvider());
        assertNotNull(serviceInfo.getServiceProvider().getProviderName());
        assertNotNull(serviceInfo.getServiceProvider().getProviderSite());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact()
                .getAddressAdministrativeArea());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getAddressCity());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getAddressCountry());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getAddressEmail());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getAddressPostalCode());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getAddressStreet());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getAddressType());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getFaxNumber());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getIndividualName());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getPhoneNumber());
        assertNotNull(serviceInfo.getServiceProvider().getServiceContact().getPositionName());

        List<TileLayer> layers = config.getTileLayers();
        TileLayer layer = findLayer(layers, "topp:states");
        assertNotNull(layer);
View Full Code Here

TOP

Related Classes of org.geowebcache.config.meta.ServiceInformation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.