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 DLSyncServiceUtil {
035
040 public static com.liferay.portlet.documentlibrary.model.DLSyncUpdate getDLSyncUpdate(
041 long companyId, long repositoryId, java.util.Date lastAccessDate)
042 throws com.liferay.portal.kernel.exception.SystemException {
043 return getService()
044 .getDLSyncUpdate(companyId, repositoryId, lastAccessDate);
045 }
046
047 public static java.io.InputStream getFileDeltaAsStream(long fileEntryId,
048 java.lang.String sourceVersion, java.lang.String destinationVersion)
049 throws com.liferay.portal.kernel.exception.PortalException,
050 com.liferay.portal.kernel.exception.SystemException {
051 return getService()
052 .getFileDeltaAsStream(fileEntryId, sourceVersion,
053 destinationVersion);
054 }
055
056 public static com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry(
057 long fileEntryId, java.lang.String sourceFileName,
058 java.lang.String mimeType, java.lang.String title,
059 java.lang.String description, java.lang.String changeLog,
060 boolean majorVersion, java.io.InputStream deltaInputStream, long size,
061 com.liferay.portal.service.ServiceContext serviceContext)
062 throws com.liferay.portal.kernel.exception.PortalException,
063 com.liferay.portal.kernel.exception.SystemException {
064 return getService()
065 .updateFileEntry(fileEntryId, sourceFileName, mimeType,
066 title, description, changeLog, majorVersion, deltaInputStream,
067 size, serviceContext);
068 }
069
070 public static DLSyncService getService() {
071 if (_service == null) {
072 _service = (DLSyncService)PortalBeanLocatorUtil.locate(DLSyncService.class.getName());
073
074 ReferenceRegistry.registerReference(DLSyncServiceUtil.class,
075 "_service");
076 MethodCache.remove(DLSyncService.class);
077 }
078
079 return _service;
080 }
081
082 public void setService(DLSyncService service) {
083 MethodCache.remove(DLSyncService.class);
084
085 _service = service;
086
087 ReferenceRegistry.registerReference(DLSyncServiceUtil.class, "_service");
088 MethodCache.remove(DLSyncService.class);
089 }
090
091 private static DLSyncService _service;
092 }