KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > tools > searchindex > CmsSearchIndexSourceAddList


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/searchindex/CmsSearchIndexSourceAddList.java,v $
3  * Date : $Date: 2006/03/27 14:52:21 $
4  * Version: $Revision: 1.2 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.tools.searchindex;
33
34 import org.opencms.configuration.CmsSearchConfiguration;
35 import org.opencms.i18n.CmsMessageContainer;
36 import org.opencms.jsp.CmsJspActionElement;
37 import org.opencms.main.CmsIllegalStateException;
38 import org.opencms.main.CmsLog;
39 import org.opencms.main.OpenCms;
40 import org.opencms.search.CmsSearchDocumentType;
41 import org.opencms.search.CmsSearchException;
42 import org.opencms.search.CmsSearchIndex;
43 import org.opencms.search.CmsSearchIndexSource;
44 import org.opencms.search.CmsSearchManager;
45 import org.opencms.workplace.CmsWorkplaceSettings;
46 import org.opencms.workplace.list.CmsListColumnAlignEnum;
47 import org.opencms.workplace.list.CmsListColumnDefinition;
48 import org.opencms.workplace.list.CmsListDefaultAction;
49 import org.opencms.workplace.list.CmsListDirectAction;
50 import org.opencms.workplace.list.CmsListItem;
51 import org.opencms.workplace.list.CmsListItemDetails;
52 import org.opencms.workplace.list.CmsListItemDetailsFormatter;
53 import org.opencms.workplace.list.CmsListMetadata;
54 import org.opencms.workplace.list.CmsListMultiAction;
55 import org.opencms.workplace.list.CmsListOrderEnum;
56 import org.opencms.workplace.tools.CmsToolDialog;
57
58 import java.io.IOException JavaDoc;
59 import java.util.ArrayList JavaDoc;
60 import java.util.HashMap JavaDoc;
61 import java.util.Iterator JavaDoc;
62 import java.util.LinkedList JavaDoc;
63 import java.util.List JavaDoc;
64 import java.util.Map JavaDoc;
65
66 import javax.servlet.ServletException JavaDoc;
67 import javax.servlet.http.HttpServletRequest JavaDoc;
68 import javax.servlet.http.HttpServletResponse JavaDoc;
69 import javax.servlet.jsp.PageContext JavaDoc;
70
71 import org.apache.commons.logging.Log;
72
73 /**
74  * A list that displays the <code>{@link org.opencms.search.CmsSearchIndexSource}</code>
75  * instances that are not members of the <code>{@link org.opencms.search.CmsSearchIndex}</code>
76  * in the current request scope (param "searchindex" and allows to add them to the index.<p>
77  *
78  * This list is no stand-alone page but has to be embedded in another dialog
79  * (see <code> {@link org.opencms.workplace.tools.searchindex.A_CmsEmbeddedListDialog}</code>. <p>
80  *
81  * @author Achim Westermann
82  *
83  * @version $Revision: 1.2 $
84  *
85  * @since 6.0.0
86  */

