1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.documentlibrary.service;
21  
22  
23  /**
24   * <a href="DLFileEntryLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService
42   *
43   */
44  public class DLFileEntryLocalServiceUtil {
45      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addDLFileEntry(
46          com.liferay.portlet.documentlibrary.model.DLFileEntry dlFileEntry)
47          throws com.liferay.portal.SystemException {
48          return getService().addDLFileEntry(dlFileEntry);
49      }
50  
51      public static com.liferay.portlet.documentlibrary.model.DLFileEntry createDLFileEntry(
52          long fileEntryId) {
53          return getService().createDLFileEntry(fileEntryId);
54      }
55  
56      public static void deleteDLFileEntry(long fileEntryId)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException {
59          getService().deleteDLFileEntry(fileEntryId);
60      }
61  
62      public static void deleteDLFileEntry(
63          com.liferay.portlet.documentlibrary.model.DLFileEntry dlFileEntry)
64          throws com.liferay.portal.SystemException {
65          getService().deleteDLFileEntry(dlFileEntry);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portlet.documentlibrary.model.DLFileEntry getDLFileEntry(
81          long fileEntryId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getDLFileEntry(fileEntryId);
85      }
86  
87      public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getDLFileEntries(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getDLFileEntries(start, end);
90      }
91  
92      public static int getDLFileEntriesCount()
93          throws com.liferay.portal.SystemException {
94          return getService().getDLFileEntriesCount();
95      }
96  
97      public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateDLFileEntry(
98          com.liferay.portlet.documentlibrary.model.DLFileEntry dlFileEntry)
99          throws com.liferay.portal.SystemException {
100         return getService().updateDLFileEntry(dlFileEntry);
101     }
102 
103     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateDLFileEntry(
104         com.liferay.portlet.documentlibrary.model.DLFileEntry dlFileEntry,
105         boolean merge) throws com.liferay.portal.SystemException {
106         return getService().updateDLFileEntry(dlFileEntry, merge);
107     }
108 
109     public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
110         long userId, long folderId, java.lang.String name,
111         java.lang.String title, java.lang.String description,
112         java.lang.String extraSettings, byte[] bytes,
113         com.liferay.portal.service.ServiceContext serviceContext)
114         throws com.liferay.portal.PortalException,
115             com.liferay.portal.SystemException {
116         return getService()
117                    .addFileEntry(userId, folderId, name, title, description,
118             extraSettings, bytes, serviceContext);
119     }
120 
121     public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
122         long userId, long folderId, java.lang.String name,
123         java.lang.String title, java.lang.String description,
124         java.lang.String extraSettings, java.io.File file,
125         com.liferay.portal.service.ServiceContext serviceContext)
126         throws com.liferay.portal.PortalException,
127             com.liferay.portal.SystemException {
128         return getService()
129                    .addFileEntry(userId, folderId, name, title, description,
130             extraSettings, file, serviceContext);
131     }
132 
133     public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
134         java.lang.String uuid, long userId, long folderId,
135         java.lang.String name, java.lang.String title,
136         java.lang.String description, java.lang.String extraSettings,
137         byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException {
140         return getService()
141                    .addFileEntry(uuid, userId, folderId, name, title,
142             description, extraSettings, bytes, serviceContext);
143     }
144 
145     public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
146         java.lang.String uuid, long userId, long folderId,
147         java.lang.String name, java.lang.String title,
148         java.lang.String description, java.lang.String extraSettings,
149         java.io.InputStream is, long size,
150         com.liferay.portal.service.ServiceContext serviceContext)
151         throws com.liferay.portal.PortalException,
152             com.liferay.portal.SystemException {
153         return getService()
154                    .addFileEntry(uuid, userId, folderId, name, title,
155             description, extraSettings, is, size, serviceContext);
156     }
157 
158     public static void addFileEntryResources(long fileEntryId,
159         boolean addCommunityPermissions, boolean addGuestPermissions)
160         throws com.liferay.portal.PortalException,
161             com.liferay.portal.SystemException {
162         getService()
163             .addFileEntryResources(fileEntryId, addCommunityPermissions,
164             addGuestPermissions);
165     }
166 
167     public static void addFileEntryResources(
168         com.liferay.portlet.documentlibrary.model.DLFileEntry fileEntry,
169         boolean addCommunityPermissions, boolean addGuestPermissions)
170         throws com.liferay.portal.PortalException,
171             com.liferay.portal.SystemException {
172         getService()
173             .addFileEntryResources(fileEntry, addCommunityPermissions,
174             addGuestPermissions);
175     }
176 
177     public static void addFileEntryResources(long fileEntryId,
178         java.lang.String[] communityPermissions,
179         java.lang.String[] guestPermissions)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         getService()
183             .addFileEntryResources(fileEntryId, communityPermissions,
184             guestPermissions);
185     }
186 
187     public static void addFileEntryResources(
188         com.liferay.portlet.documentlibrary.model.DLFileEntry fileEntry,
189         java.lang.String[] communityPermissions,
190         java.lang.String[] guestPermissions)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException {
193         getService()
194             .addFileEntryResources(fileEntry, communityPermissions,
195             guestPermissions);
196     }
197 
198     public static com.liferay.portlet.documentlibrary.model.DLFileEntry addOrOverwriteFileEntry(
199         long userId, long folderId, java.lang.String name,
200         java.lang.String sourceName, java.lang.String title,
201         java.lang.String description, java.lang.String extraSettings,
202         java.io.File file,
203         com.liferay.portal.service.ServiceContext serviceContext)
204         throws com.liferay.portal.PortalException,
205             com.liferay.portal.SystemException {
206         return getService()
207                    .addOrOverwriteFileEntry(userId, folderId, name, sourceName,
208             title, description, extraSettings, file, serviceContext);
209     }
210 
211     public static void deleteFileEntries(long folderId)
212         throws com.liferay.portal.PortalException,
213             com.liferay.portal.SystemException {
214         getService().deleteFileEntries(folderId);
215     }
216 
217     public static void deleteFileEntry(long folderId, java.lang.String name)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         getService().deleteFileEntry(folderId, name);
221     }
222 
223     public static void deleteFileEntry(long folderId, java.lang.String name,
224         double version)
225         throws com.liferay.portal.PortalException,
226             com.liferay.portal.SystemException {
227         getService().deleteFileEntry(folderId, name, version);
228     }
229 
230     public static void deleteFileEntry(
231         com.liferay.portlet.documentlibrary.model.DLFileEntry fileEntry)
232         throws com.liferay.portal.PortalException,
233             com.liferay.portal.SystemException {
234         getService().deleteFileEntry(fileEntry);
235     }
236 
237     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getCompanyFileEntries(
238         long companyId, int start, int end)
239         throws com.liferay.portal.SystemException {
240         return getService().getCompanyFileEntries(companyId, start, end);
241     }
242 
243     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getCompanyFileEntries(
244         long companyId, int start, int end,
245         com.liferay.portal.kernel.util.OrderByComparator obc)
246         throws com.liferay.portal.SystemException {
247         return getService().getCompanyFileEntries(companyId, start, end, obc);
248     }
249 
250     public static int getCompanyFileEntriesCount(long companyId)
251         throws com.liferay.portal.SystemException {
252         return getService().getCompanyFileEntriesCount(companyId);
253     }
254 
255     public static java.io.InputStream getFileAsStream(long companyId,
256         long userId, long folderId, java.lang.String name)
257         throws com.liferay.portal.PortalException,
258             com.liferay.portal.SystemException {
259         return getService().getFileAsStream(companyId, userId, folderId, name);
260     }
261 
262     public static java.io.InputStream getFileAsStream(long companyId,
263         long userId, long folderId, java.lang.String name, double version)
264         throws com.liferay.portal.PortalException,
265             com.liferay.portal.SystemException {
266         return getService()
267                    .getFileAsStream(companyId, userId, folderId, name, version);
268     }
269 
270     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
271         long folderId) throws com.liferay.portal.SystemException {
272         return getService().getFileEntries(folderId);
273     }
274 
275     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
276         long folderId, int start, int end)
277         throws com.liferay.portal.SystemException {
278         return getService().getFileEntries(folderId, start, end);
279     }
280 
281     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
282         long folderId, int start, int end,
283         com.liferay.portal.kernel.util.OrderByComparator obc)
284         throws com.liferay.portal.SystemException {
285         return getService().getFileEntries(folderId, start, end, obc);
286     }
287 
288     public static int getFileEntriesCount(long folderId)
289         throws com.liferay.portal.SystemException {
290         return getService().getFileEntriesCount(folderId);
291     }
292 
293     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
294         long fileEntryId)
295         throws com.liferay.portal.PortalException,
296             com.liferay.portal.SystemException {
297         return getService().getFileEntry(fileEntryId);
298     }
299 
300     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
301         long folderId, java.lang.String name)
302         throws com.liferay.portal.PortalException,
303             com.liferay.portal.SystemException {
304         return getService().getFileEntry(folderId, name);
305     }
306 
307     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByUuidAndGroupId(
308         java.lang.String uuid, long groupId)
309         throws com.liferay.portal.PortalException,
310             com.liferay.portal.SystemException {
311         return getService().getFileEntryByUuidAndGroupId(uuid, groupId);
312     }
313 
314     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
315         long folderId, java.lang.String titleWithExtension)
316         throws com.liferay.portal.PortalException,
317             com.liferay.portal.SystemException {
318         return getService().getFileEntryByTitle(folderId, titleWithExtension);
319     }
320 
321     public static int getFoldersFileEntriesCount(java.util.List<Long> folderIds)
322         throws com.liferay.portal.SystemException {
323         return getService().getFoldersFileEntriesCount(folderIds);
324     }
325 
326     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
327         long groupId, int start, int end)
328         throws com.liferay.portal.SystemException {
329         return getService().getGroupFileEntries(groupId, start, end);
330     }
331 
332     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
333         long groupId, int start, int end,
334         com.liferay.portal.kernel.util.OrderByComparator obc)
335         throws com.liferay.portal.SystemException {
336         return getService().getGroupFileEntries(groupId, start, end, obc);
337     }
338 
339     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
340         long groupId, long userId, int start, int end)
341         throws com.liferay.portal.SystemException {
342         return getService().getGroupFileEntries(groupId, userId, start, end);
343     }
344 
345     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
346         long groupId, long userId, int start, int end,
347         com.liferay.portal.kernel.util.OrderByComparator obc)
348         throws com.liferay.portal.SystemException {
349         return getService().getGroupFileEntries(groupId, userId, start, end, obc);
350     }
351 
352     public static int getGroupFileEntriesCount(long groupId)
353         throws com.liferay.portal.SystemException {
354         return getService().getGroupFileEntriesCount(groupId);
355     }
356 
357     public static int getGroupFileEntriesCount(long groupId, long userId)
358         throws com.liferay.portal.SystemException {
359         return getService().getGroupFileEntriesCount(groupId, userId);
360     }
361 
362     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getNoAssetFileEntries()
363         throws com.liferay.portal.SystemException {
364         return getService().getNoAssetFileEntries();
365     }
366 
367     public static void reIndex(long fileEntryId)
368         throws com.liferay.portal.SystemException {
369         getService().reIndex(fileEntryId);
370     }
371 
372     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
373         long userId, long folderId, long newFolderId, java.lang.String name,
374         java.lang.String sourceFileName, java.lang.String title,
375         java.lang.String description, java.lang.String extraSettings,
376         java.io.File file,
377         com.liferay.portal.service.ServiceContext serviceContext)
378         throws com.liferay.portal.PortalException,
379             com.liferay.portal.SystemException {
380         return getService()
381                    .updateFileEntry(userId, folderId, newFolderId, name,
382             sourceFileName, title, description, extraSettings, file,
383             serviceContext);
384     }
385 
386     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
387         long userId, long folderId, long newFolderId, java.lang.String name,
388         java.lang.String sourceFileName, java.lang.String title,
389         java.lang.String description, java.lang.String extraSettings,
390         byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
391         throws com.liferay.portal.PortalException,
392             com.liferay.portal.SystemException {
393         return getService()
394                    .updateFileEntry(userId, folderId, newFolderId, name,
395             sourceFileName, title, description, extraSettings, bytes,
396             serviceContext);
397     }
398 
399     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
400         long userId, long folderId, long newFolderId, java.lang.String name,
401         java.lang.String sourceFileName, java.lang.String title,
402         java.lang.String description, java.lang.String extraSettings,
403         java.io.InputStream is, long size,
404         com.liferay.portal.service.ServiceContext serviceContext)
405         throws com.liferay.portal.PortalException,
406             com.liferay.portal.SystemException {
407         return getService()
408                    .updateFileEntry(userId, folderId, newFolderId, name,
409             sourceFileName, title, description, extraSettings, is, size,
410             serviceContext);
411     }
412 
413     public static void updateTagsAsset(long userId,
414         com.liferay.portlet.documentlibrary.model.DLFileEntry fileEntry,
415         java.lang.String[] tagsCategories, java.lang.String[] tagsEntries)
416         throws com.liferay.portal.PortalException,
417             com.liferay.portal.SystemException {
418         getService()
419             .updateTagsAsset(userId, fileEntry, tagsCategories, tagsEntries);
420     }
421 
422     public static DLFileEntryLocalService getService() {
423         if (_service == null) {
424             throw new RuntimeException("DLFileEntryLocalService is not set");
425         }
426 
427         return _service;
428     }
429 
430     public void setService(DLFileEntryLocalService service) {
431         _service = service;
432     }
433 
434     private static DLFileEntryLocalService _service;
435 }