Package org.vfny.geoserver.global.dto

Examples of org.vfny.geoserver.global.dto.DataDTO


        ServletContext sc = request.getSession().getServletContext();

        WMSDTO wmsDTO = null;
        WFSDTO wfsDTO = null;
        GeoServerDTO geoserverDTO = null;
        DataDTO dataDTO = null;
        //DJB: changed for geoserver_data_dir   
       // File rootDir = new File(sc.getRealPath("/"));
       
        File rootDir =  GeoserverDataDirectory.getGeoserverDataDirectory(sc);
View Full Code Here


     * </p>
     *
     * @return DataDTO the generated object
     */
    public Object toDTO() {
        DataDTO dto = new DataDTO();

        HashMap tmp;
        Iterator i;
        tmp = new HashMap();
        i = nameSpaces.keySet().iterator();

        while (i.hasNext()) {
            NameSpaceInfo nsi = (NameSpaceInfo) nameSpaces.get(i.next());
            tmp.put(nsi.getPrefix(), nsi.toDTO());
        }

        dto.setNameSpaces(tmp);

        if (defaultNameSpace != null) {
            dto.setDefaultNameSpacePrefix(defaultNameSpace.getPrefix());
        }

        tmp = new HashMap();
        i = styles.keySet().iterator();

        while (i.hasNext()) {
            String id = (String) i.next();
            Style st = (Style) styles.get(id);
            StyleDTO sdto = new StyleDTO();
            sdto.setDefault(st.isDefault());
            sdto.setFilename((File) stFiles.get(id));
            sdto.setId(id);
            tmp.put(id, sdto);
        }

        LOGGER.finer("setting styles to: " + tmp);
        dto.setStyles(tmp);

        tmp = new HashMap();
        i = dataStores.keySet().iterator();

        while (i.hasNext()) {
            DataStoreInfo dsi = (DataStoreInfo) dataStores.get(i.next());
            tmp.put(dsi.getId(), dsi.toDTO());
        }

        dto.setDataStores(tmp);

        tmp = new HashMap();
        i = errors.keySet().iterator();

        while (i.hasNext()) {
            FeatureTypeInfoDTO fti = (FeatureTypeInfoDTO) i.next();
            tmp.put(fti.getKey(), fti.clone());   //DJB:  changed to getKey() from getName() which was NOT unique!
        }

        dto.setFeaturesTypes(tmp);

        return dto;
    }
View Full Code Here

                new StyleConfig((StyleDTO) data.getStyles().get(key)));
        }
    }

    public DataDTO toDTO() {
        DataDTO dt = new DataDTO();
        HashMap tmp = null;
        Iterator i = null;

        tmp = new HashMap();
        dt.setDataStores(tmp);
        i = dataStores.keySet().iterator();

        while (i.hasNext()) {
            Object key = i.next();
            tmp.put(key, ((DataStoreConfig) dataStores.get(key)).toDTO());
        }

        tmp = new HashMap();
        dt.setFeaturesTypes(tmp);
        i = featuresTypes.keySet().iterator();

        while (i.hasNext()) {
            Object key = i.next();
            tmp.put(key, ((FeatureTypeConfig) featuresTypes.get(key)).toDTO());
        }

        tmp = new HashMap();
        dt.setStyles(tmp);
        i = styles.keySet().iterator();

        while (i.hasNext()) {
            Object key = i.next();
            tmp.put(key, ((StyleConfig) styles.get(key)).toDTO());
        }

        tmp = new HashMap();
        dt.setNameSpaces(tmp);
        i = nameSpaces.keySet().iterator();

        while (i.hasNext()) {
            Object key = i.next();
            tmp.put(key, ((NameSpaceConfig) nameSpaces.get(key)).toDTO());

            if (((NameSpaceInfoDTO) tmp.get(key)).isDefault()) {
                dt.setDefaultNameSpacePrefix(((NameSpaceInfoDTO) tmp.get(key))
                    .getPrefix());
            }
        }

        return dt;
View Full Code Here

    protected XMLConfigReader(ServletContext context) {
      this.context = context;
      wms = new WMSDTO();
        wfs = new WFSDTO();
        geoServer = new GeoServerDTO();
        data = new DataDTO();
        root = new File(".");
    }
View Full Code Here

        this.root = root;
        this.context = context;
        wms = new WMSDTO();
        wfs = new WFSDTO();
        geoServer = new GeoServerDTO();
        data = new DataDTO();
        load();
        initialized = true;
       
    }
