001
014
015 package com.liferay.portlet.imagegallery.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 IGImageServiceUtil {
035
040 public static com.liferay.portlet.imagegallery.model.IGImage addImage(
041 long groupId, long folderId, java.lang.String name,
042 java.lang.String description, java.io.File file,
043 java.lang.String contentType,
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 .addImage(groupId, folderId, name, description, file,
049 contentType, serviceContext);
050 }
051
052 public static void deleteImage(long imageId)
053 throws com.liferay.portal.kernel.exception.PortalException,
054 com.liferay.portal.kernel.exception.SystemException {
055 getService().deleteImage(imageId);
056 }
057
058 public static void deleteImageByFolderIdAndNameWithExtension(long groupId,
059 long folderId, java.lang.String nameWithExtension)
060 throws com.liferay.portal.kernel.exception.PortalException,
061 com.liferay.portal.kernel.exception.SystemException {
062 getService()
063 .deleteImageByFolderIdAndNameWithExtension(groupId, folderId,
064 nameWithExtension);
065 }
066
067 public static int getFoldersImagesCount(long groupId,
068 java.util.List<java.lang.Long> folderIds)
069 throws com.liferay.portal.kernel.exception.SystemException {
070 return getService().getFoldersImagesCount(groupId, folderIds);
071 }
072
073 public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
074 long groupId, long userId, int start, int end)
075 throws com.liferay.portal.kernel.exception.SystemException {
076 return getService().getGroupImages(groupId, userId, start, end);
077 }
078
079 public static int getGroupImagesCount(long groupId, long userId)
080 throws com.liferay.portal.kernel.exception.SystemException {
081 return getService().getGroupImagesCount(groupId, userId);
082 }
083
084 public static com.liferay.portlet.imagegallery.model.IGImage getImage(
085 long imageId)
086 throws com.liferay.portal.kernel.exception.PortalException,
087 com.liferay.portal.kernel.exception.SystemException {
088 return getService().getImage(imageId);
089 }
090
091 public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
092 long groupId, long folderId, java.lang.String nameWithExtension)
093 throws com.liferay.portal.kernel.exception.PortalException,
094 com.liferay.portal.kernel.exception.SystemException {
095 return getService()
096 .getImageByFolderIdAndNameWithExtension(groupId, folderId,
097 nameWithExtension);
098 }
099
100 public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
101 long largeImageId)
102 throws com.liferay.portal.kernel.exception.PortalException,
103 com.liferay.portal.kernel.exception.SystemException {
104 return getService().getImageByLargeImageId(largeImageId);
105 }
106
107 public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
108 long smallImageId)
109 throws com.liferay.portal.kernel.exception.PortalException,
110 com.liferay.portal.kernel.exception.SystemException {
111 return getService().getImageBySmallImageId(smallImageId);
112 }
113
114 public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
115 long groupId, long folderId)
116 throws com.liferay.portal.kernel.exception.SystemException {
117 return getService().getImages(groupId, folderId);
118 }
119
120 public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
121 long groupId, long folderId, int start, int end)
122 throws com.liferay.portal.kernel.exception.SystemException {
123 return getService().getImages(groupId, folderId, start, end);
124 }
125
126 public static int getImagesCount(long groupId, long folderId)
127 throws com.liferay.portal.kernel.exception.SystemException {
128 return getService().getImagesCount(groupId, folderId);
129 }
130
131 public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
132 long imageId, long groupId, long folderId, java.lang.String name,
133 java.lang.String description, java.io.File file,
134 java.lang.String contentType,
135 com.liferay.portal.service.ServiceContext serviceContext)
136 throws com.liferay.portal.kernel.exception.PortalException,
137 com.liferay.portal.kernel.exception.SystemException {
138 return getService()
139 .updateImage(imageId, groupId, folderId, name, description,
140 file, contentType, serviceContext);
141 }
142
143 public static IGImageService getService() {
144 if (_service == null) {
145 _service = (IGImageService)PortalBeanLocatorUtil.locate(IGImageService.class.getName());
146
147 ReferenceRegistry.registerReference(IGImageServiceUtil.class,
148 "_service");
149 MethodCache.remove(IGImageService.class);
150 }
151
152 return _service;
153 }
154
155 public void setService(IGImageService service) {
156 MethodCache.remove(IGImageService.class);
157
158 _service = service;
159
160 ReferenceRegistry.registerReference(IGImageServiceUtil.class, "_service");
161 MethodCache.remove(IGImageService.class);
162 }
163
164 private static IGImageService _service;
165 }