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