Package org.geoserver.rest.format

Examples of org.geoserver.rest.format.DataFormat


     * set the default format is used, ie the first format returned from
     * {@link #createSupportedFormats(Request, Response)}
     * </p>
     */
    protected DataFormat getFormatGet() {
        DataFormat df = null;
       
        //check if the client specified an extension
        String ext = (String) getRequest().getAttributes().get( "format" );
        if ( ext == null ) {
            ext = (String) getRequest().getAttributes().get( "type" );
View Full Code Here


     */
    protected DataFormat getFormatPostOrPut() {
        MediaType type = getRequest().getEntity().getMediaType();
        if ( type != null ) {
            //DataFormat format = getFormats().get( type.toString() );
            DataFormat format = lookupFormat( type );
            /*
            if ( format == null ) {
                //check the sub type
                String sub = type.getSubType();
                if ( sub != null ) {
View Full Code Here

    /*
     * Helper method for looking up a format based on a media type.
     */
    DataFormat lookupFormat( MediaType mt ) {
        //exact match
        DataFormat fmt = getFormats().get( mt );
       
        if ( fmt == null ) {
            //check for the case of a media type being "contained"
            for ( MediaType mediaType : getFormats().keySet() ) {
                if ( mediaType.includes( mt ) || mt.includes( mediaType ) ) {
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

     * set the default format is used, ie the first format returned from
     * {@link #createSupportedFormats(Request, Response)}
     * </p>
     */
    protected DataFormat getFormatGet() {
        DataFormat df = null;
       
        //check if the client specified an extension
        String ext = (String) getRequest().getAttributes().get( "format" );
        if ( ext == null ) {
            ext = (String) getRequest().getAttributes().get( "type" );
View Full Code Here

     */
    protected DataFormat getFormatPostOrPut() {
        MediaType type = getRequest().getEntity().getMediaType();
        if ( type != null ) {
            //DataFormat format = getFormats().get( type.toString() );
            DataFormat format = lookupFormat( type );
            /*
            if ( format == null ) {
                //check the sub type
                String sub = type.getSubType();
                if ( sub != null ) {
View Full Code Here

    /*
     * Helper method for looking up a format based on a media type.
     */
    DataFormat lookupFormat( MediaType mt ) {
        //exact match
        DataFormat fmt = getFormats().get( mt );
       
        if ( fmt == null ) {
            //check for the case of a media type being "contained"
            for ( MediaType mediaType : getFormats().keySet() ) {
                if ( mediaType.includes( mt ) || mt.includes( mediaType ) ) {
View Full Code Here

        }
       
        Style rasterized = remapStyle(defaultStyle, rasterSymbolizer, min, max, classes, ramp, layer);
       
        //check the format, if specified as sld, return the sld itself
            DataFormat format = getFormatGet();
        if ( format instanceof SLDFormat ) {
          return rasterized;
            }
        return defaultStyle;
      }
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.