87 public class CmsSearchIndexSourceAddList extends A_CmsEmbeddedListDialog {
88
89     /** list action dummy id constant. */
90     public static final String JavaDoc LIST_ACTION_ADDSOURCE = "a";
91
92     /** list action dummy id constant. */
93     public static final String JavaDoc LIST_ACTION_NONE = "n";
94
95     /** list column id constant. */
96     public static final String JavaDoc LIST_COLUMN_ADDSOURCE = "cas";
97
98     /** list column id constant. */
99     public static final String JavaDoc LIST_COLUMN_ADDSOURCE2 = LIST_COLUMN_ADDSOURCE + "2";
100
101     /** list column id constant. */
102     public static final String JavaDoc LIST_COLUMN_ICON = "ci";
103
104     /** list column id constant. */
105     public static final String JavaDoc LIST_COLUMN_INDEXER = "ca";
106
107     /** list column id constant. */
108     public static final String JavaDoc LIST_COLUMN_NAME = "cn";
109
110     /** list item detail id constant. */
111     public static final String JavaDoc LIST_DETAIL_DOCTYPES = "dd";
112
113     /** list item detail id constant. */
114     public static final String JavaDoc LIST_DETAIL_RESOURCES = "dr";
115
116     /** list id constant. */
117     public static final String JavaDoc LIST_ID = "lssisa";
118
119     /** list action id constant. */
120     public static final String JavaDoc LIST_MACTION_ADDSOURCE = "maa";
121
122     /** The log object for this class. */
123     private static final Log LOG = CmsLog.getLog(CmsSearchIndexSourceAddList.class);
124
125     /** Stores the value of the request parameter for the search index Name. */
126     private String JavaDoc m_paramIndexName;
127
128     /**
129      * Public constructor.<p>
130      *
131      * @param jsp an initialized JSP action element
132      */

133     public CmsSearchIndexSourceAddList(CmsJspActionElement jsp) {
134
135         this(jsp, LIST_ID, Messages.get().container(Messages.GUI_LIST_INDEXSOURCES_AVAIL_NAME_0));
136     }
137
138     /**
139      * Public constructor.<p>
140      *
141      * @param jsp an initialized JSP action element
142      * @param listId the id of the list
143      * @param listName the list name
144      */

145     public CmsSearchIndexSourceAddList(CmsJspActionElement jsp, String JavaDoc listId, CmsMessageContainer listName) {
146
147         this(jsp, listId, listName, LIST_COLUMN_NAME, CmsListOrderEnum.ORDER_ASCENDING, null);
148     }
149
150     /**
151      * Public constructor.<p>
152      *
153      * @param jsp an initialized JSP action element
154      * @param listId the id of the displayed list
155      * @param listName the name of the list
156      * @param sortedColId the a priory sorted column
157      * @param sortOrder the order of the sorted column
158      * @param searchableColId the column to search into
159      */

160     public CmsSearchIndexSourceAddList(
161         CmsJspActionElement jsp,
162         String JavaDoc listId,
163         CmsMessageContainer listName,
164         String JavaDoc sortedColId,
165         CmsListOrderEnum sortOrder,
166         String JavaDoc searchableColId) {
167
168         super(jsp, listId, listName, sortedColId, sortOrder, searchableColId);
169
170     }
171
172     /**
173      * Public constructor.<p>
174      *
175      * Public constructor with JSP variables.<p>
176      *
177      * @param context the JSP page context
178      * @param req the JSP request
179      * @param res the JSP response
180      */

181     public CmsSearchIndexSourceAddList(PageContext JavaDoc context, HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc res) {
182
183         this(new CmsJspActionElement(context, req, res));
184     }
185
186     /**
187      * @see org.opencms.workplace.list.A_CmsListDialog#executeListMultiActions()
188      */

189     public void executeListMultiActions() {
190
191         CmsSearchManager searchManager = OpenCms.getSearchManager();
192         CmsListItem item = getSelectedItem();
193         if (getParamListAction().equals(LIST_MACTION_ADDSOURCE)) {
194             // execute the delete multiaction
195
Iterator JavaDoc itItems = getSelectedItems().iterator();
196             String JavaDoc indexSource;
197             CmsSearchIndex idx = searchManager.getIndex(getParamIndexName());
198             while (itItems.hasNext()) {
199                 item = (CmsListItem)itItems.next();
200                 indexSource = (String JavaDoc)item.get(LIST_COLUMN_NAME);
201                 idx.addSourceName(indexSource);
202                 getList().removeItem(item.getId(), getLocale());
203             }
204             try {
205                 idx.initialize();
206             } catch (CmsSearchException e) {
207                 if (LOG.isErrorEnabled()) {
208                     LOG.error(e);
209                 }
210             }
211             writeConfiguration(false);
212             refreshList();
213         }
214
215         listSave();
216     }
217
218     /**
219      * @throws ServletException
220      * @throws IOException
221      * @see org.opencms.workplace.list.A_CmsListDialog#executeListSingleActions()
222      */

223     public void executeListSingleActions() throws IOException JavaDoc, ServletException JavaDoc {
224
225         CmsSearchManager searchManager = OpenCms.getSearchManager();
226         CmsListItem item = getSelectedItem();
227         String JavaDoc indexsourceName = (String JavaDoc)item.get(LIST_COLUMN_NAME);
228         String JavaDoc action = getParamListAction();
229         if (action.equals(LIST_ACTION_ADDSOURCE) || action.equals(LIST_COLUMN_ADDSOURCE2)) {
230
231             CmsSearchIndex idx = searchManager.getIndex(getParamIndexName());
232             idx.addSourceName(indexsourceName);
233             getList().removeItem(item.getId(), getLocale());
234             try {
235                 idx.initialize();
236             } catch (CmsSearchException e) {
237                 if (LOG.isErrorEnabled()) {
238                     LOG.error(e);
239                 }
240             }
241             refreshList();
242             writeConfiguration(false);
243         } else if (action.equals(CmsSearchIndexSourceControlList.LIST_ACTION_OVERVIEW_INDEXSOURCE)) {
244
245             // action currently unused (not triggered by a column any more)
246
Map JavaDoc params = new HashMap JavaDoc();
247             // forward to the edit indexsource screen
248
params.put(A_CmsEditIndexSourceDialog.PARAM_INDEXSOURCE, indexsourceName);
249             params.put(PARAM_STYLE, CmsToolDialog.STYLE_NEW);
250             getToolManager().jspForwardTool(this, "/searchindex/indexsources/indexsource", params);
251
252         }
253     }
254
255     /**
256      * Returns the request parameter mapped to member <code>m_searchindex</code>
257      * or null if no one was received. <p>
258      *
259      * @return the request parameter mapped to member <code>m_searchindex</code>
260      * or null if no one was received
261      */

262     public String JavaDoc getParamIndexName() {
263
264         return m_paramIndexName;
265     }
266
267     /**
268      * Maps the request parameter to member <code>m_searchindex</code>. <p>
269      *
270      * @param paramSearchIndex the request parameter <code>searchindex</code>
271      * that is filled using this method.
272      */

273     public void setParamIndexName(String JavaDoc paramSearchIndex) {
274
275         m_paramIndexName = paramSearchIndex;
276     }
277
278     /**
279      * @see org.opencms.workplace.list.A_CmsListDialog#fillDetails(java.lang.String)
280      */

281     protected void fillDetails(String JavaDoc detailId) {
282
283         // get content
284
List JavaDoc items = getList().getAllContent();
285         Iterator JavaDoc itItems = items.iterator();
286         CmsListItem item;
287         if (detailId.equals(LIST_DETAIL_DOCTYPES)) {
288             while (itItems.hasNext()) {
289                 item = (CmsListItem)itItems.next();
290                 fillDetailDocTypes(item, detailId);
291
292             }
293         }
294         if (detailId.equals(LIST_DETAIL_RESOURCES)) {
295             while (itItems.hasNext()) {
296                 item = (CmsListItem)itItems.next();
297                 fillDetailResources(item, detailId);
298
299             }
300
301         }
302
303     }
304
305     /**
306      * @see org.opencms.workplace.list.A_CmsListDialog#getListItems()
307      */

308     protected List JavaDoc getListItems() {
309
310         List JavaDoc result = new ArrayList JavaDoc();
311         // get content
312
// cannot use the returned map: unmodifyable
313
List JavaDoc allSources = new LinkedList JavaDoc(OpenCms.getSearchManager().getSearchIndexSources().values());
314         allSources.removeAll(searchIndexSources());
315         Iterator JavaDoc itSources = allSources.iterator();
316         CmsSearchIndexSource source;
317         while (itSources.hasNext()) {
318             source = (CmsSearchIndexSource)itSources.next();
319             CmsListItem item = getList().newItem(source.getName());
320             item.set(LIST_COLUMN_NAME, source.getName());
321             item.set(LIST_COLUMN_INDEXER, source.getIndexer().getClass().getName());
322             result.add(item);
323         }
324         return result;
325     }
326
327     /**
328      * @see org.opencms.workplace.CmsWorkplace#initMessages()
329      */

330     protected void initMessages() {
331
332         // add specific dialog resource bundle
333
addMessages(Messages.get().getBundleName());
334         // add default resource bundles
335
super.initMessages();
336     }
337
338     /**
339      * @see org.opencms.workplace.list.A_CmsListDialog#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
340      */

341     protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest JavaDoc request) {
342
343         super.initWorkplaceRequestValues(settings, request);
344     }
345
346     /**
347      * @see org.opencms.workplace.list.A_CmsListDialog#setColumns(org.opencms.workplace.list.CmsListMetadata)
348      */

