Package org.vfny.geoserver.global.dto

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


    beans = new HashMap();
   
    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


     * </p>
     *
     * @see GeoServer#GeoServer()
     */
    WMS() {
        super(new ServiceDTO());
    }
View Full Code Here

     * </p>
     *
     * @see GeoServer#GeoServer()
     */
    WFS() {
        super(new ServiceDTO());
    }
View Full Code Here

    public String getTitle() {
        return title;
    }
   
    Object toDTO(){
      ServiceDTO dto = new ServiceDTO();
      dto.setAccessConstraints(accessConstraints);
      dto.setEnabled(enabled);
      dto.setFees(fees);
      dto.setKeywords(keywords);
      dto.setMaintainer(maintainer);
      dto.setName(name);
      dto.setOnlineResource(onlineResource);
      dto.setAbstract(serverAbstract);
      dto.setTitle(title);
      return dto;
    }
View Full Code Here

        if (dto == null) {
            throw new NullPointerException(
                "Service Data Transfer Object required");
        }

        ServiceDTO s = (ServiceDTO) dto;
        enabled = s.isEnabled();
        name = s.getName();
        title = s.getTitle();
        _abstract = s.getAbstract();

        try {
            keywords = new String[s.getKeywords().length];

            for (int i = 0; i < keywords.length; i++)
                keywords[i] = s.getKeywords()[i];
        } catch (Exception e) {
            // should only happen for null
            keywords = new String[0];
        }

        fees = s.getFees();
        accessConstraints = s.getAccessConstraints();
        maintainer = s.getMaintainer();
        onlineResource = s.getOnlineResource();
    }
View Full Code Here

     * @see org.vfny.geoserver.config.DataStructure#toDTO()
     */

    // name needed to not match as the DTOs do not follow the same inheritance struture.
    public ServiceDTO toServDTO() {
        ServiceDTO sDto = new ServiceDTO();
        sDto.setAbstract(_abstract);
        sDto.setAccessConstraints(accessConstraints);
        sDto.setEnabled(enabled);
        sDto.setFees(fees);

        String[] s = new String[keywords.length];

        for (int i = 0; i < keywords.length; i++)
            s[i] = keywords[i];

        sDto.setKeywords(s);
        sDto.setMaintainer(maintainer);
        sDto.setName(name);
        sDto.setOnlineResource(onlineResource);
        sDto.setTitle(title);

        return sDto;
    }
