2 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 package com.liferay.portlet.documentlibrary.folder.service;
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.util.ReferenceRegistry;
21 * The utility for the document library folder local service. This utility wraps {@link com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
24 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
27 * @author Brian Wing Shun Chan
28 * @see DLFolderLocalService
29 * @see com.liferay.portlet.documentlibrary.service.base.DLFolderLocalServiceBaseImpl
30 * @see com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl
33 public class DLFolderLocalServiceUtil {
35 * NOTE FOR DEVELOPERS:
37 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
41 * Adds the document library folder to the database. Also notifies the appropriate model listeners.
43 * @param dlFolder the document library folder
44 * @return the document library folder that was added
45 * @throws SystemException if a system exception occurred
47 public static com.liferay.portlet.documentlibrary.model.DLFolder addDLFolder(
48 com.liferay.portlet.documentlibrary.model.DLFolder dlFolder)
49 throws com.liferay.portal.kernel.exception.SystemException {
50 return getService().addDLFolder(dlFolder);
54 * Creates a new document library folder with the primary key. Does not add the document library folder to the database.
56 * @param folderId the primary key for the new document library folder
57 * @return the new document library folder
59 public static com.liferay.portlet.documentlibrary.model.DLFolder createDLFolder(
61 return getService().createDLFolder(folderId);
65 * Deletes the document library folder with the primary key from the database. Also notifies the appropriate model listeners.
67 * @param folderId the primary key of the document library folder
68 * @return the document library folder that was removed
69 * @throws PortalException if a document library folder with the primary key could not be found
70 * @throws SystemException if a system exception occurred
72 public static com.liferay.portlet.documentlibrary.model.DLFolder deleteDLFolder(
74 throws com.liferay.portal.kernel.exception.PortalException,
75 com.liferay.portal.kernel.exception.SystemException {
76 return getService().deleteDLFolder(folderId);
80 * Deletes the document library folder from the database. Also notifies the appropriate model listeners.
82 * @param dlFolder the document library folder
83 * @return the document library folder that was removed
84 * @throws SystemException if a system exception occurred
86 public static com.liferay.portlet.documentlibrary.model.DLFolder deleteDLFolder(
87 com.liferay.portlet.documentlibrary.model.DLFolder dlFolder)
88 throws com.liferay.portal.kernel.exception.SystemException {
89 return getService().deleteDLFolder(dlFolder);
92 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
93 return getService().dynamicQuery();
97 * Performs a dynamic query on the database and returns the matching rows.
99 * @param dynamicQuery the dynamic query
100 * @return the matching rows
101 * @throws SystemException if a system exception occurred
103 @SuppressWarnings("rawtypes")
104 public static java.util.List dynamicQuery(
105 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
106 throws com.liferay.portal.kernel.exception.SystemException {
107 return getService().dynamicQuery(dynamicQuery);
111 * Performs a dynamic query on the database and returns a range of the matching rows.
114 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
117 * @param dynamicQuery the dynamic query
118 * @param start the lower bound of the range of model instances
119 * @param end the upper bound of the range of model instances (not inclusive)
120 * @return the range of matching rows
121 * @throws SystemException if a system exception occurred
123 @SuppressWarnings("rawtypes")
124 public static java.util.List dynamicQuery(
125 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
126 int end) throws com.liferay.portal.kernel.exception.SystemException {
127 return getService().dynamicQuery(dynamicQuery, start, end);
131 * Performs a dynamic query on the database and returns an ordered range of the matching rows.
134 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
137 * @param dynamicQuery the dynamic query
138 * @param start the lower bound of the range of model instances
139 * @param end the upper bound of the range of model instances (not inclusive)
140 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141 * @return the ordered range of matching rows
142 * @throws SystemException if a system exception occurred
144 @SuppressWarnings("rawtypes")
145 public static java.util.List dynamicQuery(
146 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
148 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149 throws com.liferay.portal.kernel.exception.SystemException {
151 .dynamicQuery(dynamicQuery, start, end, orderByComparator);
155 * Returns the number of rows that match the dynamic query.
157 * @param dynamicQuery the dynamic query
158 * @return the number of rows that match the dynamic query
159 * @throws SystemException if a system exception occurred
161 public static long dynamicQueryCount(
162 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
163 throws com.liferay.portal.kernel.exception.SystemException {
164 return getService().dynamicQueryCount(dynamicQuery);
167 public static com.liferay.portlet.documentlibrary.model.DLFolder fetchDLFolder(
169 throws com.liferay.portal.kernel.exception.SystemException {
170 return getService().fetchDLFolder(folderId);
174 * Returns the document library folder with the primary key.
176 * @param folderId the primary key of the document library folder
177 * @return the document library folder
178 * @throws PortalException if a document library folder with the primary key could not be found
179 * @throws SystemException if a system exception occurred
181 public static com.liferay.portlet.documentlibrary.model.DLFolder getDLFolder(
183 throws com.liferay.portal.kernel.exception.PortalException,
184 com.liferay.portal.kernel.exception.SystemException {
185 return getService().getDLFolder(folderId);
188 public static com.liferay.portal.model.PersistedModel getPersistedModel(
189 java.io.Serializable primaryKeyObj)
190 throws com.liferay.portal.kernel.exception.PortalException,
191 com.liferay.portal.kernel.exception.SystemException {
192 return getService().getPersistedModel(primaryKeyObj);
196 * Returns the document library folder with the UUID in the group.
198 * @param uuid the UUID of document library folder
199 * @param groupId the group id of the document library folder
200 * @return the document library folder
201 * @throws PortalException if a document library folder with the UUID in the group could not be found
202 * @throws SystemException if a system exception occurred
204 public static com.liferay.portlet.documentlibrary.model.DLFolder getDLFolderByUuidAndGroupId(
205 java.lang.String uuid, long groupId)
206 throws com.liferay.portal.kernel.exception.PortalException,
207 com.liferay.portal.kernel.exception.SystemException {
208 return getService().getDLFolderByUuidAndGroupId(uuid, groupId);
212 * Returns a range of all the document library folders.
215 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
218 * @param start the lower bound of the range of document library folders
219 * @param end the upper bound of the range of document library folders (not inclusive)
220 * @return the range of document library folders
221 * @throws SystemException if a system exception occurred
223 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getDLFolders(
225 throws com.liferay.portal.kernel.exception.SystemException {
226 return getService().getDLFolders(start, end);
230 * Returns the number of document library folders.
232 * @return the number of document library folders
233 * @throws SystemException if a system exception occurred
235 public static int getDLFoldersCount()
236 throws com.liferay.portal.kernel.exception.SystemException {
237 return getService().getDLFoldersCount();
241 * Updates the document library folder in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
243 * @param dlFolder the document library folder
244 * @return the document library folder that was updated
245 * @throws SystemException if a system exception occurred
247 public static com.liferay.portlet.documentlibrary.model.DLFolder updateDLFolder(
248 com.liferay.portlet.documentlibrary.model.DLFolder dlFolder)
249 throws com.liferay.portal.kernel.exception.SystemException {
250 return getService().updateDLFolder(dlFolder);
254 * Updates the document library folder in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
256 * @param dlFolder the document library folder
257 * @param merge whether to merge the document library folder with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
258 * @return the document library folder that was updated
259 * @throws SystemException if a system exception occurred
261 public static com.liferay.portlet.documentlibrary.model.DLFolder updateDLFolder(
262 com.liferay.portlet.documentlibrary.model.DLFolder dlFolder,
264 throws com.liferay.portal.kernel.exception.SystemException {
265 return getService().updateDLFolder(dlFolder, merge);
269 * Returns the Spring bean ID for this bean.
271 * @return the Spring bean ID for this bean
273 public static java.lang.String getBeanIdentifier() {
274 return getService().getBeanIdentifier();
278 * Sets the Spring bean ID for this bean.
280 * @param beanIdentifier the Spring bean ID for this bean
282 public static void setBeanIdentifier(java.lang.String beanIdentifier) {
283 getService().setBeanIdentifier(beanIdentifier);
286 public static com.liferay.portlet.documentlibrary.model.DLFolder addFolder(
287 long userId, long groupId, long repositoryId, boolean mountPoint,
288 long parentFolderId, java.lang.String name,
289 java.lang.String description,
290 com.liferay.portal.service.ServiceContext serviceContext)
291 throws com.liferay.portal.kernel.exception.PortalException,
292 com.liferay.portal.kernel.exception.SystemException {
294 .addFolder(userId, groupId, repositoryId, mountPoint,
295 parentFolderId, name, description, serviceContext);
298 public static void deleteAll(long groupId)
299 throws com.liferay.portal.kernel.exception.PortalException,
300 com.liferay.portal.kernel.exception.SystemException {
301 getService().deleteAll(groupId);
304 public static void deleteFolder(long folderId)
305 throws com.liferay.portal.kernel.exception.PortalException,
306 com.liferay.portal.kernel.exception.SystemException {
307 getService().deleteFolder(folderId);
310 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getCompanyFolders(
311 long companyId, int start, int end)
312 throws com.liferay.portal.kernel.exception.SystemException {
313 return getService().getCompanyFolders(companyId, start, end);
316 public static int getCompanyFoldersCount(long companyId)
317 throws com.liferay.portal.kernel.exception.SystemException {
318 return getService().getCompanyFoldersCount(companyId);
321 public static java.util.List<java.lang.Object> getFileEntriesAndFileShortcuts(
322 long groupId, long folderId, int status, int start, int end)
323 throws com.liferay.portal.kernel.exception.SystemException {
325 .getFileEntriesAndFileShortcuts(groupId, folderId, status,
329 public static int getFileEntriesAndFileShortcutsCount(long groupId,
330 long folderId, int status)
331 throws com.liferay.portal.kernel.exception.SystemException {
333 .getFileEntriesAndFileShortcutsCount(groupId, folderId,
337 public static com.liferay.portlet.documentlibrary.model.DLFolder getFolder(
339 throws com.liferay.portal.kernel.exception.PortalException,
340 com.liferay.portal.kernel.exception.SystemException {
341 return getService().getFolder(folderId);
344 public static com.liferay.portlet.documentlibrary.model.DLFolder getFolder(
345 long groupId, long parentFolderId, java.lang.String name)
346 throws com.liferay.portal.kernel.exception.PortalException,
347 com.liferay.portal.kernel.exception.SystemException {
348 return getService().getFolder(groupId, parentFolderId, name);
351 public static long getFolderId(long companyId, long folderId)
352 throws com.liferay.portal.kernel.exception.SystemException {
353 return getService().getFolderId(companyId, folderId);
356 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getFolders(
357 long groupId, long parentFolderId)
358 throws com.liferay.portal.kernel.exception.SystemException {
359 return getService().getFolders(groupId, parentFolderId);
362 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getFolders(
363 long groupId, long parentFolderId, boolean includeMountfolders)
364 throws com.liferay.portal.kernel.exception.SystemException {
366 .getFolders(groupId, parentFolderId, includeMountfolders);
369 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getFolders(
370 long groupId, long parentFolderId, boolean includeMountfolders,
371 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
372 throws com.liferay.portal.kernel.exception.SystemException {
374 .getFolders(groupId, parentFolderId, includeMountfolders,
378 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getFolders(
379 long groupId, long parentFolderId, int start, int end,
380 com.liferay.portal.kernel.util.OrderByComparator obc)
381 throws com.liferay.portal.kernel.exception.SystemException {
382 return getService().getFolders(groupId, parentFolderId, start, end, obc);
385 public static java.util.List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts(
386 long groupId, long folderId, int status, boolean includeMountFolders,
387 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
388 throws com.liferay.portal.kernel.exception.SystemException {
390 .getFoldersAndFileEntriesAndFileShortcuts(groupId, folderId,
391 status, includeMountFolders, start, end, obc);
394 public static java.util.List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts(
395 long groupId, long folderId, int status, java.lang.String[] mimeTypes,
396 boolean includeMountFolders, int start, int end,
397 com.liferay.portal.kernel.util.OrderByComparator obc)
398 throws com.liferay.portal.kernel.exception.SystemException {
400 .getFoldersAndFileEntriesAndFileShortcuts(groupId, folderId,
401 status, mimeTypes, includeMountFolders, start, end, obc);
404 public static int getFoldersAndFileEntriesAndFileShortcutsCount(
405 long groupId, long folderId, int status, boolean includeMountFolders)
406 throws com.liferay.portal.kernel.exception.SystemException {
408 .getFoldersAndFileEntriesAndFileShortcutsCount(groupId,
409 folderId, status, includeMountFolders);
412 public static int getFoldersAndFileEntriesAndFileShortcutsCount(
413 long groupId, long folderId, int status, java.lang.String[] mimeTypes,
414 boolean includeMountFolders)
415 throws com.liferay.portal.kernel.exception.SystemException {
417 .getFoldersAndFileEntriesAndFileShortcutsCount(groupId,
418 folderId, status, mimeTypes, includeMountFolders);
421 public static int getFoldersCount(long groupId, long parentFolderId)
422 throws com.liferay.portal.kernel.exception.SystemException {
423 return getService().getFoldersCount(groupId, parentFolderId);
426 public static int getFoldersCount(long groupId, long parentFolderId,
427 boolean includeMountfolders)
428 throws com.liferay.portal.kernel.exception.SystemException {
430 .getFoldersCount(groupId, parentFolderId, includeMountfolders);
433 public static int getFoldersFileEntriesCount(long groupId,
434 java.util.List<java.lang.Long> folderIds, int status)
435 throws com.liferay.portal.kernel.exception.SystemException {
437 .getFoldersFileEntriesCount(groupId, folderIds, status);
440 public static com.liferay.portlet.documentlibrary.model.DLFolder getMountFolder(
442 throws com.liferay.portal.kernel.exception.PortalException,
443 com.liferay.portal.kernel.exception.SystemException {
444 return getService().getMountFolder(repositoryId);
447 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getMountFolders(
448 long groupId, long parentFolderId, int start, int end,
449 com.liferay.portal.kernel.util.OrderByComparator obc)
450 throws com.liferay.portal.kernel.exception.SystemException {
452 .getMountFolders(groupId, parentFolderId, start, end, obc);
455 public static int getMountFoldersCount(long groupId, long parentFolderId)
456 throws com.liferay.portal.kernel.exception.SystemException {
457 return getService().getMountFoldersCount(groupId, parentFolderId);
460 public static void getSubfolderIds(
461 java.util.List<java.lang.Long> folderIds, long groupId, long folderId)
462 throws com.liferay.portal.kernel.exception.SystemException {
463 getService().getSubfolderIds(folderIds, groupId, folderId);
466 public static com.liferay.portlet.documentlibrary.model.DLFolder moveFolder(
467 long folderId, long parentFolderId,
468 com.liferay.portal.service.ServiceContext serviceContext)
469 throws com.liferay.portal.kernel.exception.PortalException,
470 com.liferay.portal.kernel.exception.SystemException {
471 return getService().moveFolder(folderId, parentFolderId, serviceContext);
474 public static com.liferay.portlet.documentlibrary.model.DLFolder updateFolder(
475 long folderId, long parentFolderId, java.lang.String name,
476 java.lang.String description, long defaultFileEntryTypeId,
477 java.util.List<java.lang.Long> fileEntryTypeIds,
478 boolean overrideFileEntryTypes,
479 com.liferay.portal.service.ServiceContext serviceContext)
480 throws com.liferay.portal.kernel.exception.PortalException,
481 com.liferay.portal.kernel.exception.SystemException {
483 .updateFolder(folderId, parentFolderId, name, description,
484 defaultFileEntryTypeId, fileEntryTypeIds, overrideFileEntryTypes,
488 public static com.liferay.portlet.documentlibrary.model.DLFolder updateFolder(
489 long folderId, java.lang.String name, java.lang.String description,
490 long defaultFileEntryTypeId,
491 java.util.List<java.lang.Long> fileEntryTypeIds,
492 boolean overrideFileEntryTypes,
493 com.liferay.portal.service.ServiceContext serviceContext)
494 throws com.liferay.portal.kernel.exception.PortalException,
495 com.liferay.portal.kernel.exception.SystemException {
497 .updateFolder(folderId, name, description,
498 defaultFileEntryTypeId, fileEntryTypeIds, overrideFileEntryTypes,
502 public static com.liferay.portlet.documentlibrary.model.DLFolder updateFolderAndFileEntryTypes(
503 long folderId, long parentFolderId, java.lang.String name,
504 java.lang.String description, long defaultFileEntryTypeId,
505 java.util.List<java.lang.Long> fileEntryTypeIds,
506 boolean overrideFileEntryTypes,
507 com.liferay.portal.service.ServiceContext serviceContext)
508 throws com.liferay.portal.kernel.exception.PortalException,
509 com.liferay.portal.kernel.exception.SystemException {
511 .updateFolderAndFileEntryTypes(folderId, parentFolderId,
512 name, description, defaultFileEntryTypeId, fileEntryTypeIds,
513 overrideFileEntryTypes, serviceContext);
516 public static void updateLastPostDate(long folderId,
517 java.util.Date lastPostDate)
518 throws com.liferay.portal.kernel.exception.PortalException,
519 com.liferay.portal.kernel.exception.SystemException {
520 getService().updateLastPostDate(folderId, lastPostDate);
523 public static com.liferay.portal.kernel.search.Hits search(long companyId,
524 long groupId, long userId, long[] folderIds, java.lang.String keywords,
525 int start, int end) throws com.liferay.portal.kernel.exception.SystemException {
527 .search(companyId, groupId, userId, folderIds, keywords,
531 public static com.liferay.portal.kernel.search.Hits search(long companyId,
532 long groupId, long userId, long ownerUserId, java.lang.String keywords,
533 int start, int end) throws com.liferay.portal.kernel.exception.SystemException {
535 .search(companyId, groupId, userId, ownerUserId, keywords,
539 public static com.liferay.portal.kernel.search.Hits searchByDate(long companyId,
540 long groupId, long userId, long ownerUserId, java.lang.String keywords,
541 int start, int end) throws com.liferay.portal.kernel.exception.SystemException {
543 .searchByDate(companyId, groupId, userId, ownerUserId, keywords,
547 public static DLFolderLocalService getService() {
548 if (_service == null) {
549 _service = (DLFolderLocalService)PortalBeanLocatorUtil.locate(DLFolderLocalService.class.getName());
551 ReferenceRegistry.registerReference(DLFolderLocalServiceUtil.class,
561 public void setService(DLFolderLocalService service) {
564 private static DLFolderLocalService _service;