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

📄 cswsearchtaskbean.java

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

    /**
     * Sets the fully qualified class name of the CS/W search result
     * class.
     *
     * @param className Fully qualified class name.
     */
    public void setSearchResultClass(String className) {
        m_searchResultClass = className;
    }

    /**
     * Sets the {@link CswPersistenceService} reference for storing and
     * loading queries.
     *
     * @param service The {@link CswPersistenceService} reference.
     */
    public void setPersistenceService(CswPersistenceService service) {
        if (service == null) {
            throw new NullPointerException("persistence service cannot be null");
        }

        m_persistenceService = service;
    }

    /**
     * Gets the {@link CswPersistenceService} used for storing and loading
     * queries.
     *
     * @return {@link CswPersistenceService} reference.
     */
    public CswPersistenceService getPersistenceService() {
        return m_persistenceService;
    }

    /**
     * Gets the {@link ViewMetadataHelper} used to view CS/W
     * metadata documents.
     *
     * @return {@link ViewMetadataHelper} reference.
     */
    public ViewMetadataHelper getViewMetadataHelper() {
        return m_helper;
    }

    /**
     * Gets the value indicating if there are any saved queries
     * available.
     *
     * @return true if there are saved queries available, false otherwise.
     */
    public boolean getSavedQueriesAvailable() {
        return m_savedQueriesAvailable;
    }

    /**
     * Sets the value indicating if there are any saved queries
     * available.
     *
     * @param available true if there are saved queries available, false otherwise.
     */
    public void setSavedQueriesAvailable(boolean available) {
        m_savedQueriesAvailable = available;
    }

    /**
     * Initializes the CS/W task with available saved queries.
     */
    public void init() {
        for (IMetadataCatalog c : m_metadataContext.getMetadataCatalogs()
                                                   .values()) {
            m_availableCatalogs.put(c.getId(), c.getName());
        }

        m_helper.setMetadataContext(m_metadataContext);
    }

    /**
     * Gets the value indicating whether to use the advanced search
     * options.
     */
    public boolean getUseAdvancedQuery() {
        return m_useAdvancedQuery;
    }

    /**
     * Sets the value indicating whether to use the advanced search
     * options.
     *
     * @param use {@link Boolean} indicator.
     */
    public void setUseAdvancedQuery(boolean use) {
        m_useAdvancedQuery = use;
    }

    /**
     * Gets the CS/W query search term.
     *
     * @return {@link String} CS/W query search term.
     */
    public String getSearchTerm() {
        return m_searchTerm;
    }

    /**
     * Sets the CS/W query search term.
     *
     * @param find {@link String} Query search term.
     */
    public void setSearchTerm(String find) {
        m_searchTerm = find;
    }

    /**
     * Gets the selected CS/W catalog ID.
     *
     * @return {@link String} CS/W catalog ID.
     */
    public String getSelectCatalog() {
        return m_selectCatalog;
    }

    /**
     * Sets the currently selected CS/W catalog.
     *
     * @param catalog {@link String} CS/W catalog ID.
     */
    public void setSelectCatalog(String catalog) {
        m_selectCatalog = catalog;
    }

    /**
     * Gets a {@link Map} of configured CS/W catalogs.
     *
     * @return {@link Map} of configured CS/W catalogs.
     */
    public Map<String, String> getAvailableCatalogs() {
        return m_availableCatalogs;
    }

    /**
     * Gets the indicator to show the available CS/W catalogs.  If there
     * is more than one catalog configured, <code>true</code> will be returned,
     * <code>false</code> otherwise.
     *
     * @return {@link Boolean} True if more than one CS/W catalog is configured,
     *                                         False otherwise.
     */
    public boolean getShowCatalogs() {
        if (m_availableCatalogs.size() > 1) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * Gets the value indicating if the user is exporting a saved
     * query to the local disc.
     *
     * @return {@link Boolean} True if user is exporting a saved query to the local disc,
     *                         false otherwise.
     */
    public boolean getExportingSavedQuery() {
        return m_exportingSavedQuery;
    }

    /**
     * Sets the value indicating if the user is exporting a saved
     * query to the local disc.
     *
     * @param exporting {@link Boolean} indicating value.
     */
    public void setExportingSavedQuery(boolean exporting) {
        m_exportingSavedQuery = exporting;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.CswSearchTaskInfo#getTaskInfo()
     */
    public CswSearchTaskInfo getTaskInfo() {
        return m_taskInfo;
    }

    /**
     * Gets the value indicating whether to use a geometry
     * CS/W search.
     *
     * @return {@link Boolean} indicating value.
     */
    public boolean getQueryOverlappingView() {
        return m_geogOverlapView;
    }

    /**
     * Sets the value indicating whether to use a geometry
     * CS/W search.
     *
     * @param overlapView {@link Boolean} indicating value.
     */
    public void setQueryOverlappingView(boolean overlapView) {
        m_geogOverlapView = overlapView;
    }

    /**
     * Gets the value indicating whether or not to use
     * all the data categories in the CS/W get records
     * request.
     *
     * @return {@link Boolean} indicating value.
     */
    public boolean getDataCategorySelectAll() {
        return m_dataCategorySelectAll;
    }

    /**
     * Sets the value indicating whether or not to use
     * all the data categories in the CS/W get records
     * request.
     *
     * @param select {@link Boolean} indicating value.
     */
    public void setDataCategorySelectAll(boolean select) {
        m_dataCategorySelectAll = select;
    }

    /**
     * Gets the name that will be given to the saved
     * query.
     *
     * @return {@link String} name of the query.
     */
    public String getSaveQueryName() {
        return m_saveQueryName;
    }

    /**
     * Sets the name that will be given to the saved
     * query.
     *
     * @param name {@link String} query name.
     */
    public void setSaveQueryName(String name) {
        m_saveQueryName = name;
    }

    /**
     * Gets the value indicating whether the user only wants
     * to see live data and/or maps when searching the CS/W
     * service.
     *
     * @return {@link Boolean} True if requesting only live data and/or maps,
     *                                 false otherwise.
     */
    public boolean getLiveDataOrMaps() {
        return m_liveDataOrMaps;
    }

    /**
     * Sets the value indicating whether the user only wants
     * to see live data and/or maps when searching the CS/W
     * service.
     *
     * @param live {@link Boolean} indicating value.
     */
    public void setLiveDataOrMaps(boolean live) {
        m_liveDataOrMaps = live;
    }

    /**
     * Gets the name of the file uploaded from the client.
     * Use when importing saved queries.
     *
     * @return {@link String} uploaded file name.
     */
    public String getUploadFilename() {
        return m_uploadFilename;
    }

    /**
     * Sets the name of the file uploaded from the client.
     * Use when importing saved queries.
     *
     * @param filename {@link String} uploaded file name.
     */
    public void setUploadFilename(String filename) {
        m_uploadFilename = filename;
    }

    /**
     * Gets the ID of the uploaded file that is stored
     * in the session.  Use when importing saved queries.
     *
     * @return {@link String} uploaded file ID stored in session.
     */
    public String getUploadId() {
        return m_uploadId;
    }

    /**
     * Sets the ID of the uploaded file that is stored
     * in the session.  Use when importing saved queries.
     *
     * @param id {@link String} uploaded file ID stored in session.
     */
    public void setUploadId(String id) {
        m_uploadId = id;
    }

    /**
     * Gets the value indicating whether or not the query
     * has been modified and is marked as 'Dirty'.
     *
     * @return {@link Boolean} indicating value.
     */
    public boolean getIsQueryDirty() {
        return m_isQueryDirty;
    }

    /**
     * Sets the value indicating whether or not the query
     * has been modified and is marked as 'Dirty'.
     *
     * @param dirty {@link Boolean} indicating value.
     */
    public void setIsQueryDirty(boolean dirty) {
        m_isQueryDirty = dirty;
    }

    /**
     * Performs a save on the configured query by delegating
     * to {@link CswPersistenceService#save(CswPersistenceObject)}.
     *
     * @param event ADF {@link TaskEvent}.
     */
    public void saveQuery(TaskEvent event) {
        try {
            CswPersistenceObject obj = null;
            requestTaskRender();

            m_exportingSavedQuery = false;

            if (m_persistenceService == null) {
                throw new IllegalStateException("persistence service not set");
            }

            obj = createPersistenceObject(event.getWebContext());

            try {
                m_persistenceService.save(obj);
                m_refreshAvailableQueries = true;
            } catch (PersonalizationException ex) {
                //TODO: Use the ErrorProducer to output a user
                //      friendly resource file based error message
                //      that an error encountered interfacing with the 
                //      personalization service.
                _logger.warn("PersonalizationException occurred saving query",
                    ex);
                throw ex;
            }

            m_isQueryDirty = false;
        } catch (Exception ex) {
            _logger.error("Could not save query", ex);
            renderExceptionMessage(ex);
        }
    }

    /**
     * Performs a delete on the selected query by delegating to
     * {@link CswPersistenceService#delete(UUID)}.
     *
     * @param event ADF {@link TaskEvent}.
     */
    public void deleteQuery(TaskEvent event) {
        try {
            UUID uuid = null;
            m_exportingSavedQuery = false;

            if (m_persistenceService == null) {
                throw new IllegalStateException("persistence service not set");
            }

            requestTaskRender();
            uuid = UUID.fromString(getSelectedQuery());

            try {
                m_persistenceService.delete(uuid);

                m_refreshAvailableQueries = true;
            } catch (PersonalizationException ex) {

⌨️ 快捷键说明

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