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