/** * Fills details about resource paths of the index source into the given item. <p> * * @param item the list item to fill * @param detailId the id for the detail to fill * */ private void fillDetailResources(CmsListItem item, String detailId) { CmsSearchManager searchManager = OpenCms.getSearchManager(); StringBuffer html = new StringBuffer(); // search for the corresponding CmsSearchIndexSource: String idxSourceName = (String)item.get(LIST_COLUMN_NAME); CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName); // get the index sources resource strings List<String> resources = idxSource.getResourcesNames(); // output of found index sources Iterator<String> itResources = resources.iterator(); html.append("<ul>\n"); while (itResources.hasNext()) { html.append(" <li>\n").append(" ").append(itResources.next()).append("\n"); html.append(" </li>"); } html.append("</ul>\n"); item.set(detailId, html.toString()); }
/** * Fills details about resource paths of the index source into the given item. <p> * * @param item the list item to fill * @param detailId the id for the detail to fill * */ private void fillDetailResources(CmsListItem item, String detailId) { CmsSearchManager searchManager = OpenCms.getSearchManager(); StringBuffer html = new StringBuffer(); // search for the corresponding CmsSearchIndexSource: String idxSourceName = (String)item.get(LIST_COLUMN_NAME); CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName); // get the index sources resource strings List<String> resources = idxSource.getResourcesNames(); // output of found index sources Iterator<String> itResources = resources.iterator(); html.append("<ul>\n"); while (itResources.hasNext()) { html.append(" <li>\n").append(" ").append(itResources.next()).append("\n"); html.append(" </li>"); } html.append("</ul>\n"); item.set(detailId, html.toString()); }
/** * Fills details about resource paths of the index source into the given item. <p> * * @param item the list item to fill * @param detailId the id for the detail to fill * */ private void fillDetailResources(CmsListItem item, String detailId) { CmsSearchManager searchManager = OpenCms.getSearchManager(); StringBuffer html = new StringBuffer(); // search for the corresponding CmsSearchIndexSource: String idxSourceName = (String)item.get(LIST_COLUMN_NAME); CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName); // get the index sources resource strings List<String> resources = idxSource.getResourcesNames(); // output of found index sources Iterator<String> itResources = resources.iterator(); html.append("<ul>\n"); while (itResources.hasNext()) { html.append(" <li>\n").append(" ").append(itResources.next()).append("\n"); html.append(" </li>"); } html.append("</ul>\n"); item.set(detailId, html.toString()); }
/** * Fills details about resource paths of the index source into the given item. <p> * * @param item the list item to fill * @param detailId the id for the detail to fill * */ private void fillDetailResources(CmsListItem item, String detailId) { CmsSearchManager searchManager = OpenCms.getSearchManager(); StringBuffer html = new StringBuffer(); // search for the corresponding CmsSearchIndexSource: String idxSourceName = (String)item.get(LIST_COLUMN_NAME); CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName); // get the index sources resource strings List<String> resources = idxSource.getResourcesNames(); // output of found index sources Iterator<String> itResources = resources.iterator(); html.append("<ul>\n"); while (itResources.hasNext()) { html.append(" <li>\n").append(" ").append(itResources.next()).append("\n"); html.append(" </li>"); } html.append("</ul>\n"); item.set(detailId, html.toString()); }
/** * Returns the configured resources of the current indexsource. * * @return the configured resources of the current indexsource */ private List<String> resources() { return OpenCms.getSearchManager().getIndexSource(getParamIndexsource()).getResourcesNames(); }
CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName);
CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName);
CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName);
CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName);
CmsSearchIndexSource indexsource = manager.getIndexSource(getParamIndexsource()); List<CmsSearchDocumentType> result; if (indexsource != null) {
CmsSearchIndexSource indexsource = manager.getIndexSource(getParamIndexsource()); List<CmsSearchDocumentType> result; if (indexsource != null) {
CmsSearchIndexSource indexsource = manager.getIndexSource(getParamIndexsource()); List<CmsSearchDocumentType> result; if (indexsource != null) {
/** * Initializes the user object to work with depending on the dialog state and request parameters.<p> * * Two initializations of the user object on first dialog call are possible: * <ul> * <li>edit an existing search index</li> * <li>create a new search index with default initialization</li> * </ul> */ protected void initUserObject() { if (m_indexsource == null) { try { m_indexsource = m_searchManager.getIndexSource(getParamIndexsource()); if (m_indexsource == null) { m_indexsource = new CmsSearchIndexSource(); } } catch (Exception e) { m_indexsource = new CmsSearchIndexSource(); } } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions() */ @Override public void executeListMultiActions() { CmsSearchManager searchManager = OpenCms.getSearchManager(); if (getParamListAction().equals(LIST_MACTION_DELETESOURCE)) { // execute the delete multiaction Iterator<CmsListItem> itItems = getSelectedItems().iterator(); CmsListItem listItem; CmsSearchIndexSource idxsource; while (itItems.hasNext()) { listItem = itItems.next(); idxsource = searchManager.getIndexSource((String)listItem.get(LIST_COLUMN_NAME)); searchManager.removeSearchIndexSource(idxsource); } refreshList(); writeConfiguration(false); } listSave(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions() */ @Override public void executeListMultiActions() { CmsSearchManager searchManager = OpenCms.getSearchManager(); if (getParamListAction().equals(LIST_MACTION_REMOVE_DOCTYPE)) { // execute the delete multiaction Iterator<CmsListItem> itItems = getSelectedItems().iterator(); CmsListItem listItem; String doctype; CmsSearchIndexSource idxsrc = searchManager.getIndexSource(getParamIndexsource()); while (itItems.hasNext()) { listItem = itItems.next(); doctype = (String)listItem.get(LIST_COLUMN_NAME); idxsrc.removeDocumentType(doctype); } writeConfiguration(false); refreshList(); } listSave(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions() */ @Override public void executeListMultiActions() { CmsSearchManager searchManager = OpenCms.getSearchManager(); if (getParamListAction().equals(LIST_MACTION_ADD_DOCTYPE)) { // execute the delete multiaction Iterator<CmsListItem> itItems = getSelectedItems().iterator(); CmsListItem listItem; String doctype; CmsSearchIndexSource idxsrc = searchManager.getIndexSource(getParamIndexsource()); while (itItems.hasNext()) { listItem = itItems.next(); doctype = (String)listItem.get(LIST_COLUMN_NAME); idxsrc.addDocumentType(doctype); } writeConfiguration(false); refreshList(); } listSave(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() { CmsSearchManager searchManager = OpenCms.getSearchManager(); String action = getParamListAction(); if (action.equals(LIST_ACTION_REMOVE_DOCTYPE) || action.equals(LIST_ACTION_REMOVE_DOCTYPE2)) { CmsSearchIndexSource idxsrc = searchManager.getIndexSource(getParamIndexsource()); CmsListItem item = getSelectedItem(); String doctypeName = (String)item.get(LIST_COLUMN_NAME); idxsrc.removeDocumentType(doctypeName); refreshList(); writeConfiguration(false); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions() */ @Override public void executeListSingleActions() { CmsSearchManager searchManager = OpenCms.getSearchManager(); String action = getParamListAction(); if (action.equals(LIST_ACTION_ADD_DOCTYPE) || action.equals(LIST_ACTION_ADD_DOCTYPE2)) { CmsSearchIndexSource idxsrc = searchManager.getIndexSource(getParamIndexsource()); CmsListItem item = getSelectedItem(); String doctypeName = (String)item.get(LIST_COLUMN_NAME); idxsrc.addDocumentType(doctypeName); refreshList(); writeConfiguration(false); } }
/** * Sets the logical key/name of this search index source.<p> * * @param name the logical key/name of this search index source * * @throws CmsIllegalArgumentException if argument name is null, an empty or whitespace-only Strings * or already used for another indexsource's name. */ public void setName(String name) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_INDEXSOURCE_CREATE_MISSING_NAME_0)); } // already used? Don't test this at xml-configuration time (no manager) if (OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) { CmsSearchManager mngr = OpenCms.getSearchManager(); // don't test this if the indexsource is not new (widget invokes setName even if it was not changed) if (mngr.getIndexSource(name) != this) { if (mngr.getSearchIndexSources().keySet().contains(name)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_INDEXSOURCE_CREATE_INVALID_NAME_1, name)); } } } m_name = name; }
/** * Sets the logical key/name of this search index source.<p> * * @param name the logical key/name of this search index source * * @throws CmsIllegalArgumentException if argument name is null, an empty or whitespace-only Strings * or already used for another indexsource's name. */ public void setName(String name) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) { throw new CmsIllegalArgumentException(Messages.get().container( Messages.ERR_INDEXSOURCE_CREATE_MISSING_NAME_0)); } // already used? Don't test this at xml-configuration time (no manager) if (OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) { CmsSearchManager mngr = OpenCms.getSearchManager(); // don't test this if the indexsource is not new (widget invokes setName even if it was not changed) if (mngr.getIndexSource(name) != this) { if (mngr.getSearchIndexSources().keySet().contains(name)) { throw new CmsIllegalArgumentException(Messages.get().container( Messages.ERR_INDEXSOURCE_CREATE_INVALID_NAME_1, name)); } } } m_name = name; }