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 int getFileEntriesCount(long groupId, long folderId)
154 throws com.liferay.portal.kernel.exception.SystemException {
155 return getService().getFileEntriesCount(groupId, folderId);
156 }
157
158 public static int getFileEntriesCount(long groupId, long folderId,
159 long fileEntryTypeId)
160 throws com.liferay.portal.kernel.exception.SystemException {
161 return getService()
162 .getFileEntriesCount(groupId, folderId, fileEntryTypeId);
163 }
164
165 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
166 long fileEntryId)
167 throws com.liferay.portal.kernel.exception.PortalException,
168 com.liferay.portal.kernel.exception.SystemException {
169 return getService().getFileEntry(fileEntryId);
170 }
171
172 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
173 long groupId, long folderId, java.lang.String title)
174 throws com.liferay.portal.kernel.exception.PortalException,
175 com.liferay.portal.kernel.exception.SystemException {
176 return getService().getFileEntry(groupId, folderId, title);
177 }
178
179 public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByUuidAndGroupId(
180 java.lang.String uuid, long groupId)
181 throws com.liferay.portal.kernel.exception.PortalException,
182 com.liferay.portal.kernel.exception.SystemException {
183 return getService().getFileEntryByUuidAndGroupId(uuid, groupId);
184 }
185
186 public static com.liferay.portal.model.Lock getFileEntryLock(
187 long fileEntryId) {
188 return getService().getFileEntryLock(fileEntryId);
189 }
190
191 public static int getFoldersFileEntriesCount(long groupId,
192 java.util.List<java.lang.Long> folderIds, int status)
193 throws com.liferay.portal.kernel.exception.SystemException {
194 return getService()
195 .getFoldersFileEntriesCount(groupId, folderIds, status);
196 }
197
198 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getGroupFileEntries(
199 long groupId, long userId, long rootFolderId, int start, int end,
200 com.liferay.portal.kernel.util.OrderByComparator obc)
201 throws com.liferay.portal.kernel.exception.SystemException {
202 return getService()
203 .getGroupFileEntries(groupId, userId, rootFolderId, start,
204 end, obc);
205 }
206
207 public static int getGroupFileEntriesCount(long groupId, long userId,
208 long rootFolderId)
209 throws com.liferay.portal.kernel.exception.SystemException {
210 return getService()
211 .getGroupFileEntriesCount(groupId, userId, rootFolderId);
212 }
213
214 public static boolean hasFileEntryLock(long fileEntryId)
215 throws com.liferay.portal.kernel.exception.PortalException,
216 com.liferay.portal.kernel.exception.SystemException {
217 return getService().hasFileEntryLock(fileEntryId);
218 }
219
220 public static boolean isFileEntryCheckedOut(long fileEntryId)
221 throws com.liferay.portal.kernel.exception.PortalException,
222 com.liferay.portal.kernel.exception.SystemException {
223 return getService().isFileEntryCheckedOut(fileEntryId);
224 }
225
226 public static com.liferay.portlet.documentlibrary.model.DLFileEntry moveFileEntry(
227 long fileEntryId, long newFolderId,
228 com.liferay.portal.service.ServiceContext serviceContext)
229 throws com.liferay.portal.kernel.exception.PortalException,
230 com.liferay.portal.kernel.exception.SystemException {
231 return getService()
232 .moveFileEntry(fileEntryId, newFolderId, serviceContext);
233 }
234
235 public static com.liferay.portal.model.Lock refreshFileEntryLock(
236 java.lang.String lockUuid, long expirationTime)
237 throws com.liferay.portal.kernel.exception.PortalException,
238 com.liferay.portal.kernel.exception.SystemException {
239 return getService().refreshFileEntryLock(lockUuid, expirationTime);
240 }
241
242 public static void revertFileEntry(long fileEntryId,
243 java.lang.String version,
244 com.liferay.portal.service.ServiceContext serviceContext)
245 throws com.liferay.portal.kernel.exception.PortalException,
246 com.liferay.portal.kernel.exception.SystemException {
247 getService().revertFileEntry(fileEntryId, version, serviceContext);
248 }
249
250 public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
251 long fileEntryId, java.lang.String sourceFileName,
252 java.lang.String mimeType, java.lang.String title,
253 java.lang.String description, java.lang.String changeLog,
254 boolean majorVersion, long fileEntryTypeId,
255 java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap,
256 java.io.File file, java.io.InputStream is, long size,
257 com.liferay.portal.service.ServiceContext serviceContext)
258 throws com.liferay.portal.kernel.exception.PortalException,
259 com.liferay.portal.kernel.exception.SystemException {
260 return getService()
261 .updateFileEntry(fileEntryId, sourceFileName, mimeType,
262 title, description, changeLog, majorVersion, fileEntryTypeId,
263 fieldsMap, file, is, size, serviceContext);
264 }
265
266 public static boolean verifyFileEntryCheckOut(long fileEntryId,
267 java.lang.String lockUuid)
268 throws com.liferay.portal.kernel.exception.PortalException,
269 com.liferay.portal.kernel.exception.SystemException {
270 return getService().verifyFileEntryCheckOut(fileEntryId, lockUuid);
271 }
272
273 public static DLFileEntryService getService() {
274 if (_service == null) {
275 _service = (DLFileEntryService)PortalBeanLocatorUtil.locate(DLFileEntryService.class.getName());
276
277 ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
278 "_service");
279 MethodCache.remove(DLFileEntryService.class);
280 }
281
282 return _service;
283 }
284
285 public void setService(DLFileEntryService service) {
286 MethodCache.remove(DLFileEntryService.class);
287
288 _service = service;
289
290 ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
291 "_service");
292 MethodCache.remove(DLFileEntryService.class);
293 }
294
295 private static DLFileEntryService _service;
296 }