Package org.geoserver.rest.format

Examples of org.geoserver.rest.format.DataFormat


    public void handleGet() {

        GeoXACMLConfig.reload();

        // 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

               
                //TODO: update the layers pointing at this coverage
            }
           
            //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

       
        LOGGER.fine( "GET style " + style );
        StyleInfo sinfo = catalog.getStyleByName( style );
       
        //check the format, if specified as sld, return the sld itself
        DataFormat format = getFormatGet();
        if ( format instanceof SLDFormat ) {
            try {
                return sinfo.getStyle();
            }
            catch (IOException e) {
View Full Code Here

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

     *
     * @see #handleObjectPost(Object)
     */
    @Override
    public final void handlePost() {
        DataFormat format = getFormatPostOrPut();
        Object object = format.toObject( getRequest().getEntity() );
        String location = null;
        try {
            location = handleObjectPost(object);
        }
        catch (Exception e) {
View Full Code Here

     *
     * @see #handleObjectPost(Object)
     */
    @Override
    public final void handlePut() {
        DataFormat format = getFormatPostOrPut();
        Object object = format.toObject( getRequest().getEntity() );
        try {
            handleObjectPut(object);
        }
        catch (Exception e) {
            handleException(e);
View Full Code Here

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

     * then calling {@link #postMap(Map)}.
     * </p>
     */
    @Override
    public void handlePost() {
        DataFormat format = getFormatPostOrPut();
        Map map = (Map) format.toObject(getRequest().getEntity());
        try {
            postMap(map);
        }
        catch (Exception e) {
            throw new RestletException( "", Status.SERVER_ERROR_INTERNAL, e );
View Full Code Here

     * then calling {@link #putMap(Map)}.
     * </p>
     */
    @Override
    public void handlePut() {
        DataFormat format = getFormatPostOrPut();
        Map map = (Map) format.toObject(getRequest().getEntity());
        try {
            putMap(map);
        }
        catch (Exception e) {
            throw new RestletException( "", Status.SERVER_ERROR_INTERNAL, e );
View Full Code Here

TOP

Related Classes of org.geoserver.rest.format.DataFormat

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.