1
14
15 package com.liferay.portlet.imagegallery.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.util.MethodCache;
19 import com.liferay.portal.kernel.util.ReferenceRegistry;
20
21
41 public class IGImageServiceUtil {
42 public static com.liferay.portlet.imagegallery.model.IGImage addImage(
43 long folderId, java.lang.String name, java.lang.String description,
44 java.io.File file, java.lang.String contentType,
45 com.liferay.portal.service.ServiceContext serviceContext)
46 throws com.liferay.portal.PortalException,
47 com.liferay.portal.SystemException {
48 return getService()
49 .addImage(folderId, name, description, file, contentType,
50 serviceContext);
51 }
52
53 public static void deleteImage(long imageId)
54 throws com.liferay.portal.PortalException,
55 com.liferay.portal.SystemException {
56 getService().deleteImage(imageId);
57 }
58
59 public static void deleteImageByFolderIdAndNameWithExtension(
60 long folderId, java.lang.String nameWithExtension)
61 throws com.liferay.portal.PortalException,
62 com.liferay.portal.SystemException {
63 getService()
64 .deleteImageByFolderIdAndNameWithExtension(folderId,
65 nameWithExtension);
66 }
67
68 public static com.liferay.portlet.imagegallery.model.IGImage getImage(
69 long imageId)
70 throws com.liferay.portal.PortalException,
71 com.liferay.portal.SystemException {
72 return getService().getImage(imageId);
73 }
74
75 public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
76 long folderId, java.lang.String nameWithExtension)
77 throws com.liferay.portal.PortalException,
78 com.liferay.portal.SystemException {
79 return getService()
80 .getImageByFolderIdAndNameWithExtension(folderId,
81 nameWithExtension);
82 }
83
84 public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
85 long largeImageId)
86 throws com.liferay.portal.PortalException,
87 com.liferay.portal.SystemException {
88 return getService().getImageByLargeImageId(largeImageId);
89 }
90
91 public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
92 long smallImageId)
93 throws com.liferay.portal.PortalException,
94 com.liferay.portal.SystemException {
95 return getService().getImageBySmallImageId(smallImageId);
96 }
97
98 public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
99 long folderId)
100 throws com.liferay.portal.PortalException,
101 com.liferay.portal.SystemException {
102 return getService().getImages(folderId);
103 }
104
105 public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
106 long imageId, long folderId, java.lang.String name,
107 java.lang.String description, java.io.File file,
108 java.lang.String contentType,
109 com.liferay.portal.service.ServiceContext serviceContext)
110 throws com.liferay.portal.PortalException,
111 com.liferay.portal.SystemException {
112 return getService()
113 .updateImage(imageId, folderId, name, description, file,
114 contentType, serviceContext);
115 }
116
117 public static IGImageService getService() {
118 if (_service == null) {
119 _service = (IGImageService)PortalBeanLocatorUtil.locate(IGImageService.class.getName());
120
121 ReferenceRegistry.registerReference(IGImageServiceUtil.class,
122 "_service");
123 MethodCache.remove(IGImageService.class);
124 }
125
126 return _service;
127 }
128
129 public void setService(IGImageService service) {
130 MethodCache.remove(IGImageService.class);
131
132 _service = service;
133
134 ReferenceRegistry.registerReference(IGImageServiceUtil.class, "_service");
135 MethodCache.remove(IGImageService.class);
136 }
137
138 private static IGImageService _service;
139 }