viewmetadataactionhandler.java

来自「esri的ArcGIS Server超级学习模板程序(for java)」· Java 代码 · 共 98 行

JAVA
98
字号
package com.esri.solutions.jitk.web.tasks.search.csw.actions;

import com.esri.adf.web.data.WebApplication;
import com.esri.adf.web.data.WebContext;
import com.esri.adf.web.data.geometry.WebGeometry;

import com.esri.solutions.jitk.common.metadata.BasicMetadataExporter;
import com.esri.solutions.jitk.common.metadata.IMetadataCatalog;
import com.esri.solutions.jitk.common.metadata.IMetadataDocument;


public class ViewMetadataActionHandler implements IMetadataAwareActionHandler {
    private String _name = null;
    private IMetadataCatalog _catalog = null;
    private IMetadataDocument _document = null;

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IMetadataAwareActionHandler#setMetadataCatalog(com.esri.solutions.jitk.common.metadata.IMetadataCatalog)
     */
    public void setMetadataCatalog(IMetadataCatalog catalog) {
        _catalog = catalog;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IMetadataAwareActionHandler#setMetadataDocument(com.esri.solutions.jitk.common.metadata.IMetadataDocument)
     */
    public void setMetadataDocument(IMetadataDocument document) {
        _document = document;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#execute()
     */
    public void execute() {
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#getActionKey()
     */
    public String getActionKey() {
        String actionKey = null;
        String catalogId = null;

        // replace '&' so that catalog ID can be passed along on
        // the url query string
        catalogId = _catalog.getId().replace("&", "*/");

        actionKey = WebApplication.getResourceString(
                "SearchAttributesTask.SearchResultContextMenuViewMetadata") +
            ";viewMetadata?guid=" + _document.getMetadataID().getId() +
            "&catalogId=" + catalogId;

        return actionKey;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#getName()
     */
    public String getName() {
        return _name;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#setName(java.lang.String)
     */
    public void setName(String name) {
        _name = name;
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#setWebContext(com.esri.adf.web.data.WebContext)
     */
    public void setWebContext(WebContext context) {
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#setWebGeometry(com.esri.adf.web.data.geometry.WebGeometry)
     */
    public void setWebGeometry(WebGeometry geometry) {
    }

    /*
     * (non-Javadoc)
     * @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#shouldDisplay(com.esri.solutions.jitk.common.metadata.BasicMetadataExporter)
     */
    public boolean shouldDisplay(BasicMetadataExporter exporter) {
        return true;
    }
}

⌨️ 快捷键说明

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