Package org.geoserver.gss

Examples of org.geoserver.gss.CentralRevisionsType


    }

    @Override
    public void write(Object value, OutputStream output, Operation operation) throws IOException,
            ServiceException {
        CentralRevisionsType cr = (CentralRevisionsType) value;
        Encoder encoder = new Encoder(configuration, gss.getSchema());
        encoder.setIndenting(true);

        // declare namespaces to make the output validate
        for (LayerRevision l : cr.getLayerRevisions()) {
            encoder.getNamespaces().declarePrefix(l.getTypeName().getPrefix(),
                    l.getTypeName().getNamespaceURI());
        }

        encoder.encode(cr, GSS.CentralRevisions, output);
View Full Code Here


    }
   
    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        List<CentralRevisionsType.LayerRevision> layerRevisions = node.getChildValues(CentralRevisionsType.LayerRevision.class);
        CentralRevisionsType result = new CentralRevisionsType();
        result.getLayerRevisions().addAll(layerRevisions);
       
        return result;
    }
View Full Code Here

public class CentralRevisionsTypeBindingTest extends GSSXMLTestSupport {

    public void testParse() throws Exception {
        document = dom("CentralRevisionsResponse.xml");
        CentralRevisionsType cr = (CentralRevisionsType) parse(GSS.CentralRevisionsType);
       
        List<LayerRevision> layerRevisions = cr.getLayerRevisions();
        assertEquals(2, layerRevisions.size());
       
        LayerRevision layerRevision = layerRevisions.get(0);
        assertEquals("archsites", layerRevision.getTypeName().getLocalPart());
        assertEquals(SF_NAMESPACE, layerRevision.getTypeName().getNamespaceURI());
View Full Code Here

        assertEquals(SF_NAMESPACE, layerRevision.getTypeName().getNamespaceURI());
        assertEquals(22, layerRevision.getCentralRevision());
    }
   
    public void testEncode() throws Exception {
        CentralRevisionsType cr = new CentralRevisionsType();
        cr.getLayerRevisions().add(new LayerRevision(new QName(SF_NAMESPACE, "archsites"), 15));
       
        Document doc = encode(cr, GSS.CentralRevisions);
        // print(doc);
        assertXpathEvaluatesTo("1", "count(//gss:CentralRevisions/gss:LayerRevision)", doc);
        assertXpathEvaluatesTo("sf:archsites", "//gss:CentralRevisions/gss:LayerRevision/@typeName", doc);
View Full Code Here

public class CentralRevisionsTypeBindingTest extends GSSXMLTestSupport {

    public void testParse() throws Exception {
        document = dom("CentralRevisionsResponse.xml");
        CentralRevisionsType cr = (CentralRevisionsType) parse(GSS.CentralRevisionsType);
       
        List<LayerRevision> layerRevisions = cr.getLayerRevisions();
        assertEquals(2, layerRevisions.size());
       
        LayerRevision layerRevision = layerRevisions.get(0);
        assertEquals("archsites", layerRevision.getTypeName().getLocalPart());
        assertEquals(SF_NAMESPACE, layerRevision.getTypeName().getNamespaceURI());
View Full Code Here

        assertEquals(SF_NAMESPACE, layerRevision.getTypeName().getNamespaceURI());
        assertEquals(22, layerRevision.getCentralRevision());
    }
   
    public void testEncode() throws Exception {
        CentralRevisionsType cr = new CentralRevisionsType();
        cr.getLayerRevisions().add(new LayerRevision(new QName(SF_NAMESPACE, "archsites"), 15));
       
        Document doc = encode(cr, GSS.CentralRevisions);
        // print(doc);
        assertXpathEvaluatesTo("1", "count(//gss:CentralRevisions/gss:LayerRevision)", doc);
        assertXpathEvaluatesTo("sf:archsites", "//gss:CentralRevisions/gss:LayerRevision/@typeName", doc);
View Full Code Here

    }

    @Override
    public void write(Object value, OutputStream output, Operation operation) throws IOException,
            ServiceException {
        CentralRevisionsType cr = (CentralRevisionsType) value;
        Encoder encoder = new Encoder(configuration, gss.getSchema());
        encoder.setIndenting(true);

        // declare namespaces to make the output validate
        for (LayerRevision l : cr.getLayerRevisions()) {
            encoder.getNamespaces().declarePrefix(l.getTypeName().getPrefix(),
                    l.getTypeName().getNamespaceURI());
        }

        encoder.encode(cr, GSS.CentralRevisions, output);
View Full Code Here

    }
   
    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        List<CentralRevisionsType.LayerRevision> layerRevisions = node.getChildValues(CentralRevisionsType.LayerRevision.class);
        CentralRevisionsType result = new CentralRevisionsType();
        result.getLayerRevisions().addAll(layerRevisions);
       
        return result;
    }
View Full Code Here

TOP

Related Classes of org.geoserver.gss.CentralRevisionsType

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.