349     protected void setColumns(CmsListMetadata metadata) {
350
351         // create dummy column for icon
352
CmsListColumnDefinition editCol = new CmsListColumnDefinition(LIST_COLUMN_ICON);
353         editCol.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ICON_NAME_0));
354         editCol.setHelpText(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ICON_NAME_HELP_0));
355         editCol.setWidth("5");
356         editCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
357         editCol.setSorteable(false);
358         // add dummy icon
359
CmsListDirectAction editAction = new CmsListDirectAction(LIST_ACTION_NONE);
360         editAction.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ICON_NAME_0));
361         editAction.setHelpText(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ICON_NAME_HELP_0));
362         editAction.setIconPath(CmsSearchIndexList.LIST_ICON_INDEXSOURCE);
363         // disable!
364
editAction.setEnabled(false);
365         editCol.addDirectAction(editAction);
366         // add it to the list definition
367
metadata.addColumn(editCol);
368
369         // add column for add action
370
CmsListColumnDefinition addCol = new CmsListColumnDefinition(LIST_COLUMN_ADDSOURCE);
371         addCol.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ADDSOURCE_NAME_0));
372         addCol.setHelpText(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ADDSOURCE_NAME_HELP_0));
373         addCol.setWidth("5");
374         addCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
375         addCol.setSorteable(false);
376         // add add action
377
CmsListDirectAction addAction = new CmsListDirectAction(LIST_ACTION_ADDSOURCE);
378         addAction.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ADDSOURCE_NAME_0));
379         addAction.setHelpText(Messages.get().container(Messages.GUI_LIST_SEARCHINDEX_ACTION_ADDSOURCE_NAME_0));
380         addAction.setIconPath(ICON_ADD);
381         addCol.addDirectAction(addAction);
382         // add it to the list definition
383
metadata.addColumn(addCol);
384
385         // add column for name
386
CmsListColumnDefinition nameCol = new CmsListColumnDefinition(LIST_COLUMN_NAME);
387         nameCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
388         nameCol.setName(Messages.get().container(Messages.GUI_LIST_SEARCHINDEX_COL_NAME_0));
389         nameCol.setWidth("55%");
390         // add second add action, see how action id has to be different....
391
CmsListDefaultAction addAction2 = new CmsListDefaultAction(LIST_COLUMN_ADDSOURCE2);
392         addAction2.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_ADDSOURCE_NAME_0));
393         addAction2.setHelpText(Messages.get().container(Messages.GUI_LIST_SEARCHINDEX_ACTION_ADDSOURCE_NAME_0));
394         nameCol.addDefaultAction(addAction2);
395         metadata.addColumn(nameCol);
396
397         // add column for analyzer
398
CmsListColumnDefinition analyzerCol = new CmsListColumnDefinition(LIST_COLUMN_INDEXER);
399         analyzerCol.setAlign(CmsListColumnAlignEnum.ALIGN_LEFT);
400         analyzerCol.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_COL_INDEXER_0));
401         analyzerCol.setWidth("30%");
402         metadata.addColumn(analyzerCol);
403
404     }
405
406     /**
407      * @see org.opencms.workplace.list.A_CmsListDialog#setIndependentActions(org.opencms.workplace.list.CmsListMetadata)
408      */

