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.SearchException;
19  
20  import java.util.Date;
21  
22  /**
23   * <a href="DLIndexerUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class DLIndexerUtil {
28  
29      public static void addFile(
30              long companyId, String portletId, long groupId, long userId,
31              long repositoryId, String fileName)
32          throws SearchException {
33  
34          getDLIndexer().addFile(
35              companyId, portletId, groupId, userId, repositoryId, fileName);
36      }
37  
38      public static void addFile(
39              long companyId, String portletId, long groupId, long userId,
40              long repositoryId, String fileName, long fileEntryId,
41              String properties, Date modifiedDate, String[] tagsCategories,
42              String[] tagsEntries)
43          throws SearchException {
44  
45          getDLIndexer().addFile(
46              companyId, portletId, groupId, userId, repositoryId, fileName,
47              fileEntryId, properties, modifiedDate, tagsCategories, tagsEntries);
48      }
49  
50      /**
51       * @deprecated
52       */
53      public static void addFile(
54              long companyId, String portletId, long groupId, long repositoryId,
55              String fileName)
56          throws SearchException {
57  
58          getDLIndexer().addFile(
59              companyId, portletId, groupId, repositoryId, fileName);
60      }
61  
62      /**
63       * @deprecated
64       */
65      public static void addFile(
66              long companyId, String portletId, long groupId, long repositoryId,
67              String fileName, long fileEntryId, String properties,
68              Date modifiedDate, String[] tagsCategories, String[] tagsEntries)
69          throws SearchException {
70  
71          getDLIndexer().addFile(
72              companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
73              properties, modifiedDate, tagsCategories, tagsEntries);
74      }
75  
76      public static void deleteFile(
77              long companyId, String portletId, long repositoryId,
78              String fileName)
79          throws SearchException {
80  
81          getDLIndexer().deleteFile(companyId, portletId, repositoryId, fileName);
82      }
83  
84      public static DLIndexer getDLIndexer() {
85          return _dlIndexer;
86      }
87  
88      public static Document getFileDocument(
89              long companyId, String portletId, long groupId, long userId,
90              long repositoryId, String fileName)
91          throws SearchException {
92  
93          return getDLIndexer().getFileDocument(
94              companyId, portletId, groupId, userId, repositoryId, fileName);
95      }
96  
97      public static Document getFileDocument(
98              long companyId, String portletId, long groupId, long userId,
99              long repositoryId, String fileName, long fileEntryId,
100             String properties, Date modifiedDate, String[] tagsCategories,
101             String[] tagsEntries)
102         throws SearchException {
103 
104         return getDLIndexer().getFileDocument(
105             companyId, portletId, groupId, userId, repositoryId, fileName,
106             fileEntryId, properties, modifiedDate, tagsCategories, tagsEntries);
107     }
108 
109     /**
110      * @deprecated
111      */
112     public static Document getFileDocument(
113             long companyId, String portletId, long groupId, long repositoryId,
114             String fileName)
115         throws SearchException {
116 
117         return getDLIndexer().getFileDocument(
118             companyId, portletId, groupId, repositoryId, fileName);
119     }
120 
121     /**
122      * @deprecated
123      */
124     public static Document getFileDocument(
125             long companyId, String portletId, long groupId, long repositoryId,
126             String fileName, long fileEntryId, String properties,
127             Date modifiedDate, String[] tagsCategories, String[] tagsEntries)
128         throws SearchException {
129 
130         return getDLIndexer().getFileDocument(
131             companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
132             properties, modifiedDate, tagsCategories, tagsEntries);
133     }
134 
135     public static String getFileUID(
136         String portletId, long repositoryId, String fileName) {
137 
138         return getDLIndexer().getFileUID(portletId, repositoryId, fileName);
139     }
140 
141     public static void updateFile(
142             long companyId, String portletId, long groupId, long userId,
143             long repositoryId, String fileName, long fileEntryId,
144             String properties, Date modifiedDate, String[] tagsCategories,
145             String[] tagsEntries)
146         throws SearchException {
147 
148         getDLIndexer().updateFile(
149             companyId, portletId, groupId, userId, repositoryId, fileName,
150             fileEntryId, properties, modifiedDate, tagsCategories, tagsEntries);
151     }
152 
153     /**
154      * @deprecated
155      */
156     public static void updateFile(
157             long companyId, String portletId, long groupId, long repositoryId,
158             String fileName, long fileEntryId, String properties,
159             Date modifiedDate, String[] tagsCategories, String[] tagsEntries)
160         throws SearchException {
161 
162         getDLIndexer().updateFile(
163             companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
164             properties, modifiedDate, tagsCategories, tagsEntries);
165     }
166 
167     public void setDLIndexer(DLIndexer dlIndexer) {
168         _dlIndexer = dlIndexer;
169     }
170 
171     private static DLIndexer _dlIndexer;
172 
173 }