Examples of toRepresentation()


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

        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

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

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

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

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

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

        }
        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

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

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

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

        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

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

        Request request = new Request();
        request.setResourceRef( "http://localhost/rest/foo.html");
        request.getResourceRef().setBaseRef( "http://localhost/rest");
       
        ReflectiveHTMLFormat fmt = new ReflectiveHTMLFormat(Foo.class,request,null,null);
        Representation rep = fmt.toRepresentation(new Foo("one",2,3.0));
        rep.write(System.out);
    }
   
}
View Full Code Here

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

                }
                zout.flush();
                zout.close();
            }
        };
        getResponse().setEntity( fmt.toRepresentation( directory ) );
    }
   
    @Override
    public void handlePut() {
        String workspace = (String)getRequest().getAttributes().get("workspace");
View Full Code Here

Examples of org.restlet.engine.converter.ConverterHelper.toRepresentation()

                    } else {
                        target = new Variant();
                    }
                }

                result = ch.toRepresentation(source, target, resource);

                if (result != null) {
                    // Copy the variant metadata if necessary
                    if (result.getCharacterSet() == null) {
                        result.setCharacterSet(target.getCharacterSet());
View Full Code Here

Examples of org.restlet.service.ConverterService.toRepresentation()

*/
public class JaxbBasicConverterTestCase extends RestletTestCase {

    public void testObjectionToRepresentation() {
        ConverterService cs = new ConverterService();
        Representation rep = cs.toRepresentation(new Sample(), new Variant(
                MediaType.APPLICATION_XML), null);
        assertTrue(rep instanceof JaxbRepresentation<?>);
    }

    public void testRepresentationToObject() throws IOException, JAXBException {
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.