409     protected void setIndependentActions(CmsListMetadata metadata) {
410
411         // add document types of index source detail help
412
CmsListItemDetails doctypeDetails = new CmsListItemDetails(LIST_DETAIL_DOCTYPES);
413         doctypeDetails.setAtColumn(LIST_COLUMN_NAME);
414         doctypeDetails.setVisible(false);
415         doctypeDetails.setShowActionName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_DETAIL_DOCTYPE_NAME_0));
416         doctypeDetails.setShowActionHelpText(Messages.get().container(
417             Messages.GUI_LIST_INDEXSOURCE_DETAIL_DOCTYPE_SHOW_HELP_0));
418         doctypeDetails.setHideActionName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_DETAIL_DOCTYPE_NAME_0));
419         doctypeDetails.setHideActionHelpText(Messages.get().container(
420             Messages.GUI_LIST_INDEXSOURCE_DETAIL_DOCTYPE_HIDE_HELP_0));
421         doctypeDetails.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_DETAIL_DOCTYPE_NAME_0));
422         doctypeDetails.setFormatter(new CmsListItemDetailsFormatter(Messages.get().container(
423             Messages.GUI_LIST_INDEXSOURCE_DETAIL_DOCTYPE_NAME_0)));
424         metadata.addItemDetails(doctypeDetails);
425
426         // add resources of index source detail help
427
CmsListItemDetails resourceDetails = new CmsListItemDetails(LIST_DETAIL_RESOURCES);
428         resourceDetails.setAtColumn(LIST_COLUMN_NAME);
429         resourceDetails.setVisible(false);
430         resourceDetails.setShowActionName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_DETAIL_RESOURCE_NAME_0));
431         resourceDetails.setShowActionHelpText(Messages.get().container(
432             Messages.GUI_LIST_INDEXSOURCE_DETAIL_RESOURCE_SHOW_HELP_0));
433         resourceDetails.setHideActionName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_DETAIL_RESOURCE_NAME_0));
434         resourceDetails.setHideActionHelpText(Messages.get().container(
435             Messages.GUI_LIST_INDEXSOURCE_DETAIL_RESOURCE_HIDE_HELP_0));
436         resourceDetails.setName(Messages.get().container(Messages.GUI_LIST_INDEXSOURCE_DETAIL_RESOURCE_NAME_0));
437         resourceDetails.setFormatter(new CmsListItemDetailsFormatter(Messages.get().container(
438             Messages.GUI_LIST_INDEXSOURCE_DETAIL_RESOURCE_NAME_0)));
439         metadata.addItemDetails(resourceDetails);
440
441     }
442
443     /**
444      * @see org.opencms.workplace.list.A_CmsListDialog#setMultiActions(org.opencms.workplace.list.CmsListMetadata)
445      */

