/** * Set the name of the index to search.<p> * * * @param indexName the name of the index */ public void setIndex(String indexName) { CmsSearchIndex index; if (CmsStringUtil.isNotEmpty(indexName)) { try { index = OpenCms.getSearchManager().getIndex(indexName); if (index == null) { throw new CmsException(Messages.get().container(Messages.ERR_INDEX_NOT_FOUND_1, indexName)); } setSearchIndex(index); } catch (Exception exc) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.LOG_INDEX_ACCESS_FAILED_1, indexName), exc); } } } }
/** * Set the name of the index to search.<p> * * @param indexName the name of the index */ public void setIndex(String indexName) { CmsSearchIndex index; if (CmsStringUtil.isNotEmpty(indexName)) { try { index = OpenCms.getSearchManager().getIndex(indexName); if (index == null) { throw new CmsException(Messages.get().container(Messages.ERR_INDEX_NOT_FOUND_1, indexName)); } setSearchIndex(index); } catch (Exception exc) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.LOG_INDEX_ACCESS_FAILED_1, indexName), exc); } } } }
/** * Set the name of the index to search.<p> * * A former search result will be deleted.<p> * * @param indexName the name of the index */ public void setIndex(String indexName) { resetLastResult(); if (CmsStringUtil.isNotEmpty(indexName)) { try { CmsSearchIndex index = OpenCms.getSearchManager().getIndex(indexName); if (index == null) { throw new CmsException(Messages.get().container(Messages.ERR_INDEX_NOT_FOUND_1, indexName)); } m_parameters.setSearchIndex(index); } catch (Exception exc) { if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_INDEX_ACCESS_FAILED_1, indexName), exc); } m_lastException = exc; } } }
/** * Set the name of the index to search.<p> * * A former search result will be deleted.<p> * * @param indexName the name of the index */ public void setIndex(String indexName) { resetLastResult(); CmsSearchIndex index; if (CmsStringUtil.isNotEmpty(indexName)) { try { index = OpenCms.getSearchManager().getIndex(indexName); if (index == null) { throw new CmsException(Messages.get().container(Messages.ERR_INDEX_NOT_FOUND_1, indexName)); } m_parameters.setSearchIndex(index); } catch (Exception exc) { if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_INDEX_ACCESS_FAILED_1, indexName), exc); } m_lastException = exc; } } }
/** * Overridden to additionally get a hold on the widget object of type * <code>{@link CmsSearchParameters}</code>.<p> * * @see org.opencms.workplace.tools.searchindex.A_CmsEditSearchIndexDialog#initUserObject() */ @SuppressWarnings("rawtypes") @Override protected void initUserObject() { super.initUserObject(); Object o = getDialogObject(); if (o == null) { m_searchParams = new CmsSearchParameters(); // implant a hook upon modifications of the list // this will set the search page to 1 if a restriction to the set of categories is performed m_searchParams.setCategories(new CmsHookListSearchCategory(m_searchParams, m_searchParams.getCategories())); m_search = new CmsSearch(); } else { Map dialogObject = (Map)o; m_searchParams = (CmsSearchParameters)dialogObject.get(PARAM_SEARCH_PARAMS); if (m_searchParams == null) { m_searchParams = new CmsSearchParameters(); } m_search = (CmsSearch)dialogObject.get(PARAM_SEARCH_OBJECT); if (m_search == null) { m_search = new CmsSearch(); } } m_searchParams.setSearchIndex(getSearchIndexIndex()); }