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

📄 adddatatask.java

📁 esri的ArcGIS Server超级学习模板程序(for java)
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
package com.esri.solutions.jitk.web.tasks.resources;

import com.esri.adf.web.ags.data.AGSLocalMapResource;
import com.esri.adf.web.ags.data.AGSMapFunctionality;
import com.esri.adf.web.ags.data.AGSMapResource;
import com.esri.adf.web.ags.data.AGSUser;
import com.esri.adf.web.aims.data.AIMSMapFunctionality;
import com.esri.adf.web.aims.data.AIMSMapResource;
import com.esri.adf.web.data.GISResource;
import com.esri.adf.web.data.tasks.TaskInfo;
import com.esri.adf.web.faces.event.TaskEvent;
import com.esri.adf.web.wms.data.WMSMapResource;

import com.esri.arcgisws.RgbColor;

import com.esri.solutions.jitk.common.geometry.ExtentHistoryResetter;
import com.esri.solutions.jitk.common.resources.TextResources;
import com.esri.solutions.jitk.datasources.exceptions.NetworkConnectionException;
import com.esri.solutions.jitk.datasources.exceptions.ResponseParsingException;
import com.esri.solutions.jitk.datasources.exceptions.WCSException;
import com.esri.solutions.jitk.datasources.ogc.ows.ServiceIdentification;
import com.esri.solutions.jitk.datasources.ogc.wcs.URLBuilder;
import com.esri.solutions.jitk.datasources.ogc.wcs.WCSHTTPClientBase;
import com.esri.solutions.jitk.datasources.ogc.wcs.info.WCSCapabilities;
import com.esri.solutions.jitk.datasources.ogc.wfs.WFSCapabilities;
import com.esri.solutions.jitk.datasources.ogc.wfs.WFSClient;
import com.esri.solutions.jitk.datasources.ogc.wms.IWMSClient;
import com.esri.solutions.jitk.datasources.ogc.wms.WMSClient;
import com.esri.solutions.jitk.web.data.IGISResourceFactory;
import com.esri.solutions.jitk.web.event.ResourceObject;
import com.esri.solutions.jitk.web.tasks.RenderControlledTask;
import com.esri.solutions.jitk.web.wcs.data.WCSMapResource;
import com.esri.solutions.jitk.web.wfs.data.WFSMapResource;

import org.apache.axis.types.UnsignedByte;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;


/**
 * This task allows user to add map service exposed by ArcGIS Servers,
 * WMS Services, ArcIMS Services, etc.
 */
public class AddDataTask extends RenderControlledTask {
    private static final long serialVersionUID = 2147033505016624521L;
    private static final Logger _logger = LogManager.getLogger(AddDataTask.class.getName());
    private AddDataTaskInfo taskInfo = null;
    private String footerNote = null;
    private String taskName = null;
    private String availableServices = "";
    private String selectedServices = "";
    private String addGISServerInfo = "";
    private String previewDescription = null;
    private String previewSelectedServices = "";
    private String previewName = "";
    private String previewTransparency = "0";
    private String previewServiceMap = "";
    private String errorMessage = "";
    private String addServiceErrorMessage = "";
    private String blankSpace0 = "";
    private String blankSpace1 = "";
    private String message1 = null;
    private String message2 = null;
    private String message3 = null;
    private String message4 = null;
    private String message5 = null;
    private String message6 = null;
    private String previewServiceLabel = null;
    private String backgroundTransparent = "true";
    private Map<String, String> availableServiceList = new LinkedHashMap<String, String>();
    private Map<String, String> selectedServiceList = null;
    private String agsDomainParam = null;
    private String agsUsernameParam = null;
    private String agsPasswordParam = null;
    private String agsPasswordEncryptedParam = null;
    private String backgroundTransparentParam = null;
    private IGISResourceFactory<GISResource> m_agsMapResourceFactory;
    private IGISResourceFactory<GISResource> m_agsLocalMapResourceFactory;
    private IGISResourceFactory<GISResource> m_aimsMapResourceFactory;
    private IGISResourceFactory<GISResource> m_wmsMapResourceFactory;
    private IGISResourceFactory<GISResource> m_wcsMapResourceFactory;
    private IGISResourceFactory<GISResource> m_wfsMapResourceFactory;
    private Map<String, IGISResourceFactory<GISResource>> m_factories;
    private Map<String, WCSCapabilities> wcsCapabilities;
    private String connectionTypes;
    
    public AddDataTask() {
        super();
        setTaskInfo(new AddDataTaskInfo());
        this.taskName = TextResources.getResourceString(ResourceProps.ADD_DATA_TASK);
    }

    public TaskInfo getTaskInfo() {
        if (this.getContext() == null) {
            taskInfo.getTaskDescriptor().setDisabled(true);
        }

        return this.taskInfo;
    }

    public void setTaskInfo(TaskInfo taskInfo) {
        this.taskInfo = (AddDataTaskInfo) taskInfo;
        super.setTaskInfo(this.taskInfo);
    }

    
    public void setConnectionTypes(String types) {
		this.connectionTypes = types;
	}

    
	public String getConnectionTypes() {
		return connectionTypes;
	}

	public void setAgsPreconfiguredServices(Map<String, String> services) {
    	
		if(services != null && !services.isEmpty()) {
    		
    		for(Iterator<String> i = services.keySet().iterator(); i.hasNext();) {
    			String name = i.next();
    			String url = services.get(name);
    			
    			AGSWSClient agsClient = new AGSWSClient();
    			String[] serviceList = agsClient.getAgsWebURLs(url);
    			
    			if((serviceList != null) && (serviceList.length > 0)) {
    	            StringBuffer svcs = new StringBuffer();
    	            
    	            for(int j = 0; j < serviceList.length; j++) {
    	                svcs.append(serviceList[j] + "!");
    	            }

    	            availableServiceList.put(url + "-ArcGIS Server Internet*url=" + url, svcs.toString());
    	        }
    		}
    	}
	}
    		
	public void setAgsDomainParam(String agsDomainParam) {
        this.agsDomainParam = agsDomainParam;
    }

    public String getAgsDomainParam() {
        return this.agsDomainParam;
    }

    public void setAgsUsernameParam(String agsUsernameParam) {
        this.agsUsernameParam = agsUsernameParam;
    }

    public String getAgsUsernameParam() {
        return this.agsUsernameParam;
    }

    public void setAgsPasswordParam(String agsPasswordParam) {
        this.agsPasswordParam = agsPasswordParam;
    }

    public String getAgsPasswordParam() {
        return this.agsPasswordParam;
    }

    public void setAgsPasswordEncryptedParam(String agsPasswordEncryptedParam) {
        this.agsPasswordEncryptedParam = agsPasswordEncryptedParam;
    }

    public String getAgsPasswordEncryptedParam() {
        return this.agsPasswordEncryptedParam;
    }

    public String getBackgroundTransparentParam() {
        return this.backgroundTransparentParam;
    }

    public void setBackgroundTransparentParam(String backgroundTransparentParam) {
        this.backgroundTransparentParam = backgroundTransparentParam;
    }

    public String getBackgroundTransparent() {
        return this.backgroundTransparent;
    }

    public void setBackgroundTransparent(String backgroundTransparent) {
        //this.backgroundTransparent = backgroundTransparent;
    }

    public void setSelectedServices(String selectedServices) {
        this.selectedServices = selectedServices;
    }

    public String getSelectedServices() {
        return this.selectedServices;
    }

    public void setAvailableServices(String availableServices) {
        this.availableServices = availableServices;
    }

    public String getAvailableServices() {
        return this.availableServices;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    /**
     * Get footer note
     */
    public String getFooterNote() {
        return this.footerNote;
    }

    /**
     * Set footer note
     */
    public void setFooterNote(String footerNote) {
        this.footerNote = footerNote;
    }

    /**
     * Get GIS server info
     */
    public String getAddGISServerInfo() {
        return this.addGISServerInfo;
    }

    /**
     * Set GIS server info
     */
    public void setAddGISServerInfo(String addGISServerInfo) {
        this.addGISServerInfo = addGISServerInfo;
    }

    /**
     * Get preview description
     */
    public String getPreviewDescription() {
        return this.previewDescription;
    }

    /**
     * Set preview description
     */
    public void setPreviewDescription(String previewDescription) {
        this.previewDescription = previewDescription;
    }

    /**
     * Get preview name
     */
    public String getPreviewName() {
        return this.previewName;
    }

    /**
     * Set preview name
     */
    public void setPreviewName(String previewName) {
        this.previewName = previewName;
    }

    /**
     * Get error message
     */
    public String getErrorMessage() {
        return this.errorMessage;
    }

    /**
     * Set error message
     */
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    /**
     * Get add service error message
     */
    public String getAddServiceErrorMessage() {
        return this.addServiceErrorMessage;
    }

    /**
     * Set add service error message
     */
    public void setAddServiceErrorMessage(String addServiceErrorMessage) {
        this.addServiceErrorMessage = addServiceErrorMessage;
    }

    /**
     * Get preview transparency. Currently not being used.
     */
    public String getPreviewTransparency() {
        return this.previewTransparency;
    }

    /**
     * Set preview selected services.
     */
    public void setPreviewSelectedServices(String previewSelectedServices) {
        this.previewSelectedServices = previewSelectedServices;
    }

    /**
     * Get preview selected services.
     */
    public String getPreviewSelectedServices() {
        return this.previewSelectedServices;
    }

    /**
     * Set preview transparency. Currently not being used.
     */
    public void setPreviewTransparency(String previewTransparency) {

⌨️ 快捷键说明

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