001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.imagegallery.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * The utility for the i g image local service. This utility wraps {@link com.liferay.portlet.imagegallery.service.impl.IGImageLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
021     *
022     * <p>
023     * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.imagegallery.service.impl.IGImageLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
024     * </p>
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see IGImageLocalService
032     * @see com.liferay.portlet.imagegallery.service.base.IGImageLocalServiceBaseImpl
033     * @see com.liferay.portlet.imagegallery.service.impl.IGImageLocalServiceImpl
034     * @generated
035     */
036    public class IGImageLocalServiceUtil {
037            /**
038            * Adds the i g image to the database. Also notifies the appropriate model listeners.
039            *
040            * @param igImage the i g image to add
041            * @return the i g image that was added
042            * @throws SystemException if a system exception occurred
043            */
044            public static com.liferay.portlet.imagegallery.model.IGImage addIGImage(
045                    com.liferay.portlet.imagegallery.model.IGImage igImage)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getService().addIGImage(igImage);
048            }
049    
050            /**
051            * Creates a new i g image with the primary key. Does not add the i g image to the database.
052            *
053            * @param imageId the primary key for the new i g image
054            * @return the new i g image
055            */
056            public static com.liferay.portlet.imagegallery.model.IGImage createIGImage(
057                    long imageId) {
058                    return getService().createIGImage(imageId);
059            }
060    
061            /**
062            * Deletes the i g image with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param imageId the primary key of the i g image to delete
065            * @throws PortalException if a i g image with the primary key could not be found
066            * @throws SystemException if a system exception occurred
067            */
068            public static void deleteIGImage(long imageId)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    getService().deleteIGImage(imageId);
072            }
073    
074            /**
075            * Deletes the i g image from the database. Also notifies the appropriate model listeners.
076            *
077            * @param igImage the i g image to delete
078            * @throws SystemException if a system exception occurred
079            */
080            public static void deleteIGImage(
081                    com.liferay.portlet.imagegallery.model.IGImage igImage)
082                    throws com.liferay.portal.kernel.exception.SystemException {
083                    getService().deleteIGImage(igImage);
084            }
085    
086            /**
087            * Performs a dynamic query on the database and returns the matching rows.
088            *
089            * @param dynamicQuery the dynamic query to search with
090            * @return the matching rows
091            * @throws SystemException if a system exception occurred
092            */
093            @SuppressWarnings("rawtypes")
094            public static java.util.List dynamicQuery(
095                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
096                    throws com.liferay.portal.kernel.exception.SystemException {
097                    return getService().dynamicQuery(dynamicQuery);
098            }
099    
100            /**
101            * Performs a dynamic query on the database and returns a range of the matching rows.
102            *
103            * <p>
104            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
105            * </p>
106            *
107            * @param dynamicQuery the dynamic query to search with
108            * @param start the lower bound of the range of model instances to return
109            * @param end the upper bound of the range of model instances to return (not inclusive)
110            * @return the range of matching rows
111            * @throws SystemException if a system exception occurred
112            */
113            @SuppressWarnings("rawtypes")
114            public static java.util.List dynamicQuery(
115                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
116                    int end) throws com.liferay.portal.kernel.exception.SystemException {
117                    return getService().dynamicQuery(dynamicQuery, start, end);
118            }
119    
120            /**
121            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
122            *
123            * <p>
124            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
125            * </p>
126            *
127            * @param dynamicQuery the dynamic query to search with
128            * @param start the lower bound of the range of model instances to return
129            * @param end the upper bound of the range of model instances to return (not inclusive)
130            * @param orderByComparator the comparator to order the results by
131            * @return the ordered range of matching rows
132            * @throws SystemException if a system exception occurred
133            */
134            @SuppressWarnings("rawtypes")
135            public static java.util.List dynamicQuery(
136                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
137                    int end,
138                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
139                    throws com.liferay.portal.kernel.exception.SystemException {
140                    return getService()
141                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
142            }
143    
144            /**
145            * Counts the number of rows that match the dynamic query.
146            *
147            * @param dynamicQuery the dynamic query to search with
148            * @return the number of rows that match the dynamic query
149            * @throws SystemException if a system exception occurred
150            */
151            public static long dynamicQueryCount(
152                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return getService().dynamicQueryCount(dynamicQuery);
155            }
156    
157            /**
158            * Gets the i g image with the primary key.
159            *
160            * @param imageId the primary key of the i g image to get
161            * @return the i g image
162            * @throws PortalException if a i g image with the primary key could not be found
163            * @throws SystemException if a system exception occurred
164            */
165            public static com.liferay.portlet.imagegallery.model.IGImage getIGImage(
166                    long imageId)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    return getService().getIGImage(imageId);
170            }
171    
172            /**
173            * Gets the i g image with the UUID and group id.
174            *
175            * @param uuid the UUID of i g image to get
176            * @param groupId the group id of the i g image to get
177            * @return the i g image
178            * @throws PortalException if a i g image with the UUID and group id could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portlet.imagegallery.model.IGImage getIGImageByUuidAndGroupId(
182                    java.lang.String uuid, long groupId)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getIGImageByUuidAndGroupId(uuid, groupId);
186            }
187    
188            /**
189            * Gets a range of all the i g images.
190            *
191            * <p>
192            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
193            * </p>
194            *
195            * @param start the lower bound of the range of i g images to return
196            * @param end the upper bound of the range of i g images to return (not inclusive)
197            * @return the range of i g images
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getIGImages(
201                    int start, int end)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getService().getIGImages(start, end);
204            }
205    
206            /**
207            * Gets the number of i g images.
208            *
209            * @return the number of i g images
210            * @throws SystemException if a system exception occurred
211            */
212            public static int getIGImagesCount()
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getIGImagesCount();
215            }
216    
217            /**
218            * Updates the i g image in the database. Also notifies the appropriate model listeners.
219            *
220            * @param igImage the i g image to update
221            * @return the i g image that was updated
222            * @throws SystemException if a system exception occurred
223            */
224            public static com.liferay.portlet.imagegallery.model.IGImage updateIGImage(
225                    com.liferay.portlet.imagegallery.model.IGImage igImage)
226                    throws com.liferay.portal.kernel.exception.SystemException {
227                    return getService().updateIGImage(igImage);
228            }
229    
230            /**
231            * Updates the i g image in the database. Also notifies the appropriate model listeners.
232            *
233            * @param igImage the i g image to update
234            * @param merge whether to merge the i g image with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
235            * @return the i g image that was updated
236            * @throws SystemException if a system exception occurred
237            */
238            public static com.liferay.portlet.imagegallery.model.IGImage updateIGImage(
239                    com.liferay.portlet.imagegallery.model.IGImage igImage, boolean merge)
240                    throws com.liferay.portal.kernel.exception.SystemException {
241                    return getService().updateIGImage(igImage, merge);
242            }
243    
244            public static com.liferay.portlet.imagegallery.model.IGImage addImage(
245                    long userId, long groupId, long folderId, java.lang.String name,
246                    java.lang.String description, java.io.File file,
247                    java.lang.String contentType,
248                    com.liferay.portal.service.ServiceContext serviceContext)
249                    throws com.liferay.portal.kernel.exception.PortalException,
250                            com.liferay.portal.kernel.exception.SystemException {
251                    return getService()
252                                       .addImage(userId, groupId, folderId, name, description,
253                            file, contentType, serviceContext);
254            }
255    
256            public static com.liferay.portlet.imagegallery.model.IGImage addImage(
257                    long userId, long groupId, long folderId, java.lang.String name,
258                    java.lang.String description, java.lang.String fileName, byte[] bytes,
259                    java.lang.String contentType,
260                    com.liferay.portal.service.ServiceContext serviceContext)
261                    throws com.liferay.portal.kernel.exception.PortalException,
262                            com.liferay.portal.kernel.exception.SystemException {
263                    return getService()
264                                       .addImage(userId, groupId, folderId, name, description,
265                            fileName, bytes, contentType, serviceContext);
266            }
267    
268            public static com.liferay.portlet.imagegallery.model.IGImage addImage(
269                    long userId, long groupId, long folderId, java.lang.String name,
270                    java.lang.String description, java.lang.String fileName,
271                    java.io.InputStream is, java.lang.String contentType,
272                    com.liferay.portal.service.ServiceContext serviceContext)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException {
275                    return getService()
276                                       .addImage(userId, groupId, folderId, name, description,
277                            fileName, is, contentType, serviceContext);
278            }
279    
280            public static void addImageResources(
281                    com.liferay.portlet.imagegallery.model.IGImage image,
282                    boolean addCommunityPermissions, boolean addGuestPermissions)
283                    throws com.liferay.portal.kernel.exception.PortalException,
284                            com.liferay.portal.kernel.exception.SystemException {
285                    getService()
286                            .addImageResources(image, addCommunityPermissions,
287                            addGuestPermissions);
288            }
289    
290            public static void addImageResources(
291                    com.liferay.portlet.imagegallery.model.IGImage image,
292                    java.lang.String[] communityPermissions,
293                    java.lang.String[] guestPermissions)
294                    throws com.liferay.portal.kernel.exception.PortalException,
295                            com.liferay.portal.kernel.exception.SystemException {
296                    getService()
297                            .addImageResources(image, communityPermissions, guestPermissions);
298            }
299    
300            public static void addImageResources(long imageId,
301                    boolean addCommunityPermissions, boolean addGuestPermissions)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException {
304                    getService()
305                            .addImageResources(imageId, addCommunityPermissions,
306                            addGuestPermissions);
307            }
308    
309            public static void addImageResources(long imageId,
310                    java.lang.String[] communityPermissions,
311                    java.lang.String[] guestPermissions)
312                    throws com.liferay.portal.kernel.exception.PortalException,
313                            com.liferay.portal.kernel.exception.SystemException {
314                    getService()
315                            .addImageResources(imageId, communityPermissions, guestPermissions);
316            }
317    
318            public static void deleteImage(
319                    com.liferay.portlet.imagegallery.model.IGImage image)
320                    throws com.liferay.portal.kernel.exception.PortalException,
321                            com.liferay.portal.kernel.exception.SystemException {
322                    getService().deleteImage(image);
323            }
324    
325            public static void deleteImage(long imageId)
326                    throws com.liferay.portal.kernel.exception.PortalException,
327                            com.liferay.portal.kernel.exception.SystemException {
328                    getService().deleteImage(imageId);
329            }
330    
331            public static void deleteImages(long groupId, long folderId)
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    getService().deleteImages(groupId, folderId);
335            }
336    
337            public static int getFoldersImagesCount(long groupId,
338                    java.util.List<java.lang.Long> folderIds)
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getService().getFoldersImagesCount(groupId, folderIds);
341            }
342    
343            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
344                    long groupId, int start, int end)
345                    throws com.liferay.portal.kernel.exception.SystemException {
346                    return getService().getGroupImages(groupId, start, end);
347            }
348    
349            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
350                    long groupId, long userId, int start, int end)
351                    throws com.liferay.portal.kernel.exception.SystemException {
352                    return getService().getGroupImages(groupId, userId, start, end);
353            }
354    
355            public static int getGroupImagesCount(long groupId)
356                    throws com.liferay.portal.kernel.exception.SystemException {
357                    return getService().getGroupImagesCount(groupId);
358            }
359    
360            public static int getGroupImagesCount(long groupId, long userId)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getService().getGroupImagesCount(groupId, userId);
363            }
364    
365            public static com.liferay.portlet.imagegallery.model.IGImage getImage(
366                    long imageId)
367                    throws com.liferay.portal.kernel.exception.PortalException,
368                            com.liferay.portal.kernel.exception.SystemException {
369                    return getService().getImage(imageId);
370            }
371    
372            public static com.liferay.portlet.imagegallery.model.IGImage getImageByCustom1ImageId(
373                    long custom1ImageId)
374                    throws com.liferay.portal.kernel.exception.PortalException,
375                            com.liferay.portal.kernel.exception.SystemException {
376                    return getService().getImageByCustom1ImageId(custom1ImageId);
377            }
378    
379            public static com.liferay.portlet.imagegallery.model.IGImage getImageByCustom2ImageId(
380                    long custom2ImageId)
381                    throws com.liferay.portal.kernel.exception.PortalException,
382                            com.liferay.portal.kernel.exception.SystemException {
383                    return getService().getImageByCustom2ImageId(custom2ImageId);
384            }
385    
386            public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
387                    long groupId, long folderId, java.lang.String nameWithExtension)
388                    throws com.liferay.portal.kernel.exception.PortalException,
389                            com.liferay.portal.kernel.exception.SystemException {
390                    return getService()
391                                       .getImageByFolderIdAndNameWithExtension(groupId, folderId,
392                            nameWithExtension);
393            }
394    
395            public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
396                    long largeImageId)
397                    throws com.liferay.portal.kernel.exception.PortalException,
398                            com.liferay.portal.kernel.exception.SystemException {
399                    return getService().getImageByLargeImageId(largeImageId);
400            }
401    
402            public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
403                    long smallImageId)
404                    throws com.liferay.portal.kernel.exception.PortalException,
405                            com.liferay.portal.kernel.exception.SystemException {
406                    return getService().getImageBySmallImageId(smallImageId);
407            }
408    
409            public static com.liferay.portlet.imagegallery.model.IGImage getImageByUuidAndGroupId(
410                    java.lang.String uuid, long groupId)
411                    throws com.liferay.portal.kernel.exception.PortalException,
412                            com.liferay.portal.kernel.exception.SystemException {
413                    return getService().getImageByUuidAndGroupId(uuid, groupId);
414            }
415    
416            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
417                    long groupId, long folderId)
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    return getService().getImages(groupId, folderId);
420            }
421    
422            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
423                    long groupId, long folderId, int start, int end)
424                    throws com.liferay.portal.kernel.exception.SystemException {
425                    return getService().getImages(groupId, folderId, start, end);
426            }
427    
428            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
429                    long groupId, long folderId, int start, int end,
430                    com.liferay.portal.kernel.util.OrderByComparator obc)
431                    throws com.liferay.portal.kernel.exception.SystemException {
432                    return getService().getImages(groupId, folderId, start, end, obc);
433            }
434    
435            public static int getImagesCount(long groupId, long folderId)
436                    throws com.liferay.portal.kernel.exception.SystemException {
437                    return getService().getImagesCount(groupId, folderId);
438            }
439    
440            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getNoAssetImages()
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    return getService().getNoAssetImages();
443            }
444    
445            public static void updateAsset(long userId,
446                    com.liferay.portlet.imagegallery.model.IGImage image,
447                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
448                    java.lang.String contentType)
449                    throws com.liferay.portal.kernel.exception.PortalException,
450                            com.liferay.portal.kernel.exception.SystemException {
451                    getService()
452                            .updateAsset(userId, image, assetCategoryIds, assetTagNames,
453                            contentType);
454            }
455    
456            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
457                    long userId, long imageId, long groupId, long folderId,
458                    java.lang.String name, java.lang.String description, byte[] bytes,
459                    java.lang.String contentType,
460                    com.liferay.portal.service.ServiceContext serviceContext)
461                    throws com.liferay.portal.kernel.exception.PortalException,
462                            com.liferay.portal.kernel.exception.SystemException {
463                    return getService()
464                                       .updateImage(userId, imageId, groupId, folderId, name,
465                            description, bytes, contentType, serviceContext);
466            }
467    
468            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
469                    long userId, long imageId, long groupId, long folderId,
470                    java.lang.String name, java.lang.String description, java.io.File file,
471                    java.lang.String contentType,
472                    com.liferay.portal.service.ServiceContext serviceContext)
473                    throws com.liferay.portal.kernel.exception.PortalException,
474                            com.liferay.portal.kernel.exception.SystemException {
475                    return getService()
476                                       .updateImage(userId, imageId, groupId, folderId, name,
477                            description, file, contentType, serviceContext);
478            }
479    
480            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
481                    long userId, long imageId, long groupId, long folderId,
482                    java.lang.String name, java.lang.String description,
483                    java.io.InputStream is, java.lang.String contentType,
484                    com.liferay.portal.service.ServiceContext serviceContext)
485                    throws com.liferay.portal.kernel.exception.PortalException,
486                            com.liferay.portal.kernel.exception.SystemException {
487                    return getService()
488                                       .updateImage(userId, imageId, groupId, folderId, name,
489                            description, is, contentType, serviceContext);
490            }
491    
492            public static void updateSmallImage(long smallImageId, long largeImageId)
493                    throws com.liferay.portal.kernel.exception.PortalException,
494                            com.liferay.portal.kernel.exception.SystemException {
495                    getService().updateSmallImage(smallImageId, largeImageId);
496            }
497    
498            public static IGImageLocalService getService() {
499                    if (_service == null) {
500                            _service = (IGImageLocalService)PortalBeanLocatorUtil.locate(IGImageLocalService.class.getName());
501                    }
502    
503                    return _service;
504            }
505    
506            public void setService(IGImageLocalService service) {
507                    _service = service;
508            }
509    
510            private static IGImageLocalService _service;
511    }