View Full Code Here

        try {
            WMSDTO wmsDTO = getWMSConfig().toDTO();
            WFSDTO wfsDTO = getWFSConfig().toDTO();
            GeoServerDTO geoserverDTO = getGlobalConfig().toDTO();
            DataDTO dataDTO = getDataConfig().toDTO();

            getWFS(request).load(wfsDTO);
            getWMS(request).load(wmsDTO);
            getWFS(request).getGeoServer().load(geoserverDTO,sc);
            getWFS(request).getData().load(dataDTO);
View Full Code Here

   * @throws ConfigurationException
   * @throws IOException
   */
  public static Data createTestCiteData(GeoServer geoserver)
      throws ConfigurationException, IOException {
    DataDTO dataDto = new DataDTO();
    File dir = null;
    URL testDataUrl = MockUtils.class.getResource("/test-data");
    if (!"file".equals(testDataUrl.getProtocol())) {
      throw new IOException("unsupported protocol: "
          + testDataUrl.getProtocol());
    }
    String url = testDataUrl.toExternalForm();
    String testPath = url.substring("file:".length());
    dir = new File(testPath);
    if (!dir.exists() || !dir.isDirectory()) {
      throw new ConfigurationException(
          "Expected cite test dataset directory at " + dir);
    }

    Map dataStores = createDataStoresMap();
    dataDto.setDataStores(dataStores);

    Map featureTypes = createFeatureTypes();
    dataDto.setFeaturesTypes(featureTypes);

    Map nameSpaces = createNameSpaces();
    dataDto.setNameSpaces(nameSpaces);
    dataDto.setDefaultNameSpacePrefix("cite");

    Map styles = createStyles(new File(dir, "styles"));
    dataDto.setStyles(styles);

    Data catalog = new Data(dataDto, dir, geoserver);
    return catalog;
  }
View Full Code Here

        boolean r = true;

        if (r) {
            r = r && (cfe.getData() != null);
            r = r && !cfe.getData().equals(new DataDTO());
            r = r && (cfe.getWfs() != null);
            r = r && !cfe.getWfs().equals(new WFSDTO());
            r = r && (cfe.getWms() != null);
            r = r && !cfe.getWms().equals(new WMSDTO());
        }
View Full Code Here

        new File(root1, "catalog.xml"));
        } catch (ConfigurationException e) {
            fail(e.toString());
        }

        DataDTO c = cfe.getData();
        boolean r = true;
        r = r && (c != null);

        if (r) {
            r = r && (c.getDataStores() != null);
            r = r && (c.getNameSpaces() != null);
            r = r && (c.getStyles() != null);
            r = r && !c.getDataStores().equals(new HashMap());
            r = r && !c.getNameSpaces().equals(new HashMap());
            r = r && !c.getStyles().equals(new HashMap());
        }

        assertTrue(r);
    }
View Full Code Here

        boolean r = true;

        if (r) {
            r = r && (m.getData() != null);
            r = r && !m.getData().equals(new DataDTO());
            r = r && (m.getWfs() != null);
            r = r && !m.getWfs().equals(new WFSDTO());
            r = r && (m.getWms() != null);
            r = r && !m.getWms().equals(new WMSDTO());

            DataDTO c = m.getData();
            r = r && (c != null);

            if (r) {
                r = r && (c.getDataStores() != null);
                r = r && (c.getFeaturesTypes() != null);
                r = r && (c.getNameSpaces() != null);
                r = r && (c.getStyles() != null);
                r = r && !c.getDataStores().equals(new HashMap());
                r = r && !c.getFeaturesTypes().equals(new HashMap());
                r = r && !c.getNameSpaces().equals(new HashMap());
                r = r && !c.getStyles().equals(new HashMap());

                Map mp = c.getFeaturesTypes();
                r = r && (m != null);

                if (r) {
                    Iterator i = mp.keySet().iterator();
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.global.dto.DataDTO

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.