1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.documentlibrary.util;
16  
17  import com.liferay.portal.kernel.search.Document;
18  import com.liferay.portal.kernel.search.DocumentSummary;
19  import com.liferay.portal.kernel.search.SearchEngineUtil;
20  import com.liferay.portal.kernel.search.SearchException;
21  
22  import java.util.Date;
23  
24  import javax.portlet.PortletURL;
25  
26  /**
27   * <a href="Indexer.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Wing Shun Chan
30   * @author Harry Mark
31   * @author Bruno Farache
32   * @author Raymond Augé
33   */
34  public class Indexer implements com.liferay.portal.kernel.search.Indexer {
35  
36      /**
37       * @deprecated Use {@link DLIndexerUtil}.
38       */
39      public static void addFile(
40              long companyId, String portletId, long groupId, long repositoryId,
41              String fileName)
42          throws SearchException {
43  
44          DLIndexerUtil.addFile(
45              companyId, portletId, groupId, repositoryId, fileName);
46      }
47  
48      /**
49       * @deprecated Use {@link DLIndexerUtil}.
50       */
51      public static void addFile(
52              long companyId, String portletId, long groupId, long repositoryId,
53              String fileName, String properties, Date modifiedDate,
54              String[] tagsEntries)
55          throws SearchException {
56  
57          DLIndexerUtil.addFile(
58              companyId, portletId, groupId, repositoryId, fileName, properties,
59              modifiedDate, tagsEntries);
60      }
61  
62      /**
63       * @deprecated Use {@link DLIndexerUtil}.
64       */
65      public static void deleteFile(
66              long companyId, String portletId, long repositoryId,
67              String fileName)
68          throws SearchException {
69  
70          DLIndexerUtil.deleteFile(companyId, portletId, repositoryId, fileName);
71      }
72  
73      /**
74       * @deprecated Use {@link DLIndexerUtil}.
75       */
76      public static Document getFileDocument(
77              long companyId, String portletId, long groupId, long repositoryId,
78              String fileName)
79          throws SearchException {
80  
81          return DLIndexerUtil.getFileDocument(
82              companyId, portletId, groupId, repositoryId, fileName);
83      }
84  
85      /**
86       * @deprecated Use {@link DLIndexerUtil}.
87       */
88      public static Document getFileDocument(
89              long companyId, String portletId, long groupId, long repositoryId,
90              String fileName, String properties, Date modifiedDate,
91              String[] tagsEntries)
92          throws SearchException{
93  
94          return DLIndexerUtil.getFileDocument(
95              companyId, portletId, groupId, repositoryId, fileName, properties,
96              modifiedDate, tagsEntries);
97      }
98  
99      /**
100      * @deprecated Use {@link DLIndexerUtil}.
101      */
102     public static String getFileUID(
103         String portletId, long repositoryId, String fileName) {
104 
105         return DLIndexerUtil.getFileUID(portletId, repositoryId, fileName);
106     }
107 
108     /**
109      * @deprecated Use {@link DLIndexerUtil}.
110      */
111     public static void updateFile(
112             long companyId, String portletId, long groupId, long repositoryId,
113             String fileName, String properties, Date modifiedDate,
114             String[] tagsEntries)
115         throws SearchException {
116 
117         DLIndexerUtil.updateFile(
118             companyId, portletId, groupId, repositoryId, fileName, properties,
119             modifiedDate, tagsEntries);
120     }
121 
122     public DocumentSummary getDocumentSummary(
123         com.liferay.portal.kernel.search.Document doc, PortletURL portletURL) {
124 
125         return null;
126     }
127 
128     public void reIndex(String[] ids) throws SearchException {
129         if (SearchEngineUtil.isIndexReadOnly()) {
130             return;
131         }
132 
133         Hook hook = HookFactory.getInstance();
134 
135         hook.reIndex(ids);
136     }
137 
138 }