1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.imagegallery.service;
24  
25  
26  /**
27   * <a href="IGImageLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portlet.imagegallery.service.IGImageLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portlet.imagegallery.service.IGImageLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portlet.imagegallery.service.IGImageLocalService
50   * @see com.liferay.portlet.imagegallery.service.IGImageLocalServiceFactory
51   *
52   */
53  public class IGImageLocalServiceUtil {
54      public static com.liferay.portlet.imagegallery.model.IGImage addIGImage(
55          com.liferay.portlet.imagegallery.model.IGImage igImage)
56          throws com.liferay.portal.SystemException {
57          IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
58  
59          return igImageLocalService.addIGImage(igImage);
60      }
61  
62      public static void deleteIGImage(long imageId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
66  
67          igImageLocalService.deleteIGImage(imageId);
68      }
69  
70      public static void deleteIGImage(
71          com.liferay.portlet.imagegallery.model.IGImage igImage)
72          throws com.liferay.portal.PortalException,
73              com.liferay.portal.SystemException {
74          IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
75  
76          igImageLocalService.deleteIGImage(igImage);
77      }
78  
79      public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> dynamicQuery(
80          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
81          throws com.liferay.portal.SystemException {
82          IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
83  
84          return igImageLocalService.dynamicQuery(queryInitializer);
85      }
86  
87      public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> dynamicQuery(
88          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
89          int begin, int end) throws com.liferay.portal.SystemException {
90          IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
91  
92          return igImageLocalService.dynamicQuery(queryInitializer, begin, end);
93      }
94  
95      public static com.liferay.portlet.imagegallery.model.IGImage updateIGImage(
96          com.liferay.portlet.imagegallery.model.IGImage igImage)
97          throws com.liferay.portal.SystemException {
98          IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
99  
100         return igImageLocalService.updateIGImage(igImage);
101     }
102 
103     public static com.liferay.portlet.imagegallery.model.IGImage addImage(
104         long userId, long folderId, java.lang.String name,
105         java.lang.String description, java.io.File file,
106         java.lang.String contentType, java.lang.String[] tagsEntries,
107         boolean addCommunityPermissions, boolean addGuestPermissions)
108         throws com.liferay.portal.PortalException,
109             com.liferay.portal.SystemException {
110         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
111 
112         return igImageLocalService.addImage(userId, folderId, name,
113             description, file, contentType, tagsEntries,
114             addCommunityPermissions, addGuestPermissions);
115     }
116 
117     public static com.liferay.portlet.imagegallery.model.IGImage addImage(
118         java.lang.String uuid, long userId, long folderId,
119         java.lang.String name, java.lang.String description, java.io.File file,
120         java.lang.String contentType, java.lang.String[] tagsEntries,
121         boolean addCommunityPermissions, boolean addGuestPermissions)
122         throws com.liferay.portal.PortalException,
123             com.liferay.portal.SystemException {
124         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
125 
126         return igImageLocalService.addImage(uuid, userId, folderId, name,
127             description, file, contentType, tagsEntries,
128             addCommunityPermissions, addGuestPermissions);
129     }
130 
131     public static com.liferay.portlet.imagegallery.model.IGImage addImage(
132         long userId, long folderId, java.lang.String name,
133         java.lang.String description, java.io.File file,
134         java.lang.String contentType, java.lang.String[] tagsEntries,
135         java.lang.String[] communityPermissions,
136         java.lang.String[] guestPermissions)
137         throws com.liferay.portal.PortalException,
138             com.liferay.portal.SystemException {
139         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
140 
141         return igImageLocalService.addImage(userId, folderId, name,
142             description, file, contentType, tagsEntries, communityPermissions,
143             guestPermissions);
144     }
145 
146     public static com.liferay.portlet.imagegallery.model.IGImage addImage(
147         java.lang.String uuid, long userId, long folderId,
148         java.lang.String name, java.lang.String description, java.io.File file,
149         java.lang.String contentType, java.lang.String[] tagsEntries,
150         java.lang.Boolean addCommunityPermissions,
151         java.lang.Boolean addGuestPermissions,
152         java.lang.String[] communityPermissions,
153         java.lang.String[] guestPermissions)
154         throws com.liferay.portal.PortalException,
155             com.liferay.portal.SystemException {
156         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
157 
158         return igImageLocalService.addImage(uuid, userId, folderId, name,
159             description, file, contentType, tagsEntries,
160             addCommunityPermissions, addGuestPermissions, communityPermissions,
161             guestPermissions);
162     }
163 
164     public static void addImageResources(long folderId, long imageId,
165         boolean addCommunityPermissions, boolean addGuestPermissions)
166         throws com.liferay.portal.PortalException,
167             com.liferay.portal.SystemException {
168         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
169 
170         igImageLocalService.addImageResources(folderId, imageId,
171             addCommunityPermissions, addGuestPermissions);
172     }
173 
174     public static void addImageResources(
175         com.liferay.portlet.imagegallery.model.IGFolder folder,
176         com.liferay.portlet.imagegallery.model.IGImage image,
177         boolean addCommunityPermissions, boolean addGuestPermissions)
178         throws com.liferay.portal.PortalException,
179             com.liferay.portal.SystemException {
180         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
181 
182         igImageLocalService.addImageResources(folder, image,
183             addCommunityPermissions, addGuestPermissions);
184     }
185 
186     public static void addImageResources(long folderId, long imageId,
187         java.lang.String[] communityPermissions,
188         java.lang.String[] guestPermissions)
189         throws com.liferay.portal.PortalException,
190             com.liferay.portal.SystemException {
191         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
192 
193         igImageLocalService.addImageResources(folderId, imageId,
194             communityPermissions, guestPermissions);
195     }
196 
197     public static void addImageResources(
198         com.liferay.portlet.imagegallery.model.IGFolder folder,
199         com.liferay.portlet.imagegallery.model.IGImage image,
200         java.lang.String[] communityPermissions,
201         java.lang.String[] guestPermissions)
202         throws com.liferay.portal.PortalException,
203             com.liferay.portal.SystemException {
204         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
205 
206         igImageLocalService.addImageResources(folder, image,
207             communityPermissions, guestPermissions);
208     }
209 
210     public static void deleteImage(long imageId)
211         throws com.liferay.portal.PortalException,
212             com.liferay.portal.SystemException {
213         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
214 
215         igImageLocalService.deleteImage(imageId);
216     }
217 
218     public static void deleteImage(
219         com.liferay.portlet.imagegallery.model.IGImage image)
220         throws com.liferay.portal.PortalException,
221             com.liferay.portal.SystemException {
222         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
223 
224         igImageLocalService.deleteImage(image);
225     }
226 
227     public static void deleteImages(long folderId)
228         throws com.liferay.portal.PortalException,
229             com.liferay.portal.SystemException {
230         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
231 
232         igImageLocalService.deleteImages(folderId);
233     }
234 
235     public static int getFoldersImagesCount(java.util.List<Long> folderIds)
236         throws com.liferay.portal.SystemException {
237         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
238 
239         return igImageLocalService.getFoldersImagesCount(folderIds);
240     }
241 
242     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
243         long groupId, int begin, int end)
244         throws com.liferay.portal.SystemException {
245         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
246 
247         return igImageLocalService.getGroupImages(groupId, begin, end);
248     }
249 
250     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
251         long groupId, long userId, int begin, int end)
252         throws com.liferay.portal.SystemException {
253         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
254 
255         return igImageLocalService.getGroupImages(groupId, userId, begin, end);
256     }
257 
258     public static int getGroupImagesCount(long groupId)
259         throws com.liferay.portal.SystemException {
260         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
261 
262         return igImageLocalService.getGroupImagesCount(groupId);
263     }
264 
265     public static int getGroupImagesCount(long groupId, long userId)
266         throws com.liferay.portal.SystemException {
267         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
268 
269         return igImageLocalService.getGroupImagesCount(groupId, userId);
270     }
271 
272     public static com.liferay.portlet.imagegallery.model.IGImage getImage(
273         long imageId)
274         throws com.liferay.portal.PortalException,
275             com.liferay.portal.SystemException {
276         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
277 
278         return igImageLocalService.getImage(imageId);
279     }
280 
281     public static com.liferay.portlet.imagegallery.model.IGImage getImageByCustom1ImageId(
282         long custom1ImageId)
283         throws com.liferay.portal.PortalException,
284             com.liferay.portal.SystemException {
285         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
286 
287         return igImageLocalService.getImageByCustom1ImageId(custom1ImageId);
288     }
289 
290     public static com.liferay.portlet.imagegallery.model.IGImage getImageByCustom2ImageId(
291         long custom2ImageId)
292         throws com.liferay.portal.PortalException,
293             com.liferay.portal.SystemException {
294         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
295 
296         return igImageLocalService.getImageByCustom2ImageId(custom2ImageId);
297     }
298 
299     public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
300         long folderId, java.lang.String nameWithExtension)
301         throws com.liferay.portal.PortalException,
302             com.liferay.portal.SystemException {
303         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
304 
305         return igImageLocalService.getImageByFolderIdAndNameWithExtension(folderId,
306             nameWithExtension);
307     }
308 
309     public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
310         long largeImageId)
311         throws com.liferay.portal.PortalException,
312             com.liferay.portal.SystemException {
313         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
314 
315         return igImageLocalService.getImageByLargeImageId(largeImageId);
316     }
317 
318     public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
319         long smallImageId)
320         throws com.liferay.portal.PortalException,
321             com.liferay.portal.SystemException {
322         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
323 
324         return igImageLocalService.getImageBySmallImageId(smallImageId);
325     }
326 
327     public static com.liferay.portlet.imagegallery.model.IGImage getImageByUuidAndGroupId(
328         java.lang.String uuid, long groupId)
329         throws com.liferay.portal.PortalException,
330             com.liferay.portal.SystemException {
331         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
332 
333         return igImageLocalService.getImageByUuidAndGroupId(uuid, groupId);
334     }
335 
336     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
337         long folderId) throws com.liferay.portal.SystemException {
338         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
339 
340         return igImageLocalService.getImages(folderId);
341     }
342 
343     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
344         long folderId, int begin, int end)
345         throws com.liferay.portal.SystemException {
346         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
347 
348         return igImageLocalService.getImages(folderId, begin, end);
349     }
350 
351     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
352         long folderId, int begin, int end,
353         com.liferay.portal.kernel.util.OrderByComparator obc)
354         throws com.liferay.portal.SystemException {
355         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
356 
357         return igImageLocalService.getImages(folderId, begin, end, obc);
358     }
359 
360     public static int getImagesCount(long folderId)
361         throws com.liferay.portal.SystemException {
362         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
363 
364         return igImageLocalService.getImagesCount(folderId);
365     }
366 
367     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getNoAssetImages()
368         throws com.liferay.portal.SystemException {
369         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
370 
371         return igImageLocalService.getNoAssetImages();
372     }
373 
374     public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
375         long userId, long imageId, long folderId, java.lang.String name,
376         java.lang.String description, java.io.File file,
377         java.lang.String contentType, java.lang.String[] tagsEntries)
378         throws com.liferay.portal.PortalException,
379             com.liferay.portal.SystemException {
380         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
381 
382         return igImageLocalService.updateImage(userId, imageId, folderId, name,
383             description, file, contentType, tagsEntries);
384     }
385 
386     public static void updateTagsAsset(long userId,
387         com.liferay.portlet.imagegallery.model.IGImage image,
388         java.lang.String[] tagsEntries)
389         throws com.liferay.portal.PortalException,
390             com.liferay.portal.SystemException {
391         IGImageLocalService igImageLocalService = IGImageLocalServiceFactory.getService();
392 
393         igImageLocalService.updateTagsAsset(userId, image, tagsEntries);
394     }
395 }