/** * @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); } }
/** * @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); } }
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);
/** * 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,
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, q), e);