446     protected void setMultiActions(CmsListMetadata metadata) {
447
448         // add add multi action
449
CmsListMultiAction addMultiAction = new CmsListMultiAction(LIST_MACTION_ADDSOURCE);
450         addMultiAction.setName(Messages.get().container(Messages.GUI_LIST_SEARCHINDEX_MACTION_ADDSOURCE_NAME_0));
451         addMultiAction.setHelpText(Messages.get().container(Messages.GUI_LIST_SEARCHINDEX_MACTION_ADDSOURCE_NAME_HELP_0));
452         addMultiAction.setIconPath(ICON_MULTI_ADD);
453         metadata.addMultiAction(addMultiAction);
454     }
455
456     /**
457      * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters()
458      */

459     protected void validateParamaters() throws Exception JavaDoc {
460
461         // test the needed parameters
462
if (getParamIndexName() == null) {
463             throw new CmsIllegalStateException(Messages.get().container(
464                 Messages.ERR_SEARCHINDEX_EDIT_MISSING_PARAM_1,
465                 A_CmsEditSearchIndexDialog.PARAM_INDEXNAME));
466         }
467     }
468
469     /**
470      * Writes the updated search configuration back to the XML
471      * configuration file and refreshes the complete list.<p>
472      *
473      * @param refresh if true, the list items are refreshed
474      */

