1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package com.sun.star.help;
29 
30 import com.sun.star.lib.uno.helper.Factory;
31 import com.sun.star.lang.XSingleComponentFactory;
32 import com.sun.star.registry.XRegistryKey;
33 
34 /*
35 import com.sun.star.lib.uno.helper.Factory;
36 import com.sun.star.lang.XMultiComponentFactory;
37 import com.sun.star.lang.XSingleComponentFactory;
38 import com.sun.star.lib.uno.helper.WeakBase;
39 import com.sun.star.uno.UnoRuntime;
40 import com.sun.star.uno.XComponentContext;
41 import com.sun.star.registry.XRegistryKey;
42 import com.sun.star.lang.XInitialization;
43 import com.sun.star.lang.XTypeProvider;
44 import com.sun.star.lang.XServiceInfo;
45 import com.sun.star.uno.Type;
46 import com.sun.star.uno.Any;
47 import com.sun.star.uno.AnyConverter;
48 
49 import org.apache.lucene.analysis.Analyzer;
50 import org.apache.lucene.analysis.standard.StandardAnalyzer;
51 import org.apache.lucene.document.Document;
52 import org.apache.lucene.index.FilterIndexReader;
53 import org.apache.lucene.index.IndexReader;
54 import org.apache.lucene.index.Term;
55 import org.apache.lucene.queryParser.QueryParser;
56 import org.apache.lucene.search.Hits;
57 import org.apache.lucene.search.IndexSearcher;
58 import org.apache.lucene.search.Query;
59 import org.apache.lucene.search.Searcher;
60 import org.apache.lucene.search.TermQuery;
61 import org.apache.lucene.search.WildcardQuery;
62 
63 import com.sun.star.script.XInvocation;
64 import com.sun.star.beans.XIntrospectionAccess;
65 
66 import java.io.FileOutputStream;
67 import java.io.PrintStream;
68 import java.io.File;
69 */
70 
71 /** This class capsulates the class, that implements the minimal component and a
72  * factory for creating the service (<CODE>__getComponentFactory</CODE>).
73  */
74 public class HelpComponent
75 {
76     /**
77      * Gives a factory for creating the service.
78      * This method is called by the <code>JavaLoader</code>
79      * <p>
80      * @return  returns a <code>XSingleComponentFactory</code> for creating
81      *          the component
82      * @param   sImplName the name of the implementation for which a
83      *          service is desired
84      * @see     com.sun.star.comp.loader.JavaLoader
85      */
86     public static XSingleComponentFactory __getComponentFactory(String sImplName)
87     {
88         XSingleComponentFactory xFactory = null;
89 
90         if ( sImplName.equals( HelpSearch._HelpSearch.class.getName() ) )
91             xFactory = Factory.createComponentFactory(HelpSearch._HelpSearch.class,
92                                              HelpSearch._HelpSearch.getServiceNames());
93         else if ( sImplName.equals( HelpIndexer.class.getName() ) )
94             xFactory = Factory.createComponentFactory(HelpIndexer.class,
95                                              HelpIndexer.getServiceNames());
96         return xFactory;
97     }
98 
99 	/** This method is a member of the interface for initializing an object
100 	 * directly after its creation.
101 	 * @param object This array of arbitrary objects will be passed to the
102 	 * component after its creation.
103 	 * @throws Exception Every exception will not be handled, but will be
104 	 * passed to the caller.
105 	 */
106 	public void initialize( Object[] object )
107 		throws com.sun.star.uno.Exception
108 	{
109 		/* The component describes what arguments its expected and in which
110 		 * order!At this point you can read the objects and can intialize
111 		 * your component using these objects.
112 		 */
113 	}
114 }
115