Examples of WFS


Examples of org.jdesktop.wonderland.tools.wfs.WFS

        /*
         * Fetch the wfs manager and the WFS. If invalid, then return a bad
         * response.
         */
        WFSManager wfsm = WFSManager.getWFSManager();
        WFS wfs = wfsm.getWFS(wfsName);
        if (wfs == null) {
            logger.warning("Unable to find WFS with name " + wfsName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
        }
       
        /* Fetch the root directory, check if null, but should never be */
        WFSCellDirectory dir = wfs.getRootDirectory();
        if (dir == null) {
            logger.warning("WFSManager: Unable to find WFS root with name " + wfsName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
        }
View Full Code Here

Examples of org.jdesktop.wonderland.tools.wfs.WFS

        /*
         * Fetch the wfs manager and the WFS. If invalid, then return a bad
         * response.
         */
        WFSManager wfsm = WFSManager.getWFSManager();
        WFS wfs = wfsm.getWFS(wfsName);
        if (wfs == null) {
            logger.warning("Unable to find WFS with name " + wfsName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
        }
       
        /* Fetch the root directory, check if null, but should never be */
        WFSCellDirectory rootDir = wfs.getRootDirectory();
        if (rootDir == null) {
            logger.warning("WFSManager: Unable to find WFS root with name " + wfsName);
            ResponseBuilder rb = Response.status(Response.Status.BAD_REQUEST);
            return rb.build();
        }
       
        /*
         * Find out whether we should reload the WFS as we read it. We acquire
         * ownership of the WFS momentarily to tell it to reload
         */
        if (reload != null && reload.compareTo("true") == 0) {
            try {
                wfs.acquireOwnership();
                rootDir.setReload();
                wfs.release();
            } catch (InterruptedException excp) {
                logger.warning("WFSManager: Unable to set WFS to reload " + excp.toString());
            }
        }
       
View Full Code Here

Examples of org.jdesktop.wonderland.tools.wfs.WFS

        WFSManager manager = WFSManager.getWFSManager();
               
        // Fetch the WFS for the world root path, flag an error if it does
        // not yet exist.
        String rootPath = cellDescriptor.getRootPath().getRootPath();
        WFS wfs = manager.getWFS(cellDescriptor.getRootPath());
        if (wfs == null) {
            logger.warning("[WFS] The WFS " + rootPath + " does not exist.");
            return Response.status(Status.BAD_REQUEST).build();
        }
       
        // Fetch the root directory, this should exist
        WFSCellDirectory wfsDirectory = wfs.getRootDirectory();
        if (wfsDirectory == null) {
            logger.warning("[WFS] Unable to find root directory for " + rootPath);
            return Response.status(Response.Status.BAD_REQUEST).build();
        }
       
        // Iterate through all of the parents of the cell and fetch the proper
        // directory to place the new cell in. We fetch the names of the parent
        // cell individually and jump down through the list of directories. Note
        // that all of the directories, except perhaps the last should exist,
        // so we flag an error if that is not the case. If the parent path is
        // null, then this is a cell at the root of the wfs
        if (cellDescriptor.getParentPath() != null) {
            String parentCells[] = cellDescriptor.getParentPath().getParentPaths();
            for (int i = 0; i < parentCells.length; i++) {
                // First fetch the cell. If it does not exist, then return a bad
                // response.
                WFSCell parentCell = wfsDirectory.getCellByName(parentCells[i]);
                if (parentCell == null) {
                    logger.warning("[WFS] Unable to find cell " + parentCells[i] +
                            " in WFS " + rootPath);
                    return Response.status(Response.Status.BAD_REQUEST).build();
                }

                // Next, get the directory associated with the cell. It also needs
                // to exist, otherwise, return a bad response. The only exception
                // is the last parent in the cell, which may not have its child
                // directory yet created.
                wfsDirectory = parentCell.getCellDirectory();
                if (i < parentCells.length - 1 && wfsDirectory == null) {
                    // This means that a parent cell directory, other than the
                    // immediate parent does not exist (which means the immediate
                    // parent cell does not exist, which is very bad!
                    logger.warning("[WFS] Unable to find directory for cell " +
                            parentCells[i] + " in WFS " + rootPath);
                    return Response.status(Response.Status.BAD_REQUEST).build();
                }
                else if (wfsDirectory == null) {
                    // Unless we are talking about the cell directory associated
                    // with the parent. In which case we should create it.
                    try {
                        wfs.acquireOwnership();
                        wfsDirectory = parentCell.createCellDirectory();
                        parentCell.write();
                    } catch (java.lang.InterruptedException excp) {
                        logger.log(Level.WARNING, "[WFS] Unable to lock WFS " +
                                rootPath, excp);
                        return Response.status(Response.Status.BAD_REQUEST).build();
                    } catch (java.lang.Exception excp) {
                        logger.log(Level.WARNING, "[WFS] Failed to create WFS " +
                                " directory " + rootPath);
                        return Response.status(Response.Status.BAD_REQUEST).build();
                    } finally {
                        wfs.release();
                    }
                }
            }
        }
       
        // When we have reached here, the directory in which to place the new
        // cell is in 'wfsDirectory'. We create the cell and write the WFS
        // back out to its disk. In this case, the cell name is the name of
        // the file, which should be <Cell Name>-<Cell ID>.
        try {
            wfs.acquireOwnership();
            String cellName = cellDescriptor.getCellUniqueName();
            WFSCell cell = wfsDirectory.addCell(cellName);
            if (cell == null) {
                logger.warning("[WFS] Failed to create cell " + cellName +
                        " in WFS " + rootPath);
                return Response.status(Response.Status.BAD_REQUEST).build();
            }
            cell.setCellSetup(cellDescriptor.getSetupInfo());
            wfsDirectory.write();
        } catch (java.lang.Exception excp) {
            logger.log(Level.WARNING, "[WFS] Unable to lock WFS " + rootPath, excp);
            return Response.status(Response.Status.BAD_REQUEST).build();
        } finally {
            wfs.release();
        }
        return Response.ok().build();
    }
View Full Code Here

Examples of org.vfny.geoserver.global.WFS

        //
        // And allways remember to release locks if we are failing:
        // - if we fail to aquire all the locks we will need to fail and
        //   itterate through the the FeatureSources to release the locks
        //
        WFS wfs = request.getWFS();
        GeoServer config = wfs.getGeoServer();
        Data catalog = wfs.getData();
        FeatureTypeInfo meta = null;
        NameSpaceInfo namespace;
        Query query;

        FeatureSource source;
View Full Code Here

Examples of org.vfny.geoserver.global.WFS

    beans.put("catalog", new DefaultGeoServerCatalog());
    beans.put("controller", new PreferenceStoreImpl(new BlankStore()));
   
    wfsDTO.setService(new ServiceDTO());
    wfsDTO.getService().setEnabled(wfsEnabled );
    beans.put("wfs", new WFS(wfsDTO));
   
    wmsDTO.setService(new ServiceDTO());
    wmsDTO.getService().setEnabled(wmsEnabled);
    beans.put("wms", new WMS(wmsDTO));
  }
View Full Code Here

Examples of org.vfny.geoserver.global.WFS

  public IStatusReport checkStatus() {
    int status = IStatusReport.OKAY;
    Exception message = null;
   
    WFS wfs = null;
    try {
      wfs = (WFS) applicationContext.getBean("wfs");
    } catch (Exception e) {
      status = IStatusReport.ERROR;
      message = e;
      return new DefaultStatusReport(NAME, status, message);
    }
   
    if (wfs == null) {
      status = IStatusReport.ERROR;
      message = new Exception("WFS failed to load. Please check server logs");
    } else if (!wfs.isEnabled()) {
      status = IStatusReport.ERROR;
      message = new Exception("WFS service is currently disabled");
    }
   
    return new DefaultStatusReport(NAME, status, message);
View Full Code Here

Examples of org.vfny.geoserver.global.WFS

    //UserContainer user,
    HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {
        ServletContext sc = request.getSession().getServletContext();

        WFS wfs = getWFS(request);

        if (wfs == null) {
            // lazy creation on load?
            loadGeoserver(mapping, form, request, response);
        }
View Full Code Here

Examples of org.vfny.geoserver.global.WFS

        /**
         * DOCUMENT ME!
         */
        private void handleService() {
            WFS wfs = request.getWFS();
            start("Service");
            element("Name", wfs.getName());
            element("Title", wfs.getTitle());
            element("Abstract", wfs.getAbstract());

            List kwlist = wfs.getKeywords();
            handleKeywords(kwlist);

            URL or = wfs.getOnlineResource();
            element("OnlineResource", (or == null) ? "" : or.toExternalForm());
            element("Fees", wfs.getFees());
            element("AccessConstraints", wfs.getAccessConstraints());
            end("Service");
        }
View Full Code Here

Examples of org.vfny.geoserver.global.WFS

        /**
         * DOCUMENT ME!
         */
        private void handleCapability() {
            WFS config = request.getWFS();

            start("Capability");
            start("Request");
            handleGetCapabilities();
            handleDescribeFT();
            handleGetFeature();

    if (config.getServiceLevel() >= WFSDTO.TRANSACTIONAL) {
                handleTransaction();
            }

    if (config.getServiceLevel() == WFSDTO.COMPLETE) {
                handleLock();
                handleFeatureWithLock();
            }

            end("Request");
View Full Code Here

Examples of org.vfny.geoserver.global.WFS

          //DJB: (see above comment, this fixes it0
          //      WFS config now has a "citeConformanceHacks" boolean in it.
          //      true --> only publish GML2 in caps file
          //      false -> publish all
            WFS config = request.getWFS();
            boolean onlyGML2 = config.getCiteConformanceHacks();
           
            if (onlyGML2)
            {
              element("GML2",null);
            }
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.