Package org.vfny.geoserver.global

Examples of org.vfny.geoserver.global.WMS


    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


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

        /**
         * Encodes the service metadata section of a WMS capabilities document.
         */
        private void handleService() {
            WMS wms = request.getWMS();
            start("Service");

            element("Name", "OGC:WMS");
            element("Title", wms.getTitle());
            element("Abstract", wms.getAbstract());

            handleKeywordList(wms.getKeywords());

            AttributesImpl orAtts = new AttributesImpl();
            orAtts.addAttribute("", "xmlns:xlink", "xmlns:xlink", "", XLINK_NS);
            orAtts.addAttribute(XLINK_NS, "xlink:type", "xlink:type", "",
                "simple");
            orAtts.addAttribute("", "xlink:href", "xlink:href", "",
                wms.getOnlineResource().toExternalForm());
            element("OnlineResource", null, orAtts);

            element("Fees", wms.getFees());
            element("AccessConstraints", wms.getAccessConstraints());
            end("Service");
        }
View Full Code Here

        /**
         * DOCUMENT ME!
         */
        private void handleRequest() {
            WMS wms = request.getWMS();
            start("Request");

            start("GetCapabilities");
            element("Format", WMS_CAPS_MIME);

View Full Code Here

        /**
         * DOCUMENT ME!
         */
        private void handleSLD() {
            AttributesImpl sldAtts = new AttributesImpl();
            WMS config = request.getWMS();
            String supportsSLD = config.supportsSLD() ? "1" : "0";
            String supportsUserLayer = config.supportsUserLayer() ? "1" : "0";
            String supportsUserStyle = config.supportsUserStyle() ? "1" : "0";
            String supportsRemoteWFS = config.supportsRemoteWFS() ? "1" : "0";
            sldAtts.addAttribute("", "SupportSLD", "SupportSLD", "", supportsSLD);
            sldAtts.addAttribute("", "UserLayer", "UserLayer", "",
                supportsUserLayer);
            sldAtts.addAttribute("", "UserStyle", "UserStyle", "",
                supportsUserStyle);
View Full Code Here

         *       the WMS service decoupled from the feature types configured
         *       for the server instance. (This involves nested layers,
         *       gridcoverages, etc)
         */
        private void handleLayers() {
            WMS wms = request.getWMS();
            start("Layer");

            Data catalog = wms.getData();
            Collection ftypes = catalog.getFeatureTypeInfos().values();
            FeatureTypeInfo layer;

            element("Title", wms.getTitle());
            element("Abstract", wms.getAbstract());

            handleRootSRSAndBbox(ftypes);

            //now encode each layer individually
            for (Iterator it = ftypes.iterator(); it.hasNext();) {
View Full Code Here

    String layer = getValue("LAYER");
    FeatureTypeInfo fti;
    FeatureType ft;

    try {
      WMS wms = request.getWMS();
      Data catalog = wms.getData();
      fti = catalog.getFeatureTypeInfo(layer);
      ft = fti.getFeatureType();
    } catch (NoSuchElementException e) {
      throw new WmsException(layer + " layer does not exists.",
          "LayerNotDefined");
View Full Code Here

  public HttpServletRequest getHttpServletRequest() throws ClassCastException {
    return httpServletRequest;
  }
 
  public WMS getWMS(){
    WMS vp = Requests.getWMS( getHttpServletRequest() );
    return vp;
  }
View Full Code Here

     *      org.apache.struts.config.ModuleConfig)
     */
    public void init(ActionServlet arg0, ModuleConfig arg1)
        throws ServletException {
        ServletContext sc = arg0.getServletContext();
        WMS wms = (WMS) sc.getAttribute(WMS.WEB_CONTAINER_KEY);
        WFS wfs = (WFS) sc.getAttribute(WFS.WEB_CONTAINER_KEY);

        if (wms == null || wfs == null) {
            GeoServerPlugIn gspi = new GeoServerPlugIn();
            gspi.init(arg0, arg1);
            wms = (WMS) sc.getAttribute(WMS.WEB_CONTAINER_KEY);
            wfs = (WFS) sc.getAttribute(WFS.WEB_CONTAINER_KEY);

            if (wms == null || wfs == null) {
                throw new ServletException(
                    "GeoServerPlugIn Failed. Thus ConfigPlugIn cannot run.");
            }
        }

        sc.setAttribute(WMSConfig.CONFIG_KEY, new WMSConfig((WMSDTO)wms.toDTO()));
        sc.setAttribute(WFSConfig.CONFIG_KEY, new WFSConfig((WFSDTO)wfs.toDTO()));
        sc.setAttribute(GlobalConfig.CONFIG_KEY,
            new GlobalConfig((GeoServerDTO)wfs.getGeoServer().toDTO()));
        sc.setAttribute(DataConfig.CONFIG_KEY, new DataConfig((DataDTO)wfs.getData().toDTO()));
       
View Full Code Here

    ArrayList ftnsList = new ArrayList();
   
    // 1) get the capabilities info so we can find out our feature types
    CapabilitiesRequest capRequest = new CapabilitiesRequest("WMS");
    capRequest.setHttpServletRequest(request);
    WMS wms = capRequest.getWMS();
    Data catalog = wms.getData();
    Collection ftypes = catalog.getFeatureTypeInfos().values();
    FeatureTypeInfo layer;
   
    // 2) delete any existing generated files in the generation directory
    ServletContext sc = request.getSession().getServletContext();
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.global.WMS

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.