Package org.geoserver.rest.format

Examples of org.geoserver.rest.format.DataFormat.toRepresentation()


        // get the appropriate format
        DataFormat format = getFormatGet();

        // transform the string "Hello World" to the appropriate response
        getResponse().setEntity(format.toRepresentation(ReloadedMsg));
    }

}
View Full Code Here


        List<String> l = fileStorage.handleUpload(contentType, content, myIDGenerator, rootPath);
        Map<String, List<String>> m = new HashMap<String, List<String>>();
        m.put("files", l);
        DataFormat outputFormat = new MapJSONFormat();
        resp.setEntity(outputFormat.toRepresentation(m));
        resp.setStatus(Status.SUCCESS_CREATED);

        if (l.size() == 1) {
            resp.setRedirectRef(new Reference(req.getResourceRef(), l.get(0)));
        }
View Full Code Here

            }
           
            //poach the coverage store data format
            DataFormat df = new CoverageStoreResource(getContext(),request,response,catalog)
                .createXMLFormat(request, response);
            response.setEntity(df.toRepresentation(info));
            response.setStatus(Status.SUCCESS_CREATED);
        }
        catch( Exception e ) {
            throw new RestletException( "Error auto-configuring coverage", Status.SERVER_ERROR_INTERNAL, e );
        }
View Full Code Here

     */
    @Override
    public final void handleGet() {
        DataFormat format = getFormatGet();
        try {
            getResponse().setEntity(format.toRepresentation(handleObjectGet()));
        }
        catch (Exception e) {
            handleException(e);
        }
    }
View Full Code Here

        }
        catch (Exception e) {
            throw new RestletException( "", Status.SERVER_ERROR_INTERNAL, e );
        }
        DataFormat format = getFormatGet();
        getResponse().setEntity(format.toRepresentation(map));
    }

    /**
     * Returns the map representation of the underlying target object in a GET request.
     * <p>
 
View Full Code Here

     */
    @Override
    public final void handleGet() {
        DataFormat format = getFormatGet();
        try {
            getResponse().setEntity(format.toRepresentation(handleObjectGet()));
        }
        catch (Exception e) {
            handleException(e);
        }
    }
View Full Code Here

        }
        else {
            data = context().getData();
        }

        getResponse().setEntity(formatGet.toRepresentation(data));
    }

    public class ImportDataJSONFormat extends StreamDataFormat {

        protected ImportDataJSONFormat(MediaType type) {
View Full Code Here

        // get the appropriate format
        DataFormat format = getFormatGet();

        // transform the string "Hello World" to the appropriate response
        getResponse().setEntity(format.toRepresentation(ReloadedMsg));
    }

}
View Full Code Here

       
        KmlEncodingContext encodingContext = new KmlEncodingContext(webMap.getMapContent(), wms, true);
        KmlEncodingBundle kml = buildKml(encodingContext);

        DataFormat format = getFormatGet();
        Representation representation = format.toRepresentation(kml);
        Response response = getResponse();
        response.setEntity(representation);
    }

    private KmlEncodingBundle buildKml(KmlEncodingContext encodingContext) {
View Full Code Here

    }

    @Override
    public void handleGet() {
        DataFormat format = getFormatGet();
        getResponse().setEntity(format.toRepresentation(catalog));
    }

    /**
     * @see org.geoserver.rest.AbstractResource#createSupportedFormats(org.restlet.data.Request,
     *      org.restlet.data.Response)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.