⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adddatatask.java

📁 esri的ArcGIS Server超级学习模板程序(for java)
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
        this.previewTransparency = previewTransparency;
    }

    /**
     * Get preview service map.
     */
    public String getPreviewServiceMap() {
        return this.previewServiceMap;
    }

    /**
     * Set preview service map.
     */
    public void setPreviewServiceMap(String previewServiceMap) {
        this.previewServiceMap = previewServiceMap;
    }

    public String getBlankSpace0() {
        return this.blankSpace0;
    }

    public void setBlankSpace0(String blankSpace) {
        this.blankSpace0 = blankSpace;
    }

    public String getBlankSpace1() {
        return this.blankSpace1;
    }

    public void setBlankSpace1(String blankSpace) {
        this.blankSpace1 = blankSpace;
    }

    public String getMessage1() {
        return this.message1;
    }

    public void setMessage1(String message) {
        this.message1 = message;
    }

    public String getMessage2() {
        return this.message2;
    }

    public void setMessage2(String message) {
        this.message2 = message;
    }

    public String getMessage3() {
        return this.message3;
    }

    public void setMessage3(String message) {
        this.message3 = message;
    }

    public String getMessage4() {
        return this.message4;
    }

    public void setMessage4(String message) {
        this.message4 = message;
    }

    public String getMessage5() {
        return this.message5;
    }

    public void setMessage5(String message) {
        this.message5 = message;
    }

    public String getMessage6() {
        return this.message6;
    }

    public void setMessage6(String message) {
        this.message6 = message;
    }

    public String getPreviewServiceLabel() {
        return this.previewServiceLabel;
    }

    public void setPreviewServiceLabel(String previewServiceLabel) {
        this.previewServiceLabel = previewServiceLabel;
    }

    private Map<String, String> parseParams(String info) {
        String[] params = info.split("\\|");
        Map<String, String> paramList = new LinkedHashMap<String, String>();

        for (int i = 0; i < params.length; i++) {
            String[] paramInfo = splitParams(params[i]);
            paramList.put(paramInfo[0], paramInfo[1]);
        }

        return paramList;
    }

    private void getAGSInternetServiceList(Map<String, String> minfo) {
        String url = minfo.get("url");
        AGSWSClient agsClient = new AGSWSClient();

        String[] serviceList = agsClient.getAgsWebURLs(url);

        if ((serviceList == null) || (serviceList.length == 0)) {
            this.errorMessage = TextResources.getResourceString(ResourceProps.ERROR_MESSAGE) + " " + url;
        } else {
            StringBuffer svcs = new StringBuffer();

            for (int i = 0; i < serviceList.length; i++) {
                svcs.append(serviceList[i] + "!");
            }

            availableServiceList.put(url + "-ArcGIS Server Internet*url=" + url, svcs.toString());
        }
    }

    private void getAGSLocalServiceList(Map<String, String> minfo) {
        String host = minfo.get("host");
        String username = minfo.get("user");
        String password = minfo.get("pswd");
        String domain = null;
        boolean passwordEncrypted = false;

        if ((username != null) && (username.trim().length() > 0)) {
            int pos = username.indexOf("\\");

            if (pos >= 0) {
                domain = username.substring(0, pos);
                username = username.substring(pos + 1);
            }
        } else {
            username = getAgsUsernameParam();
            password = getAgsPasswordParam();
            domain = getAgsDomainParam();

            if (getAgsPasswordEncryptedParam().trim().equalsIgnoreCase("true")) {
                passwordEncrypted = true;
            }
        }

        AGSLocalClient agsClient = new AGSLocalClient();
        String[] serviceList = agsClient.getAgsServices(host, domain, username, password, passwordEncrypted);

        if ((serviceList == null) || (serviceList.length == 0)) {
            this.errorMessage = TextResources.getResourceString(ResourceProps.ERROR_MESSAGE) + " " + host;
        } else {
            StringBuffer svcs = new StringBuffer();

            for (int i = 0; i < serviceList.length; i++) {
                svcs.append(serviceList[i] + "!");
            }

            String uInfo = host + "-ArcGIS Server Local*host=" + host + "&domain=" + domain + "&user=" + username + "&pswd=" + password + "&encrypted=" + passwordEncrypted;
            availableServiceList.put(uInfo, svcs.toString());
        }
    }

    private void getAIMSServiceList(Map<String, String> minfo) {
        String type = minfo.get("type");
        String username = minfo.get("user");
        String password = minfo.get("pswd");
        String host = "";
        String port = "0";
        String[] serviceList = null;

        if (type.equalsIgnoreCase("TCP")) {
            host = minfo.get("host");
            port = minfo.get("port");

            AIMSClient imsClient = new AIMSClient(host, Integer.parseInt(port), username, password);
            serviceList = imsClient.getServices();
        }

        if (type.equalsIgnoreCase("HTTP")) {
            host = minfo.get("url");

            AIMSClient imsClient = new AIMSClient(host, 0, username, password);
            serviceList = imsClient.getServices();
        }

        if ((serviceList == null) || (serviceList.length == 0)) {
            this.errorMessage = TextResources.getResourceString(ResourceProps.ERROR_MESSAGE) + " " + host;
        } else {
            String svcs = "";

            for (int i = 0; i < serviceList.length; i++) {
                svcs += (serviceList[i] + "!");
            }

            String uInfo = host + "-ArcIMS*mode=" + type + "&host=" + host + "&port=" + port + "&user=" + username + "&pswd=" + password;
            availableServiceList.put(uInfo, svcs);
        }
    }

    private void getAWSServiceList(Map<String, String> minfo) {
        String username = minfo.get("user");
        String password = minfo.get("pswd");
        String authurl = minfo.get("authurl");
        String mapurl = minfo.get("mapurl");
        String datasource = minfo.get("ds");

        if (username == null) {
            username = "";
        }

        if (password == null) {
            password = "";
        }

        String uInfo = datasource + "*user=" + username + "&pswd=" + password + "&authurl=" + authurl + "&mapurl=" + mapurl + "&ds=" + datasource;
        String awsList = availableServiceList.get("ArcWeb Services-" + username);

        if (awsList != null) {
            awsList += (uInfo + "!");
            availableServiceList.put("ArcWeb Services-" + username, awsList);
        } else {
            errorMessage = TextResources.getResourceString(ResourceProps.ERROR_MESSAGE) + " ArcWeb Services";
        }
    }

    private void getWMSServiceList(Map<String, String> minfo) {
        String url = null;
        String title = null;
        IWMSClient wmsClient = null;

        url = minfo.get("url").trim();

        wmsClient = new WMSClient(url);
        title = wmsClient.getTitle();

        if (title.length() > 0) {
            String wmsList = availableServiceList.get("OGC (WMS) Service");

            if (wmsList != null) {
                wmsList += (url + "*" + title + "!");
            } else {
                wmsList = url + "*" + title + "!";
            }

            availableServiceList.put("OGC (WMS) Service", wmsList);
        } else {
            errorMessage = TextResources.getResourceString(ResourceProps.ERROR_MESSAGE) + " " + url;
        }
    }

    private void getWFSServiceList(Map<String, String> minfo) {
        String url = minfo.get("url").trim();
        WFSClient wfs = new WFSClient(url);
        ServiceIdentification servId = null;

        try {
            _logger.debug("Getting capabilities from WFS " + url);

            WFSCapabilities caps = wfs.getCapabilities();
            servId = caps.getServiceIdentification();
        } catch (NetworkConnectionException ex) {
            _logger.debug("Could not connect to WFS Service", ex);
        } catch (ResponseParsingException ex) {
            _logger.debug("Could not parse WFS response", ex);
        }

        String title = (servId != null) ? servId.getTitle() : null;
        String wfsServices = null;

        if ((title != null) && (title.length() > 0)) {
            wfsServices = url + "*" + title + "!";
        } else {
            //If no title is available, use URL
            wfsServices = url + "*" + TextResources.getResourceString("servicePropsTask.ui.value.param.serviceType.wfs") + "!";
        }

        availableServiceList.put("OGC (WFS) Service", wfsServices);
    }

    public WCSCapabilities getWcsCapabilities(String url) throws WCSException {
        WCSCapabilities cap = null;

        if (wcsCapabilities == null) {
            wcsCapabilities = new HashMap<String, WCSCapabilities>();
        }

        if (wcsCapabilities.containsKey(url)) {
            cap = wcsCapabilities.get(url);
        } else {
            cap = new WCSHTTPClientBase().getCapabilities(url);

            if (cap != null) {
                this.wcsCapabilities.put(cap.getGetCapabilitiesURL(), cap);
            }
        }

        return cap;
    }

    private void getWCSServiceList(String url) {
        try {
            WCSCapabilities wcsCapabilities = getWcsCapabilities(url);

            if ((wcsCapabilities != null) && !wcsCapabilities.getCoverageInfos().isEmpty()) {
                String capabilitiesURL = wcsCapabilities.getGetCapabilitiesURL();

                if (!availableServiceList.containsKey(capabilitiesURL + "-OGC (WCS) Service*url=" + capabilitiesURL)) {
                    StringBuffer sbCoverages = new StringBuffer();

                    for (Iterator<String> i = wcsCapabilities.getCoverageInfos().keySet().iterator(); i.hasNext();) {
                        String coverageName = i.next();
                        sbCoverages.append(capabilitiesURL).append("&coverage=").append(coverageName).append("*").append(wcsCapabilities.getCoverageInfo(coverageName).getLabel()).append("!");
                    }

                    availableServiceList.put(capabilitiesURL + "-OGC (WCS) Service*url=" + capabilitiesURL, sbCoverages.toString());
                }
            } else {
                throw new WCSException("No coverages found.");
            }
        } catch (WCSException ex) {
            _logger.warn(TextResources.getResourceString(ResourceProps.ERROR_MESSAGE) + " WCS service. " + url + ".", ex);
            this.renderMessage(TextResources.getResourceString(ResourceProps.ERROR_MESSAGE) + " WCS service. " + ex.getMessage());
        }
    }

    private void getWCSServiceList(Map<String, String> minfo) {
        getWCSServiceList(minfo.get("url"));
    }

    /**
     * Add GIS Server Update.
     */
    public void addGISServerUpdate(TaskEvent event) {
        _logger.info("Adding GIS Server to list of servers");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -