Package org.geoserver.wfs.request

Examples of org.geoserver.wfs.request.TransactionRequest$WFS11


                lock.setTypeName(qualifyTypeName(lock.getTypeName(), workspace, ns));
            }
            return;
        }
       
        TransactionRequest t = TransactionRequest.adapt(
            OwsUtils.parameter(operation.getParameters(), EObject.class));
        if (t != null) {
            for (TransactionElement el : t.getElements()) {
                if (el instanceof Insert) {
                    Insert in = (Insert) el;
                    //in the insert case the objects are gt feature types which are not mutable
                    // so we just check them and throw an exception if a name does not match
                    for (Iterator j = in.getFeatures().iterator(); j.hasNext(); ) {
View Full Code Here


        assertNotNull(scriptMgr.lookupWfsTxHook(script));
    }

    public void testHookExecution() throws Exception {
        File script = copyOverFile("tx");
        TransactionRequest tx = new TransactionRequest.WFS11(null);
        TransactionResponse res = new TransactionResponse.WFS11(null);

        Map context = new HashMap();

        ScriptEngine eng = scriptMgr.createNewEngine(script);
View Full Code Here

    }

    public void testHookError() throws Exception {
        File script = copyOverFile("tx-error");
       
        TransactionRequest tx = new TransactionRequest.WFS11(null);
        TransactionResponse res = new TransactionResponse.WFS11(null);

        Map context = new HashMap();

        ScriptEngine eng = scriptMgr.createNewEngine(script);
View Full Code Here

        }
        return request;
    }

    public void preInsert(TransactionEvent event) throws WFSException {
        TransactionRequest request = TransactionRequest.adapt(event.getRequest());
        Map context = request.getExtendedProperties();

        try {
            hook.handlePreInsert(fw.read(), event.getAffectedFeatures(), request, context);
        } catch (WFSException e) {
            throw e;
View Full Code Here

            LOGGER.log(Level.WARNING, "Error occured in pre insert hook", e);
        }
    }

    public void postInsert(TransactionEvent event) throws WFSException {
        TransactionRequest request = TransactionRequest.adapt(event.getRequest());
        Map context = request.getExtendedProperties();

        try {
            hook.handlePostInsert(fw.read(), event.getAffectedFeatures(), request, context);
        } catch (WFSException e) {
            throw e;
View Full Code Here

            LOGGER.log(Level.WARNING, "Error occured in post insert hook", e);
        }
    }

    public void preUpdate(TransactionEvent event) throws WFSException {
        TransactionRequest request = TransactionRequest.adapt(event.getRequest());

        Map<String,Object> props = updateProperties(event);
        Map context = request.getExtendedProperties();

        try {
            hook.handlePreUpdate(fw.read(), event.getAffectedFeatures(), props, request, context);
        } catch (WFSException e) {
            throw e;
View Full Code Here

            LOGGER.log(Level.WARNING, "Error occured in pre update hook", e);
        }
    }

    public void postUpdate(TransactionEvent event) throws WFSException {
        TransactionRequest request = TransactionRequest.adapt(event.getRequest());

        Map<String,Object> props = updateProperties(event);
        Map context = request.getExtendedProperties();

        try {
            hook.handlePostUpdate(fw.read(), event.getAffectedFeatures(), props, request, context);
        } catch (WFSException e) {
            throw e;
View Full Code Here

            LOGGER.log(Level.WARNING, "Error occured in post update hook", e);
        }
    }

    public void preDelete(TransactionEvent event) throws WFSException  {
        TransactionRequest request = TransactionRequest.adapt(event.getRequest());
        Map context = request.getExtendedProperties();

        try {
            hook.handlePreDelete(fw.read(), event.getAffectedFeatures(), request, context);
        } catch (WFSException e) {
            throw e;
View Full Code Here

    public void afterTransaction(TransactionType request, TransactionResponseType result, boolean committed) {
        try {
            Map context = request.getExtendedProperties();

            ScriptEngine eng = fw.read();
            TransactionRequest txReq = TransactionRequest.adapt(request);
            TransactionResponse txRes = TransactionResponse.adapt(result);

            if (committed) {
                hook.handlePostCommit(eng, txReq, txRes, context);
            }
View Full Code Here

TOP

Related Classes of org.geoserver.wfs.request.TransactionRequest$WFS11

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.