001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.documentlibrary.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the document library file entry remote service. This utility wraps {@link com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see DLFileEntryService
030     * @see com.liferay.portlet.documentlibrary.service.base.DLFileEntryServiceBaseImpl
031     * @see com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl
032     * @generated
033     */
034    public class DLFileEntryServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
041                    long groupId, long repositoryId, long folderId,
042                    java.lang.String sourceFileName, java.lang.String mimeType,
043                    java.lang.String title, java.lang.String description,
044                    java.lang.String changeLog, long fileEntryTypeId,
045                    java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap,
046                    java.io.File file, java.io.InputStream is, long size,
047                    com.liferay.portal.service.ServiceContext serviceContext)
048                    throws com.liferay.portal.kernel.exception.PortalException,
049                            com.liferay.portal.kernel.exception.SystemException {
050                    return getService()
051                                       .addFileEntry(groupId, repositoryId, folderId,
052                            sourceFileName, mimeType, title, description, changeLog,
053                            fileEntryTypeId, fieldsMap, file, is, size, serviceContext);
054            }
055    
056            public static void cancelCheckOut(long fileEntryId)
057                    throws com.liferay.portal.kernel.exception.PortalException,
058                            com.liferay.portal.kernel.exception.SystemException {
059                    getService().cancelCheckOut(fileEntryId);
060            }
061    
062            public static void checkInFileEntry(long fileEntryId, boolean major,
063                    java.lang.String changeLog,
064                    com.liferay.portal.service.ServiceContext serviceContext)
065                    throws com.liferay.portal.kernel.exception.PortalException,
066                            com.liferay.portal.kernel.exception.SystemException {
067                    getService()
068                            .checkInFileEntry(fileEntryId, major, changeLog, serviceContext);
069            }
070    
071            public static void checkInFileEntry(long fileEntryId,
072                    java.lang.String lockUuid)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().checkInFileEntry(fileEntryId, lockUuid);
076            }
077    
078            public static com.liferay.portlet.documentlibrary.model.DLFileEntry checkOutFileEntry(
079                    long fileEntryId)
080                    throws com.liferay.portal.kernel.exception.PortalException,
081                            com.liferay.portal.kernel.exception.SystemException {
082                    return getService().checkOutFileEntry(fileEntryId);
083            }
084    
085            public static com.liferay.portlet.documentlibrary.model.DLFileEntry checkOutFileEntry(
086                    long fileEntryId, java.lang.String owner, long expirationTime)
087                    throws com.liferay.portal.kernel.exception.PortalException,
088                            com.liferay.portal.kernel.exception.SystemException {
089                    return getService().checkOutFileEntry(fileEntryId, owner, expirationTime);
090            }
091    
092            public static com.liferay.portlet.documentlibrary.model.DLFileEntry copyFileEntry(
093                    long groupId, long repositoryId, long fileEntryId, long destFolderId,
094                    com.liferay.portal.service.ServiceContext serviceContext)
095                    throws com.liferay.portal.kernel.exception.PortalException,
096                            com.liferay.portal.kernel.exception.SystemException {
097                    return getService()
098                                       .copyFileEntry(groupId, repositoryId, fileEntryId,
099                            destFolderId, serviceContext);
100            }
101    
102            public static void deleteFileEntry(long fileEntryId)
103                    throws com.liferay.portal.kernel.exception.PortalException,
104                            com.liferay.portal.kernel.exception.SystemException {
105                    getService().deleteFileEntry(fileEntryId);
106            }
107    
108            public static void deleteFileEntry(long groupId, long folderId,
109                    java.lang.String title)
110                    throws com.liferay.portal.kernel.exception.PortalException,
111                            com.liferay.portal.kernel.exception.SystemException {
112                    getService().deleteFileEntry(groupId, folderId, title);
113            }
114    
115            public static java.io.InputStream getFileAsStream(long fileEntryId,
116                    java.lang.String version)
117                    throws com.liferay.portal.kernel.exception.PortalException,
118                            com.liferay.portal.kernel.exception.SystemException {
119                    return getService().getFileAsStream(fileEntryId, version);
120            }
121    
122            public static java.io.InputStream getFileAsStream(long fileEntryId,
123                    java.lang.String version, boolean incrementCounter)
124                    throws com.liferay.portal.kernel.exception.PortalException,
125                            com.liferay.portal.kernel.exception.SystemException {
126                    return getService()
127                                       .getFileAsStream(fileEntryId, version, incrementCounter);
128            }
129    
130            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
131                    long groupId, long folderId, int start, int end,
132                    com.liferay.portal.kernel.util.OrderByComparator obc)
133                    throws com.liferay.portal.kernel.exception.SystemException {
134                    return getService().getFileEntries(groupId, folderId, start, end, obc);
135            }
136    
137            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
138                    long groupId, long folderId, long fileEntryTypeId, int start, int end,
139                    com.liferay.portal.kernel.util.OrderByComparator obc)
140                    throws com.liferay.portal.kernel.exception.SystemException {
141                    return getService()
142                                       .getFileEntries(groupId, folderId, fileEntryTypeId, start,
143                            end, obc);
144            }
145    
146            public static int getFileEntriesCount(long groupId, long folderId)
147                    throws com.liferay.portal.kernel.exception.SystemException {
148                    return getService().getFileEntriesCount(groupId, folderId);
149            }
150    
151            public static int getFileEntriesCount(long groupId, long folderId,
152                    long fileEntryTypeId)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return getService()
155                                       .getFileEntriesCount(groupId, folderId, fileEntryTypeId);
156            }
157    
158            public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
159                    long fileEntryId)
160                    throws com.liferay.portal.kernel.exception.PortalException,
161                            com.liferay.portal.kernel.exception.SystemException {
162                    return getService().getFileEntry(fileEntryId);
163            }
164    
165            public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
166                    long groupId, long folderId, java.lang.String title)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    return getService().getFileEntry(groupId, folderId, title);
170            }
171    
172            public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByUuidAndGroupId(
173                    java.lang.String uuid, long groupId)
174                    throws com.liferay.portal.kernel.exception.PortalException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getService().getFileEntryByUuidAndGroupId(uuid, groupId);
177            }
178    
179            public static com.liferay.portal.model.Lock getFileEntryLock(
180                    long fileEntryId) {
181                    return getService().getFileEntryLock(fileEntryId);
182            }
183    
184            public static int getFoldersFileEntriesCount(long groupId,
185                    java.util.List<java.lang.Long> folderIds, int status)
186                    throws com.liferay.portal.kernel.exception.SystemException {
187                    return getService()
188                                       .getFoldersFileEntriesCount(groupId, folderIds, status);
189            }
190    
191            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
192                    long groupId, long userId, long rootFolderId, int start, int end,
193                    com.liferay.portal.kernel.util.OrderByComparator obc)
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getService()
196                                       .getGroupFileEntries(groupId, userId, rootFolderId, start,
197                            end, obc);
198            }
199    
200            public static int getGroupFileEntriesCount(long groupId, long userId,
201                    long rootFolderId)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getService()
204                                       .getGroupFileEntriesCount(groupId, userId, rootFolderId);
205            }
206    
207            public static boolean hasFileEntryLock(long fileEntryId)
208                    throws com.liferay.portal.kernel.exception.PortalException,
209                            com.liferay.portal.kernel.exception.SystemException {
210                    return getService().hasFileEntryLock(fileEntryId);
211            }
212    
213            public static boolean isFileEntryCheckedOut(long fileEntryId)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    return getService().isFileEntryCheckedOut(fileEntryId);
217            }
218    
219            public static com.liferay.portlet.documentlibrary.model.DLFileEntry moveFileEntry(
220                    long fileEntryId, long newFolderId,
221                    com.liferay.portal.service.ServiceContext serviceContext)
222                    throws com.liferay.portal.kernel.exception.PortalException,
223                            com.liferay.portal.kernel.exception.SystemException {
224                    return getService()
225                                       .moveFileEntry(fileEntryId, newFolderId, serviceContext);
226            }
227    
228            public static com.liferay.portal.model.Lock refreshFileEntryLock(
229                    java.lang.String lockUuid, long expirationTime)
230                    throws com.liferay.portal.kernel.exception.PortalException,
231                            com.liferay.portal.kernel.exception.SystemException {
232                    return getService().refreshFileEntryLock(lockUuid, expirationTime);
233            }
234    
235            public static void revertFileEntry(long fileEntryId,
236                    java.lang.String version,
237                    com.liferay.portal.service.ServiceContext serviceContext)
238                    throws com.liferay.portal.kernel.exception.PortalException,
239                            com.liferay.portal.kernel.exception.SystemException {
240                    getService().revertFileEntry(fileEntryId, version, serviceContext);
241            }
242    
243            public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
244                    long fileEntryId, java.lang.String sourceFileName,
245                    java.lang.String mimeType, java.lang.String title,
246                    java.lang.String description, java.lang.String changeLog,
247                    boolean majorVersion, long fileEntryTypeId,
248                    java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap,
249                    java.io.File file, java.io.InputStream is, long size,
250                    com.liferay.portal.service.ServiceContext serviceContext)
251                    throws com.liferay.portal.kernel.exception.PortalException,
252                            com.liferay.portal.kernel.exception.SystemException {
253                    return getService()
254                                       .updateFileEntry(fileEntryId, sourceFileName, mimeType,
255                            title, description, changeLog, majorVersion, fileEntryTypeId,
256                            fieldsMap, file, is, size, serviceContext);
257            }
258    
259            public static boolean verifyFileEntryCheckOut(long fileEntryId,
260                    java.lang.String lockUuid)
261                    throws com.liferay.portal.kernel.exception.PortalException,
262                            com.liferay.portal.kernel.exception.SystemException {
263                    return getService().verifyFileEntryCheckOut(fileEntryId, lockUuid);
264            }
265    
266            public static DLFileEntryService getService() {
267                    if (_service == null) {
268                            _service = (DLFileEntryService)PortalBeanLocatorUtil.locate(DLFileEntryService.class.getName());
269    
270                            ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
271                                    "_service");
272                            MethodCache.remove(DLFileEntryService.class);
273                    }
274    
275                    return _service;
276            }
277    
278            public void setService(DLFileEntryService service) {
279                    MethodCache.remove(DLFileEntryService.class);
280    
281                    _service = service;
282    
283                    ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
284                            "_service");
285                    MethodCache.remove(DLFileEntryService.class);
286            }
287    
288            private static DLFileEntryService _service;
289    }