475     protected void writeConfiguration(boolean refresh) {
476
477         // update the XML configuration
478
OpenCms.writeConfiguration(CmsSearchConfiguration.class);
479         if (refresh) {
480             refreshList();
481         }
482     }
483
484     /**
485      * Fills details about document types of the index source into the given item. <p>
486      *
487      * @param item the list item to fill
488      * @param detailId the id for the detail to fill
489      *
490      */

491     private void fillDetailDocTypes(CmsListItem item, String JavaDoc detailId) {
492
493         CmsSearchManager searchManager = OpenCms.getSearchManager();
494         StringBuffer JavaDoc html = new StringBuffer JavaDoc();
495
496         // search for the corresponding CmsSearchIndexSource:
497
String JavaDoc idxSourceName = (String JavaDoc)item.get(LIST_COLUMN_NAME);
498         CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName);
499
500         // get the index sources doc types
501
List JavaDoc docTypes = idxSource.getDocumentTypes();
502         // output of found index sources
503
Iterator JavaDoc itDocTypes = docTypes.iterator();
504         CmsSearchDocumentType docType;
505         html.append("<ul>\n");
506         while (itDocTypes.hasNext()) {
507             // get the instance (instead of plain name) for more detail in future...
508
docType = searchManager.getDocumentTypeConfig(itDocTypes.next().toString());
509             // harden against unconfigured doctypes that are refferred to by indexsource nodes
510
if (docType != null) {
511
512                 html.append(" <li>\n").append(" ").append(docType.getName()).append("\n");
513                 html.append(" </li>");
514             }
515         }
516
517         html.append("</ul>\n");
518         item.set(detailId, html.toString());
519     }
520
521     /**
522      * Fills details about resource paths of the index source into the given item. <p>
523      *
524      * @param item the list item to fill
525      * @param detailId the id for the detail to fill
526      *
527      */

528     private void fillDetailResources(CmsListItem item, String JavaDoc detailId) {
529
530         CmsSearchManager searchManager = OpenCms.getSearchManager();
531         StringBuffer JavaDoc html = new StringBuffer JavaDoc();
532
533         // search for the corresponding CmsSearchIndexSource:
534
String JavaDoc idxSourceName = (String JavaDoc)item.get(LIST_COLUMN_NAME);
535         CmsSearchIndexSource idxSource = searchManager.getIndexSource(idxSourceName);
536
537         // get the index sources resource strings
538
List JavaDoc resources = idxSource.getResourcesNames();
539         // output of found index sources
540
Iterator JavaDoc itResources = resources.iterator();
541         html.append("<ul>\n");
542         while (itResources.hasNext()) {
543
544             html.append(" <li>\n").append(" ").append(itResources.next().toString()).append("\n");
545             html.append(" </li>");
546         }
547
548         html.append("</ul>\n");
549
550         item.set(detailId, html.toString());
551     }
552
553     /**
554      * Returns the available search indexes of this installation.
555      *
556      * @return the available search indexes of this installation
557      */

558     private List JavaDoc searchIndexSources() {
559
560         CmsSearchManager manager = OpenCms.getSearchManager();
561         CmsSearchIndex index = manager.getIndex(getParamIndexName());
562         List JavaDoc sources = index.getSources();
563         return sources;
564     }
565
566 }
567
Popular Tags