Package it.geosolutions.geostore.services.rest.model

Examples of it.geosolutions.geostore.services.rest.model.RESTResource


        layerUpdate.setAttribute(UNREDDLayerUpdate.Attributes.YEAR, year);
    if (month!=null) {
            layerUpdate.setAttribute(UNREDDLayerUpdate.Attributes.MONTH, month);
        }

        RESTResource res = layerUpdate.createRESTResource();
    res.setName(NameUtils.buildLayerUpdateName(name, year, month, day));
        res.setData(content);

        return res;
  }
View Full Code Here


   */
  public  static RESTResource createLayerResource(String name, List<ShortAttribute> optionalAttributes){
        UNREDDLayer layer = new UNREDDLayer();
//        layer.setAttribute(Attributes.DESTRELATIVEPATH, path);

        RESTResource res = layer.createRESTResource();
    res.setName(name);

    if (optionalAttributes!=null) {
            res.getAttribute().addAll(optionalAttributes);
    }

        return res;
  }
View Full Code Here

        UNREDDStatsDef statsDef = new UNREDDStatsDef();

        statsDef.addReverseAttribute(UNREDDStatsDef.ReverseAttributes.LAYER, layers);

        RESTResource res = statsDef.createRESTResource();
        res.setName(name);
        res.setData(xml);

        return res;
  }
View Full Code Here

        statsData.setAttribute(UNREDDStatsData.Attributes.YEAR, year);
    if (month!=null) {
            statsData.setAttribute(UNREDDStatsData.Attributes.MONTH, month);
        }

        RESTResource res = statsData.createRESTResource();
    res.setName(NameUtils.buildStatsDataName(statsDefName, year, month, day));
        res.setData(content);
       
        return res;
  }
View Full Code Here

        UNREDDChartScript chartScript = new UNREDDChartScript();
        chartScript.setAttribute(UNREDDChartScript.Attributes.SCRIPTPATH, script);
        chartScript.addReverseAttribute(ReverseAttributes.STATSDEF, statsdef);

    RESTResource res = chartScript.createRESTResource();
    res.setName(name);

    return res;
  }
View Full Code Here

        }
    }

    public void insertStatsData(String statsDefName, String year, String month, String day, String content) throws GeoStoreException {
        try {
            RESTResource statsDataResource = createStatsDataResource(statsDefName, year, month, day, content);
            insert(statsDataResource);
        } catch (Exception e) {
            throw new GeoStoreException("Error while inserting StatsData: " + statsDefName, e);
        }
    }
View Full Code Here

                createAttributeFilter(UNREDDChartData.Attributes.PUBLISHED, "true"));
        return search(filter, false);
    }

    public void insertLayerUpdate(String layername, String year, String month, String day) throws GeoStoreException {
        RESTResource res = createLayerUpdate(layername, year, month, day);
        try {
            insert(res);
        } catch (Exception e) {
            LOGGER.error("Error while inserting LayerUpdate: " + res, e);
            throw new GeoStoreException("Error while inserting LayerUpdate on Layer " + layername, e);
View Full Code Here

        }
        if (day != null) {
            statsData.setAttribute(UNREDDStatsData.Attributes.DAY, day);
        }

        RESTResource res = statsData.createRESTResource();

        String resName = NameUtils.buildStatsDataName(statsDefName, year, month, day);
        res.setName(resName);

        RESTStoredData storedData = new RESTStoredData();
        storedData.setData(csv);

        res.setStore(storedData);

        return res;
    }
View Full Code Here

        UNREDDChartScript chartScript = new UNREDDChartScript();
        chartScript.setAttribute(Attributes.SCRIPTPATH, testScript.getAbsolutePath());
        chartScript.addReverseAttribute(ReverseAttributes.STATSDEF, "area_admin1_fc13"); // any one is good

        RESTResource chartScriptRes = chartScript.createRESTResource();
        chartScriptRes.setName("testChartScript");
//        long chartScriptId = geostoreClient.insert(chartScriptRes);
        long chartScriptId = gstcu.insert(chartScriptRes);
//        Resource fullChartScript = geostoreClient.getResource(chartScriptId);
        Resource fullChartScript = gstcu.getGeoStoreClient().getResource(chartScriptId);
View Full Code Here

            layerUpdate.setAttribute(UNREDDLayerUpdate.Attributes.MONTH, month);
        }
        if (day != null) {
            layerUpdate.setAttribute(UNREDDLayerUpdate.Attributes.DAY, day);
        }
        RESTResource res = layerUpdate.createRESTResource();
        String resName = NameUtils.buildLayerUpdateName(layername, year, month, day);
        res.setName(resName);
        return res;
    }
View Full Code Here

TOP

Related Classes of it.geosolutions.geostore.services.rest.model.RESTResource

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.