001
014
015 package com.liferay.portal.kernel.repository.proxy;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.repository.LocalRepository;
019 import com.liferay.portal.kernel.repository.capabilities.Capability;
020 import com.liferay.portal.kernel.repository.model.FileEntry;
021 import com.liferay.portal.kernel.repository.model.FileShortcut;
022 import com.liferay.portal.kernel.repository.model.FileVersion;
023 import com.liferay.portal.kernel.repository.model.Folder;
024 import com.liferay.portal.kernel.repository.model.RepositoryEntry;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026 import com.liferay.portal.service.ServiceContext;
027
028 import java.io.File;
029 import java.io.InputStream;
030
031 import java.util.List;
032
033
036 public class LocalRepositoryProxyBean
037 extends RepositoryModelProxyBean implements LocalRepository {
038
039 public LocalRepositoryProxyBean(
040 LocalRepository localRepository, ClassLoader classLoader) {
041
042 super(classLoader);
043
044 _localRepository = localRepository;
045 }
046
047 @Override
048 public FileEntry addFileEntry(
049 long userId, long folderId, String sourceFileName, String mimeType,
050 String title, String description, String changeLog, File file,
051 ServiceContext serviceContext)
052 throws PortalException {
053
054 FileEntry fileEntry = _localRepository.addFileEntry(
055 userId, folderId, sourceFileName, mimeType, title, description,
056 changeLog, file, serviceContext);
057
058 return newFileEntryProxyBean(fileEntry);
059 }
060
061 @Override
062 public FileEntry addFileEntry(
063 long userId, long folderId, String sourceFileName, String mimeType,
064 String title, String description, String changeLog, InputStream is,
065 long size, ServiceContext serviceContext)
066 throws PortalException {
067
068 FileEntry fileEntry = _localRepository.addFileEntry(
069 userId, folderId, sourceFileName, mimeType, title, description,
070 changeLog, is, size, serviceContext);
071
072 return newFileEntryProxyBean(fileEntry);
073 }
074
075 @Override
076 public FileShortcut addFileShortcut(
077 long userId, long folderId, long toFileEntryId,
078 ServiceContext serviceContext)
079 throws PortalException {
080
081 FileShortcut fileShortcut = _localRepository.addFileShortcut(
082 userId, folderId, toFileEntryId, serviceContext);
083
084 return newFileShortcutProxyBean(fileShortcut);
085 }
086
087 @Override
088 public Folder addFolder(
089 long userId, long parentFolderId, String name, String description,
090 ServiceContext serviceContext)
091 throws PortalException {
092
093 Folder folder = _localRepository.addFolder(
094 userId, parentFolderId, name, description, serviceContext);
095
096 return newFolderProxyBean(folder);
097 }
098
099 @Override
100 public void checkInFileEntry(
101 long userId, long fileEntryId, boolean major, String changeLog,
102 ServiceContext serviceContext)
103 throws PortalException {
104
105 _localRepository.checkInFileEntry(
106 userId, fileEntryId, major, changeLog, serviceContext);
107 }
108
109 @Override
110 public void checkInFileEntry(
111 long userId, long fileEntryId, String lockUuid,
112 ServiceContext serviceContext)
113 throws PortalException {
114
115 _localRepository.checkInFileEntry(
116 userId, fileEntryId, lockUuid, serviceContext);
117 }
118
119 @Override
120 public FileEntry copyFileEntry(
121 long userId, long groupId, long fileEntryId, long destFolderId,
122 ServiceContext serviceContext)
123 throws PortalException {
124
125 FileEntry fileEntry = _localRepository.copyFileEntry(
126 userId, groupId, fileEntryId, destFolderId, serviceContext);
127
128 return newFileEntryProxyBean(fileEntry);
129 }
130
131 @Override
132 public void deleteAll() throws PortalException {
133 _localRepository.deleteAll();
134 }
135
136 @Override
137 public void deleteFileEntry(long fileEntryId) throws PortalException {
138 _localRepository.deleteFileEntry(fileEntryId);
139 }
140
141 @Override
142 public void deleteFileShortcut(long fileShortcutId) throws PortalException {
143 _localRepository.deleteFileShortcut(fileShortcutId);
144 }
145
146 @Override
147 public void deleteFileShortcuts(long toFileEntryId) throws PortalException {
148 _localRepository.deleteFileShortcuts(toFileEntryId);
149 }
150
151 @Override
152 public void deleteFolder(long folderId) throws PortalException {
153 _localRepository.deleteFolder(folderId);
154 }
155
156 @Override
157 public <T extends Capability> T getCapability(Class<T> capabilityClass) {
158 return _localRepository.getCapability(capabilityClass);
159 }
160
161 @Override
162 public List<FileEntry> getFileEntries(
163 long folderId, int status, int start, int end,
164 OrderByComparator<FileEntry> obc)
165 throws PortalException {
166
167 return _localRepository.getFileEntries(
168 folderId, status, start, end, obc);
169 }
170
171 @Override
172 public List<FileEntry> getFileEntries(
173 long folderId, int start, int end, OrderByComparator<FileEntry> obc)
174 throws PortalException {
175
176 return _localRepository.getFileEntries(folderId, start, end, obc);
177 }
178
179 @Override
180 public List<RepositoryEntry> getFileEntriesAndFileShortcuts(
181 long folderId, int status, int start, int end)
182 throws PortalException {
183
184 return _localRepository.getFileEntriesAndFileShortcuts(
185 folderId, status, start, end);
186 }
187
188 @Override
189 public int getFileEntriesAndFileShortcutsCount(long folderId, int status)
190 throws PortalException {
191
192 return _localRepository.getFileEntriesAndFileShortcutsCount(
193 folderId, status);
194 }
195
196 @Override
197 public int getFileEntriesCount(long folderId) throws PortalException {
198 return _localRepository.getFileEntriesCount(folderId);
199 }
200
201 @Override
202 public int getFileEntriesCount(long folderId, int status)
203 throws PortalException {
204
205 return _localRepository.getFileEntriesCount(folderId, status);
206 }
207
208 @Override
209 public FileEntry getFileEntry(long fileEntryId) throws PortalException {
210 FileEntry fileEntry = _localRepository.getFileEntry(fileEntryId);
211
212 return newFileEntryProxyBean(fileEntry);
213 }
214
215 @Override
216 public FileEntry getFileEntry(long folderId, String title)
217 throws PortalException {
218
219 FileEntry fileEntry = _localRepository.getFileEntry(folderId, title);
220
221 return newFileEntryProxyBean(fileEntry);
222 }
223
224 @Override
225 public FileEntry getFileEntryByUuid(String uuid) throws PortalException {
226 FileEntry fileEntry = _localRepository.getFileEntryByUuid(uuid);
227
228 return newFileEntryProxyBean(fileEntry);
229 }
230
231 @Override
232 public FileShortcut getFileShortcut(long fileShortcutId)
233 throws PortalException {
234
235 FileShortcut fileShortcut = _localRepository.getFileShortcut(
236 fileShortcutId);
237
238 return newFileShortcutProxyBean(fileShortcut);
239 }
240
241 @Override
242 public FileVersion getFileVersion(long fileVersionId)
243 throws PortalException {
244
245 FileVersion fileVersion = _localRepository.getFileVersion(
246 fileVersionId);
247
248 return newFileVersionProxyBean(fileVersion);
249 }
250
251 @Override
252 public Folder getFolder(long folderId) throws PortalException {
253 Folder folder = _localRepository.getFolder(folderId);
254
255 return newFolderProxyBean(folder);
256 }
257
258 @Override
259 public Folder getFolder(long parentFolderId, String name)
260 throws PortalException {
261
262 return _localRepository.getFolder(parentFolderId, name);
263 }
264
265 @Override
266 public List<Folder> getFolders(
267 long parentFolderId, boolean includeMountFolders, int start,
268 int end, OrderByComparator<Folder> obc)
269 throws PortalException {
270
271 return _localRepository.getFolders(
272 parentFolderId, includeMountFolders, start, end, obc);
273 }
274
275 @Override
276 public List<Folder> getFolders(
277 long parentFolderId, int status, boolean includeMountFolders,
278 int start, int end, OrderByComparator<Folder> obc)
279 throws PortalException {
280
281 return _localRepository.getFolders(
282 parentFolderId, status, includeMountFolders, start, end, obc);
283 }
284
285 @Override
286 public List<RepositoryEntry> getFoldersAndFileEntriesAndFileShortcuts(
287 long folderId, int status, boolean includeMountFolders, int start,
288 int end, OrderByComparator<?> obc)
289 throws PortalException {
290
291 return _localRepository.getFoldersAndFileEntriesAndFileShortcuts(
292 folderId, status, includeMountFolders, start, end, obc);
293 }
294
295 @Override
296 public int getFoldersAndFileEntriesAndFileShortcutsCount(
297 long folderId, int status, boolean includeMountFolders)
298 throws PortalException {
299
300 return _localRepository.getFoldersAndFileEntriesAndFileShortcutsCount(
301 folderId, status, includeMountFolders);
302 }
303
304 @Override
305 public int getFoldersCount(long parentFolderId, boolean includeMountfolders)
306 throws PortalException {
307
308 return _localRepository.getFoldersCount(
309 parentFolderId, includeMountfolders);
310 }
311
312 @Override
313 public int getFoldersCount(
314 long parentFolderId, int status, boolean includeMountfolders)
315 throws PortalException {
316
317 return _localRepository.getFoldersCount(
318 parentFolderId, status, includeMountfolders);
319 }
320
321 @Override
322 public List<FileEntry> getRepositoryFileEntries(
323 long userId, long rootFolderId, int start, int end,
324 OrderByComparator<FileEntry> obc)
325 throws PortalException {
326
327 return _localRepository.getRepositoryFileEntries(
328 userId, rootFolderId, start, end, obc);
329 }
330
331 @Override
332 public long getRepositoryId() {
333 return _localRepository.getRepositoryId();
334 }
335
336 @Override
337 public <T extends Capability> boolean isCapabilityProvided(
338 Class<T> capabilityClass) {
339
340 return _localRepository.isCapabilityProvided(capabilityClass);
341 }
342
343 @Override
344 public FileEntry moveFileEntry(
345 long userId, long fileEntryId, long newFolderId,
346 ServiceContext serviceContext)
347 throws PortalException {
348
349 FileEntry fileEntry = _localRepository.moveFileEntry(
350 userId, fileEntryId, newFolderId, serviceContext);
351
352 return newFileEntryProxyBean(fileEntry);
353 }
354
355 @Override
356 public Folder moveFolder(
357 long userId, long folderId, long parentFolderId,
358 ServiceContext serviceContext)
359 throws PortalException {
360
361 Folder folder = _localRepository.moveFolder(
362 userId, folderId, parentFolderId, serviceContext);
363
364 return newFolderProxyBean(folder);
365 }
366
367 @Override
368 public void revertFileEntry(
369 long userId, long fileEntryId, String version,
370 ServiceContext serviceContext)
371 throws PortalException {
372
373 _localRepository.revertFileEntry(
374 userId, fileEntryId, version, serviceContext);
375 }
376
377
380 @Deprecated
381 @Override
382 public void updateAsset(
383 long userId, FileEntry fileEntry, FileVersion fileVersion,
384 long[] assetCategoryIds, String[] assetTagNames,
385 long[] assetLinkEntryIds)
386 throws PortalException {
387
388 _localRepository.updateAsset(
389 userId, fileEntry, fileVersion, assetCategoryIds, assetTagNames,
390 assetLinkEntryIds);
391 }
392
393 @Override
394 public FileEntry updateFileEntry(
395 long userId, long fileEntryId, String sourceFileName,
396 String mimeType, String title, String description, String changeLog,
397 boolean majorVersion, File file, ServiceContext serviceContext)
398 throws PortalException {
399
400 FileEntry fileEntry = _localRepository.updateFileEntry(
401 userId, fileEntryId, sourceFileName, mimeType, title, description,
402 changeLog, majorVersion, file, serviceContext);
403
404 return newFileEntryProxyBean(fileEntry);
405 }
406
407 @Override
408 public FileEntry updateFileEntry(
409 long userId, long fileEntryId, String sourceFileName,
410 String mimeType, String title, String description, String changeLog,
411 boolean majorVersion, InputStream is, long size,
412 ServiceContext serviceContext)
413 throws PortalException {
414
415 FileEntry fileEntry = _localRepository.updateFileEntry(
416 userId, fileEntryId, sourceFileName, mimeType, title, description,
417 changeLog, majorVersion, is, size, serviceContext);
418
419 return newFileEntryProxyBean(fileEntry);
420 }
421
422 @Override
423 public FileShortcut updateFileShortcut(
424 long userId, long fileShortcutId, long folderId, long toFileEntryId,
425 ServiceContext serviceContext)
426 throws PortalException {
427
428 FileShortcut fileShortcut = _localRepository.updateFileShortcut(
429 userId, fileShortcutId, folderId, toFileEntryId, serviceContext);
430
431 return newFileShortcutProxyBean(fileShortcut);
432 }
433
434 @Override
435 public void updateFileShortcuts(
436 long oldToFileEntryId, long newToFileEntryId)
437 throws PortalException {
438
439 _localRepository.updateFileShortcuts(
440 oldToFileEntryId, newToFileEntryId);
441 }
442
443 @Override
444 public Folder updateFolder(
445 long folderId, long parentFolderId, String name, String description,
446 ServiceContext serviceContext)
447 throws PortalException {
448
449 return _localRepository.updateFolder(
450 folderId, parentFolderId, name, description, serviceContext);
451 }
452
453 private final LocalRepository _localRepository;
454
455 }