/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsSearchException(container, cause); } }
LOG.error(e.getMessage(), e);
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() throws IOException, ServletException { CmsSearchManager searchManager = OpenCms.getSearchManager(); CmsListItem item = getSelectedItem(); String indexsourceName = (String)item.get(LIST_COLUMN_NAME); String action = getParamListAction(); if (action.equals(LIST_ACTION_ADDSOURCE) || action.equals(LIST_COLUMN_ADDSOURCE2)) { CmsSearchIndex idx = searchManager.getIndex(getParamIndexName()); idx.addSourceName(indexsourceName); try { idx.initialize(); } catch (CmsSearchException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } refreshList(); writeConfiguration(false); } else if (action.equals(CmsSearchIndexSourceControlList.LIST_ACTION_OVERVIEW_INDEXSOURCE)) { // action currently unused (not triggered by a column any more) Map<String, String[]> params = new HashMap<String, String[]>(); // forward to the edit indexsource screen params.put(A_CmsEditIndexSourceDialog.PARAM_INDEXSOURCE, new String[] {indexsourceName}); params.put(PARAM_STYLE, new String[] {CmsToolDialog.STYLE_NEW}); getToolManager().jspForwardTool(this, "/searchindex/indexsources/indexsource", params); } }
resources.addAll(index.search(cmsObject, query, true)); } catch (CmsSearchException e) { LOG.error(e.getMessage(), e);
} catch (CmsSearchException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e);
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsSearchException(container, cause); } }
resources.addAll(index.search(getCms(), query, true)); } catch (CmsSearchException e) { LOG.error(e.getMessage(), e);
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions() */ @Override public void executeListMultiActions() { CmsSearchManager searchManager = OpenCms.getSearchManager(); CmsListItem item = getSelectedItem(); if (getParamListAction().equals(LIST_MACTION_ADDSOURCE)) { // execute the delete multiaction Iterator<CmsListItem> itItems = getSelectedItems().iterator(); String indexSource; CmsSearchIndex idx = searchManager.getIndex(getParamIndexName()); while (itItems.hasNext()) { item = itItems.next(); indexSource = (String)item.get(LIST_COLUMN_NAME); idx.addSourceName(indexSource); } try { idx.initialize(); } catch (CmsSearchException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } writeConfiguration(false); refreshList(); } listSave(); }
throw new CmsSearchException(Messages.get().container(Messages.ERR_ANALYZER_NOT_FOUND_1, locale)); throw new CmsSearchException(Messages.get().container(Messages.ERR_LOAD_ANALYZER_1, className), e);
} catch (CmsSearchException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e);
/** * Returns an analyzer for the given language.<p> * * The analyzer is selected according to the analyzer configuration.<p> * * @param locale the locale to get the analyzer for * @return the appropriate lucene analyzer * * @throws CmsSearchException if something goes wrong */ public Analyzer getAnalyzer(Locale locale) throws CmsSearchException { Analyzer analyzer = null; String className = null; CmsSearchAnalyzer analyzerConf = m_analyzers.get(locale); if (analyzerConf == null) { throw new CmsSearchException(Messages.get().container(Messages.ERR_ANALYZER_NOT_FOUND_1, locale)); } try { analyzer = getAnalyzer(analyzerConf.getClassName()); } catch (Exception e) { throw new CmsSearchException(Messages.get().container(Messages.ERR_LOAD_ANALYZER_1, className), e); } return analyzer; }
if (container != null) { throw new CmsSearchException(container);
/** * Rebuilds (if required creates) all configured indexes.<p> * * @param report the report object to write messages (or <code>null</code>) * * @throws CmsException if something goes wrong */ public synchronized void rebuildAllIndexes(I_CmsReport report) throws CmsException { CmsMessageContainer container = null; for (int i = 0, n = m_indexes.size(); i < n; i++) { // iterate all configured search indexes CmsSearchIndex searchIndex = m_indexes.get(i); try { // update the index updateIndex(searchIndex, report, null); } catch (CmsException e) { container = new CmsMessageContainer( Messages.get(), Messages.ERR_INDEX_REBUILD_ALL_1, new Object[] {searchIndex.getName()}); LOG.error(Messages.get().getBundle().key(Messages.ERR_INDEX_REBUILD_ALL_1, searchIndex.getName()), e); } } // clean up the extraction result cache cleanExtractionCache(); if (container != null) { // throw stored exception throw new CmsSearchException(container); } }
/** * Checks if the current user is allowed to access non-online indexes.<p> * * To access non-online indexes the current user must be a workplace user at least.<p> * * @param cms the CMS object initialized with the current request context / user * * @throws CmsSearchException thrown if the access is not permitted */ private void checkOfflineAccess(CmsObject cms) throws CmsSearchException { // If an offline index is being selected, check permissions if (!CmsProject.ONLINE_PROJECT_NAME.equals(getProject())) { // only if the user has the role Workplace user, he is allowed to access the Offline index try { OpenCms.getRoleManager().checkRole(cms, CmsRole.ELEMENT_AUTHOR); } catch (CmsRoleViolationException e) { throw new CmsSearchException( Messages.get().container( Messages.LOG_SOLR_ERR_SEARCH_PERMISSION_VIOLATION_2, getName(), cms.getRequestContext().getCurrentUser()), e); } } }
throw new CmsSearchException(Messages.get().container( Messages.ERR_INDEX_SOURCE_ASSOCIATION_1, sourceName), e); if (m_fieldConfiguration == null) { throw new CmsSearchException(Messages.get().container( Messages.ERR_FIELD_CONFIGURATION_UNKNOWN_2, m_name,
throw new CmsSearchException( Messages.get().container(Messages.ERR_INDEX_SOURCE_ASSOCIATION_1, sourceName), e); if (m_fieldConfiguration == null) { throw new CmsSearchException( Messages.get().container(Messages.ERR_FIELD_CONFIGURATION_UNKNOWN_2, m_name, m_fieldConfigurationName));
|| (fq.getSearchQuery().trim().length() < getQueryLength())) { m_lastException = new CmsSearchException(Messages.get().container( Messages.ERR_QUERY_TOO_SHORT_1, new Integer(getQueryLength()))); m_lastException = new CmsSearchException(Messages.get().container( Messages.ERR_QUERY_TOO_SHORT_1, new Integer(getQueryLength())));
if (CmsStringUtil.isEmpty(keyword) || (keyword.trim().length() < getQueryLength())) { m_lastException = new CmsSearchException( Messages.get().container( Messages.ERR_QUERY_TOO_SHORT_1, m_lastException = new CmsSearchException( Messages.get().container(Messages.ERR_QUERY_TOO_SHORT_1, new Integer(getQueryLength())));
throw new CmsSearchException(Messages.get().container(Messages.ERR_SEARCH_PARAMS_1, params), e); } catch (Exception e) { throw new CmsSearchException(Messages.get().container(Messages.ERR_SEARCH_PARAMS_1, params), e); } finally {
throw new CmsSearchException( Messages.get().container( Messages.LOG_SOLR_ERR_SEARCH_EXECUTION_FAILD_1,