📄 cswsearchtaskbean.java
字号:
package com.esri.solutions.jitk.web.tasks.search.csw;
import com.esri.adf.web.data.WebContext;
import com.esri.adf.web.data.geometry.WebExtent;
import com.esri.adf.web.data.geometry.WebPoint;
import com.esri.adf.web.data.geometry.WebPolygon;
import com.esri.adf.web.data.geometry.WebRing;
import com.esri.adf.web.data.results.ResultNode;
import com.esri.adf.web.data.results.WebResults;
import com.esri.adf.web.faces.event.TaskEvent;
import com.esri.solutions.jitk.common.csw.CswPersistenceObject;
import com.esri.solutions.jitk.common.csw.CswPersistenceService;
import com.esri.solutions.jitk.common.csw.ViewMetadataHelper;
import com.esri.solutions.jitk.common.metadata.BasicMetadataExporter;
import com.esri.solutions.jitk.common.metadata.IMetadataAware;
import com.esri.solutions.jitk.common.metadata.IMetadataCatalog;
import com.esri.solutions.jitk.common.metadata.IMetadataContext;
import com.esri.solutions.jitk.common.metadata.IMetadataDocument;
import com.esri.solutions.jitk.common.resources.TextResources;
import com.esri.solutions.jitk.datasources.ogc.csw.CswSearchCriteria;
import com.esri.solutions.jitk.personalization.PersonalizationException;
import com.esri.solutions.jitk.web.tasks.RenderControlledTask;
import com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.UUID;
import javax.faces.context.FacesContext;
public class CswSearchTaskBean extends RenderControlledTask
implements IMetadataAware {
/**
* Static serial version ID.
*/
private static final long serialVersionUID = 4845415221983877360L;
/**
* {@link Logger} used to log message for this class.
*/
private static final Logger _logger = Logger.getLogger(CswSearchTaskBean.class);
/**
* Constant key for the Live data and/or maps result column.
*/
private static final String RESULTS_DISPLAY_LIVE = "csw.display.live";
/**
* Constant key for the Title result column.
*/
private static final String RESULTS_DISPLAY_TITLE = "csw.display.title";
/**
* Constant key for the ID result column.
*/
private static final String RESULTS_DISPLAY_ID = "csw.display.id";
/**
* Constant key for the Abstract result column.
*/
private static final String RESULTS_DISPLAY_ABSTRACT = "csw.display.abstract";
/**
* Constant key for the Brief result column.
*/
private static final String RESULTS_DISPLAY_BRIEF = "csw.display.brief";
/**
* Constant key for the Summary result column.
*/
private static final String RESULTS_DISPLAY_SUMMARY = "csw.display.summary";
/**
* Constant key for the Metadata result column.
*/
private static final String RESULTS_DISPLAY_METADATA = "csw.display.metadata";
/**
* Constant key for the MetaUrl result column.
*/
private static final String RESULTS_DISPLAY_METAURL = "csw.display.metaUrl";
/**
* Constant key for the Date Modified result column.
*/
private static final String RESULTS_DISPLAY_DATEMODIFIED = "csw.display.date";
private String _tab1 = null;
private String _tab2 = null;
private String _tab3 = null;
private String _footerNoteTab1 = null;
private String _footerNoteTab2 = null;
private String _footerNoteTab3 = null;
private String _legendDataCategories = null;
private String _legendGeographicalExtent = null;
private String _linkSelectAll = null;
private String _linkUnselectAll = null;
/**
* Option to do an overlapping OGC geography extent CS/W search.
*/
private boolean m_geogOverlapView = false;
/**
* Keyword CS/W search field.
*/
private String m_searchTerm = null;
/**
* Selected CS/W catalog to search against.
*/
private String m_selectCatalog = null;
/**
* {@link Map} of configured CS/W catalogs.
*
* <p>
* The key will be the ID of the configured catalog and the
* value will be the name of the catalog.
* </p>
*/
private Map<String, String> m_availableCatalogs = null;
/**
* {@link List} of stored CS/W queries that are represented as
* {@link CswPersistenceObject}.
*/
private List<CswPersistenceObject> m_availableQueries = null;
/**
* Flag to indicate that the GUI needs to refresh the list of
* stored CS/W queries.
*/
private boolean m_refreshAvailableQueries = true;
/**
* Number of CS/W records that will be returned from a
* get records request.
*/
private int m_maxFeaturesPerSearch = 10;
/**
* Reference to the {@link CswSearchTaskInfo} object.
*/
private CswSearchTaskInfo m_taskInfo = null;
/**
* Value indicating if the advanced CS/W search options will be
* used.
*/
private boolean m_dataCategorySelectAll = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_agricultureDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_biologyDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_adminDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_atmosphericDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_businessDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_elevationDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_geologicalDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_humanDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_imageryDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_militaryDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_inlandWaterDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_locationsDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_oceansDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_cadastralDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_culturalDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_facilitiesDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_transportationDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_utilitiesDC = Boolean.TRUE;
/**
* CS/W Data Category option.
*/
private boolean m_environmentDC = Boolean.TRUE;
/**
* {@link Map} of stored CS/W queries.
*
* <p>
* The key will be the ID of the stored query and the
* value will be the name of the stored query.
* </p>
*/
private Map<String, String> m_queries = null;
/**
* ID of the selected query used when loading a stored
* CS/W query.
*/
private String m_selectedQuery = null;
/**
* Name of the CS/W query.
*/
private String m_saveQueryName = "Query";
/**
* Advanced CS/W search option that will tell the CS/W
* service that only live data and/or maps are to be returned.
*/
private boolean m_liveDataOrMaps = Boolean.TRUE;
/**
* Name of the uploaded file that is used when
* importing a locally saved CS/W query.
*/
private String m_uploadFilename = null;
/**
* ID of the uploaded CS/W query that is stored in session.
*/
private String m_uploadId = null;
/**
* Value indicating if the saved query has been modified from
* it's original state.
*/
private boolean m_isQueryDirty = Boolean.FALSE;
/**
* Value indicating whether or not to use the advanced
* CS/W query options.
*/
private boolean m_useAdvancedQuery = Boolean.FALSE;
/**
* Description of the saved query.
*/
private String m_saveQueryDescription = "";
/**
* Flag indicating if the client has opted to export
* the CS/W query.
*/
private boolean m_exportingSavedQuery = false;
/**
* Reference to a {@link ViewMetadataHelper} object that will be used
* to view the actual metadata document.
*/
private ViewMetadataHelper m_helper = null;
/**
* Reference to the {@link IMetadataContext} which is used to access
* the CS/W metadata registry.
*/
private IMetadataContext m_metadataContext = null;
/**
* Reference to the {@link CswPersistenceService} that is used to store
* and retrieve CS/W queries to and from the data store.
*/
private CswPersistenceService m_persistenceService = null;
/**
* {@link List} of configured columns that will be displayed in
* the {@link WebResults}.
*/
private List<String> m_resultColumns = null;
/**
* {@link List} of {@link IActionHandler}.
*/
private List<IActionHandler> m_actionHandlers = null;
/**
* Fully qualified class name of the CS/W search class.
*/
private String m_searchResultClass = null;
/**
* Value indicating if there are any saved queries in the database.
*/
private boolean m_savedQueriesAvailable = false;
/**
* Value indicating if the data categories should be used in the search
* query.
*/
private boolean m_useDataCategories = false;
/**
* Default no-args constructor.
*/
public CswSearchTaskBean() {
super();
m_availableCatalogs = new HashMap<String, String>();
m_queries = new TreeMap<String, String>();
m_taskInfo = new CswSearchTaskInfo();
m_helper = new ViewMetadataHelper();
setTaskInfo(m_taskInfo);
}
/*
* (non-Javadoc)
* @see com.esri.solutions.jitk.common.metadata.IMetadataAware#setMetadataContext(com.esri.solutions.jitk.common.metadata.IMetadataContext)
*/
public void setMetadataContext(IMetadataContext context) {
if (context == null) {
throw new NullPointerException("context cannot be null");
}
m_metadataContext = context;
init();
}
/**
* Sets the {@link List} of {@link IActionHandler} object that will be
* available for CS/W search results.
*
* @param actionHandlers
*/
public void setActionHandlers(List<IActionHandler> actionHandlers) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -