001
014
015 package com.liferay.portal.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 RepositoryServiceUtil {
035
040 public static long addRepository(long groupId, long classNameId,
041 long parentFolderId, java.lang.String name,
042 java.lang.String description, java.lang.String portletId,
043 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties,
044 com.liferay.portal.service.ServiceContext serviceContext)
045 throws com.liferay.portal.kernel.exception.PortalException,
046 com.liferay.portal.kernel.exception.SystemException {
047 return getService()
048 .addRepository(groupId, classNameId, parentFolderId, name,
049 description, portletId, typeSettingsProperties, serviceContext);
050 }
051
052 public static void checkRepository(long repositoryId)
053 throws com.liferay.portal.kernel.exception.PortalException,
054 com.liferay.portal.kernel.exception.SystemException {
055 getService().checkRepository(repositoryId);
056 }
057
058 public static void deleteRepository(long repositoryId)
059 throws com.liferay.portal.kernel.exception.PortalException,
060 com.liferay.portal.kernel.exception.SystemException {
061 getService().deleteRepository(repositoryId);
062 }
063
064 public static com.liferay.portal.kernel.repository.LocalRepository getLocalRepositoryImpl(
065 long repositoryId)
066 throws com.liferay.portal.kernel.exception.PortalException,
067 com.liferay.portal.kernel.exception.SystemException {
068 return getService().getLocalRepositoryImpl(repositoryId);
069 }
070
071 public static com.liferay.portal.kernel.repository.LocalRepository getLocalRepositoryImpl(
072 long folderId, long fileEntryId, long fileVersionId)
073 throws com.liferay.portal.kernel.exception.PortalException,
074 com.liferay.portal.kernel.exception.SystemException {
075 return getService()
076 .getLocalRepositoryImpl(folderId, fileEntryId, fileVersionId);
077 }
078
079 public static com.liferay.portal.model.Repository getRepository(
080 long repositoryId)
081 throws com.liferay.portal.kernel.exception.PortalException,
082 com.liferay.portal.kernel.exception.SystemException {
083 return getService().getRepository(repositoryId);
084 }
085
086 public static com.liferay.portal.kernel.repository.Repository getRepositoryImpl(
087 long repositoryId)
088 throws com.liferay.portal.kernel.exception.PortalException,
089 com.liferay.portal.kernel.exception.SystemException {
090 return getService().getRepositoryImpl(repositoryId);
091 }
092
093 public static com.liferay.portal.kernel.repository.Repository getRepositoryImpl(
094 long folderId, long fileEntryId, long fileVersionId)
095 throws com.liferay.portal.kernel.exception.PortalException,
096 com.liferay.portal.kernel.exception.SystemException {
097 return getService()
098 .getRepositoryImpl(folderId, fileEntryId, fileVersionId);
099 }
100
101 public static java.lang.String[] getSupportedConfigurations(
102 long classNameId)
103 throws com.liferay.portal.kernel.exception.SystemException {
104 return getService().getSupportedConfigurations(classNameId);
105 }
106
107 public static java.lang.String[] getSupportedParameters(long classNameId,
108 java.lang.String configuration)
109 throws com.liferay.portal.kernel.exception.SystemException {
110 return getService().getSupportedParameters(classNameId, configuration);
111 }
112
113 public static com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties(
114 long repositoryId)
115 throws com.liferay.portal.kernel.exception.PortalException,
116 com.liferay.portal.kernel.exception.SystemException {
117 return getService().getTypeSettingsProperties(repositoryId);
118 }
119
120 public static void updateRepository(long repositoryId,
121 java.lang.String name, java.lang.String description)
122 throws com.liferay.portal.kernel.exception.PortalException,
123 com.liferay.portal.kernel.exception.SystemException {
124 getService().updateRepository(repositoryId, name, description);
125 }
126
127 public static RepositoryService getService() {
128 if (_service == null) {
129 _service = (RepositoryService)PortalBeanLocatorUtil.locate(RepositoryService.class.getName());
130
131 ReferenceRegistry.registerReference(RepositoryServiceUtil.class,
132 "_service");
133 MethodCache.remove(RepositoryService.class);
134 }
135
136 return _service;
137 }
138
139 public void setService(RepositoryService service) {
140 MethodCache.remove(RepositoryService.class);
141
142 _service = service;
143
144 ReferenceRegistry.registerReference(RepositoryServiceUtil.class,
145 "_service");
146 MethodCache.remove(RepositoryService.class);
147 }
148
149 private static RepositoryService _service;
150 }