Package org.geoserver.platform

Examples of org.geoserver.platform.Operation


       
        LockType l = WfsFactory.eINSTANCE.createLockType();
        l.setTypeName(new QName("http://acme.org", "foo", "acme"));
        lf.getLock().add(l);
       
        Operation op = op("LockFeature", "WFS", "1.0.0", lf);
        callback.operationDispatched(new Request(), op);
       
        assertEquals("acme:foo", data.getLayers().get(0));
    }
View Full Code Here


       
        DeleteElementType de = WfsFactory.eINSTANCE.createDeleteElementType();
        de.setTypeName(new QName("http://acme.org", "bar", "acme"));
        t.getDelete().add(de);
       
        Operation op = op("Transaction", "WFS", "1.0.0", t);
        callback.operationDispatched(new Request(), op);
       
        assertEquals("acme:foo", data.getLayers().get(0));
        assertEquals("acme:bar", data.getLayers().get(1));
    }
View Full Code Here

       
        return new MapLayerInfo(l);
    }
   
    Operation op(String name, String service, String version, Object request) {
        return new Operation(name, new Service(service, null, new Version(version), null),
            null, new Object[]{request});
    }
View Full Code Here

    private GetFeatureType gft;
   
    @Before
    public void init() throws Exception {
        gft = WfsFactory.eINSTANCE.createGetFeatureType();
        op = new Operation("GetFeature", getServiceDescriptor10(), null, new Object[] { gft });
    }
View Full Code Here

            FeatureCollectionResponse.adapt(WfsFactory.eINSTANCE.createFeatureCollectionType());
        mockResult.getFeature().add(getFeatureSource(ALL_DOTS).getFeatures(Filter.INCLUDE));

        GetFeatureType mockRequest = WfsFactory.eINSTANCE.createGetFeatureType();

        Operation mockOperation = new Operation("GetFeature", getServiceDescriptor10(), null,
                new Object[] { mockRequest });

        assertEquals("All_Types_Dots.zip",  zip.getAttachmentFileName(mockResult, mockOperation));

        mockRequest.getFormatOptions().put("FILENAME", "REQUEST_SUPPLIED_FILENAME.zip");
View Full Code Here

        data.addFeature(f3);
        SimpleFeatureSource fs = data.getFeatureSource("funnyLabels");
       
        // build the request objects and feed the output format
        GetFeatureType gft = WfsFactory.eINSTANCE.createGetFeatureType();
        Operation op = new Operation("GetFeature", getServiceDescriptor10(), null, new Object[] {gft});
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FeatureCollectionResponse fct =
            FeatureCollectionResponse.adapt(WfsFactory.eINSTANCE.createFeatureCollectionType());
        fct.getFeature().add(fs.getFeatures());
       
View Full Code Here

                    try {
                        Service service = new Service(operation.getService().getId(),
                                dynamicColorMapBuilder, null, null);
                        method = DynamicColorMapBuilder.class.getMethod("execute", new Class[] {
                                GetLegendGraphicRequest.class, Map.class, String.class });
                        Operation op = new Operation(id, service, method, new Object[] {
                                getLegendRequest, map, colorRamp });
                        return op;
                    } catch (SecurityException e) {
                        if (LOGGER.isLoggable(Level.SEVERE)) {
                            LOGGER.log(
View Full Code Here

                + "using the standard policy (e.g. there is nothing dynamic there");
        return null;
    }

    private GetMapRequest getGetMap(Request request) {
        Operation op = request.getOperation();
        Object parsedRequest = op.getParameters()[0];
        GetMapRequest getMap;

        if (parsedRequest instanceof GetMapRequest) {
            getMap = (GetMapRequest) parsedRequest;
        } else if (parsedRequest instanceof GetFeatureInfoRequest) {
View Full Code Here

        request.setQueryString("service=hello&request=hello&message=HelloWorld");

        dispatcher.callbacks.add(new AbstractDispatcherCallback() {
            @Override
            public Object operationExecuted(Request request, Operation operation, Object result) {
                Operation op = Dispatcher.REQUEST.get().getOperation();
                assertNotNull(op);
                assertTrue(op.getService().getService() instanceof HelloWorld);
                assertTrue(op.getParameters()[0] instanceof Message);
                return result;
            }
        });

        dispatcher.handleRequest(request, response);
View Full Code Here

        Service service = new Service("directCallService", serviceBean, new Version("1.0.0"),
                Collections.singletonList("concat"));
        Method method = serviceBean.getClass().getMethod("concat", String.class, String.class);
        Object[] parameters = {"p1", "p2"};
        Operation opDescriptor = new Operation("concat", service, method, parameters);

        Object result = dispatcher.execute(new Request(), opDescriptor);
        assertEquals("p1p2", result);
        assertTrue(invokeDirectCalled.get());
    }
View Full Code Here

TOP

Related Classes of org.geoserver.platform.Operation

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.