001
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
034 public class DLFileEntryServiceUtil {
035
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 com.liferay.portlet.documentlibrary.model.DLFileEntry fetchFileEntryByImageId(
116 long imageId)
117 throws com.liferay.portal.kernel.exception.PortalException,
118 com.liferay.portal.kernel.exception.SystemException {
119 return getService().fetchFileEntryByImageId(imageId);
120 }
121
122 public static java.io.InputStream getFileAsStream(long fileEntryId,
123 java.lang.String version)
124 throws com.liferay.portal.kernel.exception.PortalException,
125 com.liferay.portal.kernel.exception.SystemException {
126 return getService().getFileAsStream(fileEntryId, version);
127 }
128
129 public static java.io.InputStream getFileAsStream(long fileEntryId,
130 java.lang.String version, boolean incrementCounter)
131 throws com.liferay.portal.kernel.exception.PortalException,
132 com.liferay.portal.kernel.exception.SystemException {
133 return getService()
134 .getFileAsStream(fileEntryId, version, incrementCounter);
135 }
136
137 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
138 long groupId, long folderId, int start, int end,
139 com.liferay.portal.kernel.util.OrderByComparator obc)
140 throws com.liferay.portal.kernel.exception.SystemException {
141 return getService().getFileEntries(groupId, folderId, start, end, obc);
142 }
143
144 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
145 long groupId, long folderId, long fileEntryTypeId, int start, int end,
146 com.liferay.portal.kernel.util.OrderByComparator obc)
147 throws com.liferay.portal.kernel.exception.SystemException {
148 return getService()
149 .getFileEntries(groupId, folderId, fileEntryTypeId, start,
150 end, obc);
151 }
152
153 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
154 long groupId, long folderId, java.lang.String[] mimeTypes, int start,
155 int end, com.liferay.portal.kernel.util.OrderByComparator obc)
156 throws com.liferay.portal.kernel.exception.SystemException {
157 return getService()
158 .getFileEntries(groupId, folderId, mimeTypes, start, end, obc);
159 }
160
161 public static int getFileEntriesCount(long groupId, long folderId)
162 throws com.liferay.portal.kernel.exception.SystemException {
163 return getService().getFileEntriesCount(groupId, folderId);
164 }
165
166 public static int getFileEntriesCount(long groupId, long folderId,
167 long fileEntryTypeId)
168 throws com.liferay.portal.kernel.exception.SystemException {
169 return getService()
170 .getFileEntriesCount(groupId, folderId, fileEntryTypeId);
171 }
172
173 public static int getFileEntriesCount(long groupId, long folderId,
174 java.lang.String[] mimeTypes)
175 throws com.liferay.portal.kernel.exception.SystemException {
176 return getService().getFileEntriesCount(groupId, folderId, mimeTypes);
177 }
178
179 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
180 long fileEntryId)
181 throws com.liferay.portal.kernel.exception.PortalException,
182 com.liferay.portal.kernel.exception.SystemException {
183 return getService().getFileEntry(fileEntryId);
184 }
185
186 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
187 long groupId, long folderId, java.lang.String title)
188 throws com.liferay.portal.kernel.exception.PortalException,
189 com.liferay.portal.kernel.exception.SystemException {
190 return getService().getFileEntry(groupId, folderId, title);
191 }
192
193 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByUuidAndGroupId(
194 java.lang.String uuid, long groupId)
195 throws com.liferay.portal.kernel.exception.PortalException,
196 com.liferay.portal.kernel.exception.SystemException {
197 return getService().getFileEntryByUuidAndGroupId(uuid, groupId);
198 }
199
200 public static com.liferay.portal.model.Lock getFileEntryLock(
201 long fileEntryId) {
202 return getService().getFileEntryLock(fileEntryId);
203 }
204
205 public static int getFoldersFileEntriesCount(long groupId,
206 java.util.List<java.lang.Long> folderIds, int status)
207 throws com.liferay.portal.kernel.exception.SystemException {
208 return getService()
209 .getFoldersFileEntriesCount(groupId, folderIds, status);
210 }
211
212 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
213 long groupId, long userId, long rootFolderId, int start, int end,
214 com.liferay.portal.kernel.util.OrderByComparator obc)
215 throws com.liferay.portal.kernel.exception.SystemException {
216 return getService()
217 .getGroupFileEntries(groupId, userId, rootFolderId, start,
218 end, obc);
219 }
220
221 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
222 long groupId, long userId, long rootFolderId,
223 java.lang.String[] mimeTypes, int status, int start, int end,
224 com.liferay.portal.kernel.util.OrderByComparator obc)
225 throws com.liferay.portal.kernel.exception.SystemException {
226 return getService()
227 .getGroupFileEntries(groupId, userId, rootFolderId,
228 mimeTypes, status, start, end, obc);
229 }
230
231 public static int getGroupFileEntriesCount(long groupId, long userId,
232 long rootFolderId)
233 throws com.liferay.portal.kernel.exception.SystemException {
234 return getService()
235 .getGroupFileEntriesCount(groupId, userId, rootFolderId);
236 }
237
238 public static int getGroupFileEntriesCount(long groupId, long userId,
239 long rootFolderId, java.lang.String[] mimeTypes, int status)
240 throws com.liferay.portal.kernel.exception.SystemException {
241 return getService()
242 .getGroupFileEntriesCount(groupId, userId, rootFolderId,
243 mimeTypes, status);
244 }
245
246 public static boolean hasFileEntryLock(long fileEntryId)
247 throws com.liferay.portal.kernel.exception.PortalException,
248 com.liferay.portal.kernel.exception.SystemException {
249 return getService().hasFileEntryLock(fileEntryId);
250 }
251
252 public static boolean isFileEntryCheckedOut(long fileEntryId)
253 throws com.liferay.portal.kernel.exception.PortalException,
254 com.liferay.portal.kernel.exception.SystemException {
255 return getService().isFileEntryCheckedOut(fileEntryId);
256 }
257
258 public static com.liferay.portal.model.Lock lockFileEntry(long fileEntryId)
259 throws com.liferay.portal.kernel.exception.PortalException,
260 com.liferay.portal.kernel.exception.SystemException {
261 return getService().lockFileEntry(fileEntryId);
262 }
263
264 public static com.liferay.portal.model.Lock lockFileEntry(
265 long fileEntryId, java.lang.String owner, long expirationTime)
266 throws com.liferay.portal.kernel.exception.PortalException,
267 com.liferay.portal.kernel.exception.SystemException {
268 return getService().lockFileEntry(fileEntryId, owner, expirationTime);
269 }
270
271 public static com.liferay.portlet.documentlibrary.model.DLFileEntry moveFileEntry(
272 long fileEntryId, long newFolderId,
273 com.liferay.portal.service.ServiceContext serviceContext)
274 throws com.liferay.portal.kernel.exception.PortalException,
275 com.liferay.portal.kernel.exception.SystemException {
276 return getService()
277 .moveFileEntry(fileEntryId, newFolderId, serviceContext);
278 }
279
280 public static com.liferay.portal.model.Lock refreshFileEntryLock(
281 java.lang.String lockUuid, long expirationTime)
282 throws com.liferay.portal.kernel.exception.PortalException,
283 com.liferay.portal.kernel.exception.SystemException {
284 return getService().refreshFileEntryLock(lockUuid, expirationTime);
285 }
286
287 public static void revertFileEntry(long fileEntryId,
288 java.lang.String version,
289 com.liferay.portal.service.ServiceContext serviceContext)
290 throws com.liferay.portal.kernel.exception.PortalException,
291 com.liferay.portal.kernel.exception.SystemException {
292 getService().revertFileEntry(fileEntryId, version, serviceContext);
293 }
294
295 public static void unlockFileEntry(long fileEntryId)
296 throws com.liferay.portal.kernel.exception.PortalException,
297 com.liferay.portal.kernel.exception.SystemException {
298 getService().unlockFileEntry(fileEntryId);
299 }
300
301 public static void unlockFileEntry(long fileEntryId,
302 java.lang.String lockUuid)
303 throws com.liferay.portal.kernel.exception.PortalException,
304 com.liferay.portal.kernel.exception.SystemException {
305 getService().unlockFileEntry(fileEntryId, lockUuid);
306 }
307
308 public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
309 long fileEntryId, java.lang.String sourceFileName,
310 java.lang.String mimeType, java.lang.String title,
311 java.lang.String description, java.lang.String changeLog,
312 boolean majorVersion, long fileEntryTypeId,
313 java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap,
314 java.io.File file, java.io.InputStream is, long size,
315 com.liferay.portal.service.ServiceContext serviceContext)
316 throws com.liferay.portal.kernel.exception.PortalException,
317 com.liferay.portal.kernel.exception.SystemException {
318 return getService()
319 .updateFileEntry(fileEntryId, sourceFileName, mimeType,
320 title, description, changeLog, majorVersion, fileEntryTypeId,
321 fieldsMap, file, is, size, serviceContext);
322 }
323
324 public static boolean verifyFileEntryCheckOut(long fileEntryId,
325 java.lang.String lockUuid)
326 throws com.liferay.portal.kernel.exception.PortalException,
327 com.liferay.portal.kernel.exception.SystemException {
328 return getService().verifyFileEntryCheckOut(fileEntryId, lockUuid);
329 }
330
331 public static boolean verifyFileEntryLock(long fileEntryId,
332 java.lang.String lockUuid)
333 throws com.liferay.portal.kernel.exception.PortalException,
334 com.liferay.portal.kernel.exception.SystemException {
335 return getService().verifyFileEntryLock(fileEntryId, lockUuid);
336 }
337
338 public static DLFileEntryService getService() {
339 if (_service == null) {
340 _service = (DLFileEntryService)PortalBeanLocatorUtil.locate(DLFileEntryService.class.getName());
341
342 ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
343 "_service");
344 MethodCache.remove(DLFileEntryService.class);
345 }
346
347 return _service;
348 }
349
350 public void setService(DLFileEntryService service) {
351 MethodCache.remove(DLFileEntryService.class);
352
353 _service = service;
354
355 ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
356 "_service");
357 MethodCache.remove(DLFileEntryService.class);
358 }
359
360 private static DLFileEntryService _service;
361 }