View Full Code Here

     */
    protected static void storeService(Object obj, WriterHelper cw)
        throws ConfigurationException {
        LOGGER.finer("In method storeService");

        ServiceDTO s = null;
        String u = null;
        String t = "";
       
        boolean fBounds = false;
        boolean srsXmlStyle = false;
        int serviceLevel = 0;
        String svgRenderer = null;
        boolean svgAntiAlias = false;
        boolean citeConformanceHacks = false;

        if (obj instanceof WFSDTO) {
            WFSDTO w = (WFSDTO) obj;
            s = w.getService();
            t = "WFS";
           
            fBounds = w.isFeatureBounding();
            srsXmlStyle = w.isSrsXmlStyle();
            serviceLevel = w.getServiceLevel();
            citeConformanceHacks = w.getCiteConformanceHacks();
        } else if (obj instanceof WMSDTO) {
            WMSDTO w = (WMSDTO) obj;
            s = w.getService();
            t = "WMS";
            svgRenderer = w.getSvgRenderer();
            svgAntiAlias = w.getSvgAntiAlias();
        } else {
            throw new ConfigurationException("Invalid object: not WMS of WFS");
        }

        Map atrs = new HashMap();
        atrs.put("type", t);
        atrs.put("enabled", s.isEnabled() + "");
        cw.openTag("service", atrs);
        cw.comment(
            "ServiceDTO elements, needed for the capabilities document\n"
            + "Title and OnlineResource are the two required");

        if ((s.getName() != null) && (s.getName() != "")) {
            cw.textTag("name", s.getName());
        }

        if ((s.getTitle() != null) && (s.getTitle() != "")) {
            cw.textTag("title", s.getTitle());
        }

        if ((s.getAbstract() != null) && (s.getAbstract() != "")) {
            cw.textTag("abstract", s.getAbstract());
        }

        if (s.getKeywords().length != 0) {
            cw.openTag("keywords");

            for (int i = 0; i < s.getKeywords().length; i++) {
                cw.textTag("keyword", (s.getKeywords())[i].toString());
            }

            cw.closeTag("keywords");
        }

        if (s.getOnlineResource() != null) {
            cw.textTag("onlineResource", s.getOnlineResource().toString());
        }

        if ((s.getFees() != null) && (s.getFees() != "")) {
            cw.textTag("fees", s.getFees());
        }

        if ((s.getAccessConstraints() != null)
                && (s.getAccessConstraints() != "")) {
            cw.textTag("accessConstraints", s.getAccessConstraints());
        }

        if (fBounds) {
            cw.valueTag("featureBounding", fBounds + "");
        }

        //if (srsXmlStyle) {
        cw.valueTag("srsXmlStyle", srsXmlStyle + "");

        //}
        if (serviceLevel != 0) {
            cw.valueTag("serviceLevel", serviceLevel + "");
        }

        if (obj instanceof WFSDTO) //DJB: this method (storeService) doesnt separate WFS and WMS very well!
         {
            cw.textTag("citeConformanceHacks", citeConformanceHacks + "");
        }

        if ((s.getMaintainer() != null) && (s.getMaintainer() != "")) {
            cw.textTag("maintainer", s.getMaintainer());
        }

        if (svgRenderer != null) {
            cw.textTag("svgRenderer", svgRenderer);
        }
View Full Code Here

                + citeConformanceHacks);
        }

        //} catch (Exception e) {
        //}
        ServiceDTO s = loadService(wfsElement);
        wfs.setService(s);
    }
View Full Code Here

     *
     * @throws ConfigurationException When an error occurs.
     */
    protected ServiceDTO loadService(Element serviceRoot)
        throws ConfigurationException {
        ServiceDTO s = new ServiceDTO();

        s.setName(ReaderUtils.getChildText(serviceRoot, "name", true));
        s.setTitle(ReaderUtils.getChildText(serviceRoot, "title", false));
        s.setAbstract(ReaderUtils.getChildText(serviceRoot, "abstract"));
        s.setKeywords(ReaderUtils.getKeyWords(ReaderUtils.getChildElement(
                    serviceRoot, "keywords")));
        s.setFees(ReaderUtils.getChildText(serviceRoot, "fees"));
        s.setAccessConstraints(ReaderUtils.getChildText(serviceRoot,
                "accessConstraints"));
        s.setMaintainer(ReaderUtils.getChildText(serviceRoot, "maintainer"));
        s.setEnabled(ReaderUtils.getBooleanAttribute(serviceRoot, "enabled",
                false, true));

        try {
            s.setOnlineResource(new URL(ReaderUtils.getChildText(serviceRoot,
                        "onlineResource", true)));
        } catch (MalformedURLException e) {
            throw new ConfigurationException(e);
        }

View Full Code Here

   * @return
   */
  public static WMSDTO newWmsDto() {
    WMSDTO dto = new WMSDTO();
    dto.setGmlPrefixing(true);
    ServiceDTO service = new ServiceDTO();
    service.setAbstract("test abstract");
    service.setAccessConstraints("NONE");
    service.setEnabled(true);
    service.setFees("NONE");
    service
        .setKeywords(new String[] { "test", "mock", "service", "config" });
    service.setMaintainer("Gabriel Roldan");
    service.setName("WMS");
    try {
      service.setOnlineResource(new URL("http://www.axios.es"));
    } catch (Exception e) {
      // no-op
    }
    service.setTitle("My mock WMS");
    dto.setService(service);
    return dto;
  }
View Full Code Here

TOP

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

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.