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

📄 cswmetadataprofile.java

📁 esri的ArcGIS Server超级学习模板程序(for java)
💻 JAVA
字号:
package com.esri.solutions.jitk.common.metadata.csw;

import com.esri.solutions.jitk.common.metadata.IMetadataExporter;
import com.esri.solutions.jitk.common.metadata.IMetadataProfile;

import java.util.Map;


/**
 * Concrete implementation of the {@link IMetadataProfile} interface
 * that represents an OGC CS/W catalog service profile.  This class will
 * have a number of configuration properties that will handle creating requests
 * and parsing responses.
 */
public class CSWMetadataProfile implements IMetadataProfile {
    /**
     * {@link Map} of configured metadata exporters.
     *
     * <p>
     * Key:                {@link String} exporter ID.
     * Value:        {@link IMetadataExporter}.
     * </p>
     */
    private Map<String, IMetadataExporter> _exporters = null;

    /**
     * ID of the CS/W metadata profile.
     */
    private String _id = null;

    /**
     * Fully qualified classpath name of the xslt file for transforming
     * get record requests.
     */
    private String _getRecordsRequestXslt = null;

    /**
     * Fully qualified classpath name of the xslt file for transforming
     * get record responses.
     */
    private String _getRecordsResponseXslt = null;

    /**
     * KVP {@link String} used for CS/W get record by ID requests.
     */
    private String _getRecordByIdRequestKVPs = null;

    /**
     * KVP {@link String} used for CS/W get repository item requests.
     */
    private String _getRepositoryItemRequestKVPs = null;

    /**
     * Fully qualified classpath name of the xslt file for transforming
     * the get record by ID response.
     */
    private String _getRecordByIdResponseXslt = null;

    /**
     * Flag that indicates whether or not the the CS/W metadata profile
     * supports spatial queries.
     */
    private boolean _supportSpatialQuery = Boolean.FALSE;

    /**
     * Flag that indicates whether or not the CS/W metadata profile
     * supports content type queries.
     */
    private boolean _supportContentTypeQuery = Boolean.FALSE;

    /**
     * Flag that indicates whether or not the CS/W metadata profile uses
     * a resource Url to retrieve metadata documents.
     */
    private boolean _usesMetadataResourceUrl = Boolean.TRUE;

    /**
     * Fully qualified classpath name of the xslt file for transforming
     * the actual XML metadata document into a readable HTML format.
     */
    private String _metadataHtmlTransformationXsl = null;

    /**
     * Default constructor.
     */
    public CSWMetadataProfile() {
    }

    /**
     * Gets the value indicating whether or not this profile supports
     * a content type query.
     *
     * @return boolean indicating support for content type queries.
     */
    public boolean getSupportContentTypeQuery() {
        return _supportContentTypeQuery;
    }

    /**
     * Sets the value indicating whether or not this profile supports
     * a content type query.
     *
     * @param supportContentTypeQuery support for content type query indicator.
     */
    public void setSupportContentTypeQuery(boolean supportContentTypeQuery) {
        _supportContentTypeQuery = supportContentTypeQuery;
    }

    /**
     * Gets the value indicating whether or not this profile supports
     * a spatial query.
     *
     * @return boolean indicating support for spatial queries.
     */
    public boolean getSupportSpatialQuery() {
        return _supportSpatialQuery;
    }

    /**
     * Sets the value indicating whether or not this profile supports
     * spatial queries.
     *
     * @param supportSpatialQuery support for spatial query indicator.
     */
    public void setSupportSpatialQuery(boolean supportSpatialQuery) {
        _supportSpatialQuery = supportSpatialQuery;
    }

    /**
     * Gets the name of the xslt file used for parsing a CS/W get record
     * by Id response for this profile.
     *
     * @return {@link String} name of the xslt file.
     */
    public String getGetRecordByIdResponseXslt() {
        return _getRecordByIdResponseXslt;
    }

    /**
     * Sets the name of the xslt file used for parsing a CS/W get record
     * by Id response for this profile.
     *
     * @param getRecordByIdResponseXslt {@link String} name of the xslt file.
     * @throws NullPointerException Thrown if the <code>getRecordByIdResponseXslt</code> argument
     *                         is <code>null</code>.
     */
    public void setGetRecordByIdResponseXslt(String getRecordByIdResponseXslt) {
        if (getRecordByIdResponseXslt == null) {
            throw new NullPointerException(
                "get record by Id response xslt cannot be null");
        }

        _getRecordByIdResponseXslt = getRecordByIdResponseXslt;
    }

    /**
     * Gets the KVP {@link String} used for a CS/W get record by Id request
     * for this profile.
     *
     * @return {@link String}.
     */
    public String getGetRecordByIdRequestKVPs() {
        return _getRecordByIdRequestKVPs;
    }

    /**
     * Sets the KVP {@link String} used for a CS/W get record by Id request
     * for this profile.
     *
     * @param getRecordByIdRequestKVPs {@link String}.
     * @throws NullPointerException Thrown if the <code>getRecordByIdRequestKVPs</code> argument
     *                         is <code>null</code>.
     */
    public void setGetRecordByIdRequestKVPs(String getRecordByIdRequestKVPs) {
        if (getRecordByIdRequestKVPs == null) {
            throw new NullPointerException(
                "get record by Id request xslt cannot be null");
        }

        _getRecordByIdRequestKVPs = getRecordByIdRequestKVPs;
    }

    /**
     * Gets the name of the xslt file used for parsing a CS/W get records response
     * for this profile.
     *
     * @return {@link String} name of the xslt file.
     */
    public String getGetRecordsResponseXslt() {
        return _getRecordsResponseXslt;
    }

    /**
     * Sets the name of the xslt file used for parsing a CS/W get records response
     * for this profile.
     *
     * @param getRecordsResponseXslt {@link String} name of the xslt file.
     * @throws NullPointerException Thrown if the <code>getRecordsResponseXslt</code> argument
     *                         is <code>null</code>.
     */
    public void setGetRecordsResponseXslt(String getRecordsResponseXslt) {
        if (getRecordsResponseXslt == null) {
            throw new NullPointerException(
                "get records response xslt cannot be null");
        }

        _getRecordsResponseXslt = getRecordsResponseXslt;
    }

    /**
     * Gets the name of the xslt file used for generating a CS/W get records
     * request for this profile.
     *
     * @return {@link String} name of the xslt file.
     */
    public String getGetRecordsRequestXslt() {
        return _getRecordsRequestXslt;
    }

    /**
     * Sets the name of the xslt file used for generating a CS/W get records
     * request for this profile.
     *
     * @param getRecordsRequestXslt {@link String} name of the xslt file.
     * @throws NullPointerException Thrown if the <code>getRecordsRequestXslt</code> argument
     *                         is <code>null</code>.
     */
    public void setGetRecordsRequestXslt(String getRecordsRequestXslt) {
        if (getRecordsRequestXslt == null) {
            throw new NullPointerException(
                "get records request xslt cannot be null");
        }

        _getRecordsRequestXslt = getRecordsRequestXslt;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.common.metadata.IMetadataProfile#getExporters()
     */
    public Map<String, IMetadataExporter> getExporters() {
        return _exporters;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.common.metadata.IMetadataProfile#getId()
     */
    public String getId() {
        return _id;
    }

    /**
     * Sets a {@link Map} of all metadata exporter values, keyed by their Id.
     *
     * @param exporters The exporter map; cannot be {@code null}.
     * @throws NullPointerException Thrown if the <code>exporters</code> argument is
     *                         <code>null</code>.
     */
    public void setExporters(Map<String, IMetadataExporter> exporters) {
        if (exporters == null) {
            throw new NullPointerException("exporters cannot be null");
        }

        _exporters = exporters;
    }

    /**
     * Sets the name of this profile.
     *
     * @param name {@link String} profile name.
     * @throws NullPointerException Thrown if the <code>id</code> argument is
     *                         <code>null</code>.
     */
    public void setId(String id) {
        if (id == null) {
            throw new NullPointerException("id cannot be null");
        }

        _id = id;
    }

    /**
     * Retrieves the indicator whether or not this profile uses a
     * metadata resource URL to retrieve the metadata document.
     *
     * @return true if this profile uses a URL to the metadata document, false otherwise.
     */
    public boolean getUsesMetadataResourceUrl() {
        return _usesMetadataResourceUrl;
    }

    /**
     * Sets the indicator whether or not this profile uses a
     * metadata resource URL to retrieve the metadata document.
     *
     * @param uses true if this profile uses a URL to the metadata document, false otherwise.
     */
    public void setUsesMetadataResourceUrl(boolean uses) {
        _usesMetadataResourceUrl = uses;
    }

    /**
     * Retrieves the name of the XSL file used for transforming the
     * metadata document into HTML.
     *
     * @return {@link String} filename of the XLS transformation file.
     */
    public String getMetadataHtmlTransformationXsl() {
        return _metadataHtmlTransformationXsl;
    }

    /**
     * Sets the name of the XSL file used for transforming the
     * metadata document into HTML.
     *
     * <p>
     * Only needs to be the name of the file, do not include the file path.
     * </p>
     *
     * @param filename {@link String} XSL file name. Do not include the file path.
     */
    public void setMetadataHtmlTransformationXsl(String filename) {
        _metadataHtmlTransformationXsl = filename;
    }

    /**
     * Gets the get repository item KVP string that is used for CS/W
     * GetRepositoryItem requests.
     *
     * @return {@link String} KVP value.
     */
    public String getGetRepositoryItemRequestKVPs() {
        return _getRepositoryItemRequestKVPs;
    }

    /**
     * Sets the get repository item KVP string that is used for CS/W
     * GetRepositoryItem requests.
     *
     * @param kvp {@link String} KVP value.
     */
    public void setGetRepositoryItemRequestKVPs(String kvp) {
        _getRepositoryItemRequestKVPs = kvp;
    }
}

⌨️ 快捷键说明

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