001    /**
002     * Copyright (c) 2000-2011 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    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * 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.
023     *
024     * <p>
025     * 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.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see IGImageLocalService
030     * @see com.liferay.portlet.imagegallery.service.base.IGImageLocalServiceBaseImpl
031     * @see com.liferay.portlet.imagegallery.service.impl.IGImageLocalServiceImpl
032     * @generated
033     */
034    public class IGImageLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * 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.
039             */
040    
041            /**
042            * Adds the i g image to the database. Also notifies the appropriate model listeners.
043            *
044            * @param igImage the i g image
045            * @return the i g image that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.imagegallery.model.IGImage addIGImage(
049                    com.liferay.portlet.imagegallery.model.IGImage igImage)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addIGImage(igImage);
052            }
053    
054            /**
055            * Creates a new i g image with the primary key. Does not add the i g image to the database.
056            *
057            * @param imageId the primary key for the new i g image
058            * @return the new i g image
059            */
060            public static com.liferay.portlet.imagegallery.model.IGImage createIGImage(
061                    long imageId) {
062                    return getService().createIGImage(imageId);
063            }
064    
065            /**
066            * Deletes the i g image with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param imageId the primary key of the i g image
069            * @throws PortalException if a i g image with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteIGImage(long imageId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteIGImage(imageId);
076            }
077    
078            /**
079            * Deletes the i g image from the database. Also notifies the appropriate model listeners.
080            *
081            * @param igImage the i g image
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteIGImage(
085                    com.liferay.portlet.imagegallery.model.IGImage igImage)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteIGImage(igImage);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * 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.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            /**
162            * Returns the i g image with the primary key.
163            *
164            * @param imageId the primary key of the i g image
165            * @return the i g image
166            * @throws PortalException if a i g image with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.imagegallery.model.IGImage getIGImage(
170                    long imageId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getIGImage(imageId);
174            }
175    
176            public static com.liferay.portal.model.PersistedModel getPersistedModel(
177                    java.io.Serializable primaryKeyObj)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    return getService().getPersistedModel(primaryKeyObj);
181            }
182    
183            /**
184            * Returns the i g image with the UUID in the group.
185            *
186            * @param uuid the UUID of i g image
187            * @param groupId the group id of the i g image
188            * @return the i g image
189            * @throws PortalException if a i g image with the UUID in the group could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.imagegallery.model.IGImage getIGImageByUuidAndGroupId(
193                    java.lang.String uuid, long groupId)
194                    throws com.liferay.portal.kernel.exception.PortalException,
195                            com.liferay.portal.kernel.exception.SystemException {
196                    return getService().getIGImageByUuidAndGroupId(uuid, groupId);
197            }
198    
199            /**
200            * Returns a range of all the i g images.
201            *
202            * <p>
203            * 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.
204            * </p>
205            *
206            * @param start the lower bound of the range of i g images
207            * @param end the upper bound of the range of i g images (not inclusive)
208            * @return the range of i g images
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getIGImages(
212                    int start, int end)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getIGImages(start, end);
215            }
216    
217            /**
218            * Returns the number of i g images.
219            *
220            * @return the number of i g images
221            * @throws SystemException if a system exception occurred
222            */
223            public static int getIGImagesCount()
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getService().getIGImagesCount();
226            }
227    
228            /**
229            * Updates the i g image in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
230            *
231            * @param igImage the i g image
232            * @return the i g image that was updated
233            * @throws SystemException if a system exception occurred
234            */
235            public static com.liferay.portlet.imagegallery.model.IGImage updateIGImage(
236                    com.liferay.portlet.imagegallery.model.IGImage igImage)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getService().updateIGImage(igImage);
239            }
240    
241            /**
242            * Updates the i g image in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
243            *
244            * @param igImage the i g image
245            * @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.
246            * @return the i g image that was updated
247            * @throws SystemException if a system exception occurred
248            */
249            public static com.liferay.portlet.imagegallery.model.IGImage updateIGImage(
250                    com.liferay.portlet.imagegallery.model.IGImage igImage, boolean merge)
251                    throws com.liferay.portal.kernel.exception.SystemException {
252                    return getService().updateIGImage(igImage, merge);
253            }
254    
255            /**
256            * Returns the Spring bean ID for this bean.
257            *
258            * @return the Spring bean ID for this bean
259            */
260            public static java.lang.String getBeanIdentifier() {
261                    return getService().getBeanIdentifier();
262            }
263    
264            /**
265            * Sets the Spring bean ID for this bean.
266            *
267            * @param beanIdentifier the Spring bean ID for this bean
268            */
269            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
270                    getService().setBeanIdentifier(beanIdentifier);
271            }
272    
273            public static com.liferay.portlet.imagegallery.model.IGImage addImage(
274                    long userId, long groupId, long folderId, java.lang.String name,
275                    java.lang.String description, java.io.File file,
276                    java.lang.String contentType,
277                    com.liferay.portal.service.ServiceContext serviceContext)
278                    throws com.liferay.portal.kernel.exception.PortalException,
279                            com.liferay.portal.kernel.exception.SystemException {
280                    return getService()
281                                       .addImage(userId, groupId, folderId, name, description,
282                            file, contentType, serviceContext);
283            }
284    
285            public static com.liferay.portlet.imagegallery.model.IGImage addImage(
286                    long userId, long groupId, long folderId, java.lang.String name,
287                    java.lang.String description, java.lang.String fileName, byte[] bytes,
288                    java.lang.String contentType,
289                    com.liferay.portal.service.ServiceContext serviceContext)
290                    throws com.liferay.portal.kernel.exception.PortalException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    return getService()
293                                       .addImage(userId, groupId, folderId, name, description,
294                            fileName, bytes, contentType, serviceContext);
295            }
296    
297            public static com.liferay.portlet.imagegallery.model.IGImage addImage(
298                    long userId, long groupId, long folderId, java.lang.String name,
299                    java.lang.String description, java.lang.String fileName,
300                    java.io.InputStream is, java.lang.String contentType,
301                    com.liferay.portal.service.ServiceContext serviceContext)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException {
304                    return getService()
305                                       .addImage(userId, groupId, folderId, name, description,
306                            fileName, is, contentType, serviceContext);
307            }
308    
309            public static void addImageResources(
310                    com.liferay.portlet.imagegallery.model.IGImage image,
311                    boolean addCommunityPermissions, boolean addGuestPermissions)
312                    throws com.liferay.portal.kernel.exception.PortalException,
313                            com.liferay.portal.kernel.exception.SystemException {
314                    getService()
315                            .addImageResources(image, addCommunityPermissions,
316                            addGuestPermissions);
317            }
318    
319            public static void addImageResources(
320                    com.liferay.portlet.imagegallery.model.IGImage image,
321                    java.lang.String[] communityPermissions,
322                    java.lang.String[] guestPermissions)
323                    throws com.liferay.portal.kernel.exception.PortalException,
324                            com.liferay.portal.kernel.exception.SystemException {
325                    getService()
326                            .addImageResources(image, communityPermissions, guestPermissions);
327            }
328    
329            public static void addImageResources(long imageId,
330                    boolean addCommunityPermissions, boolean addGuestPermissions)
331                    throws com.liferay.portal.kernel.exception.PortalException,
332                            com.liferay.portal.kernel.exception.SystemException {
333                    getService()
334                            .addImageResources(imageId, addCommunityPermissions,
335                            addGuestPermissions);
336            }
337    
338            public static void addImageResources(long imageId,
339                    java.lang.String[] communityPermissions,
340                    java.lang.String[] guestPermissions)
341                    throws com.liferay.portal.kernel.exception.PortalException,
342                            com.liferay.portal.kernel.exception.SystemException {
343                    getService()
344                            .addImageResources(imageId, communityPermissions, guestPermissions);
345            }
346    
347            public static void deleteImage(
348                    com.liferay.portlet.imagegallery.model.IGImage image)
349                    throws com.liferay.portal.kernel.exception.PortalException,
350                            com.liferay.portal.kernel.exception.SystemException {
351                    getService().deleteImage(image);
352            }
353    
354            public static void deleteImage(long imageId)
355                    throws com.liferay.portal.kernel.exception.PortalException,
356                            com.liferay.portal.kernel.exception.SystemException {
357                    getService().deleteImage(imageId);
358            }
359    
360            public static void deleteImages(long groupId, long folderId)
361                    throws com.liferay.portal.kernel.exception.PortalException,
362                            com.liferay.portal.kernel.exception.SystemException {
363                    getService().deleteImages(groupId, folderId);
364            }
365    
366            public static int getFoldersImagesCount(long groupId,
367                    java.util.List<java.lang.Long> folderIds)
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    return getService().getFoldersImagesCount(groupId, folderIds);
370            }
371    
372            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
373                    long groupId, int start, int end)
374                    throws com.liferay.portal.kernel.exception.SystemException {
375                    return getService().getGroupImages(groupId, start, end);
376            }
377    
378            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
379                    long groupId, long userId, int start, int end)
380                    throws com.liferay.portal.kernel.exception.SystemException {
381                    return getService().getGroupImages(groupId, userId, start, end);
382            }
383    
384            public static int getGroupImagesCount(long groupId)
385                    throws com.liferay.portal.kernel.exception.SystemException {
386                    return getService().getGroupImagesCount(groupId);
387            }
388    
389            public static int getGroupImagesCount(long groupId, long userId)
390                    throws com.liferay.portal.kernel.exception.SystemException {
391                    return getService().getGroupImagesCount(groupId, userId);
392            }
393    
394            public static com.liferay.portlet.imagegallery.model.IGImage getImage(
395                    long imageId)
396                    throws com.liferay.portal.kernel.exception.PortalException,
397                            com.liferay.portal.kernel.exception.SystemException {
398                    return getService().getImage(imageId);
399            }
400    
401            public static com.liferay.portlet.imagegallery.model.IGImage getImageByCustom1ImageId(
402                    long custom1ImageId)
403                    throws com.liferay.portal.kernel.exception.PortalException,
404                            com.liferay.portal.kernel.exception.SystemException {
405                    return getService().getImageByCustom1ImageId(custom1ImageId);
406            }
407    
408            public static com.liferay.portlet.imagegallery.model.IGImage getImageByCustom2ImageId(
409                    long custom2ImageId)
410                    throws com.liferay.portal.kernel.exception.PortalException,
411                            com.liferay.portal.kernel.exception.SystemException {
412                    return getService().getImageByCustom2ImageId(custom2ImageId);
413            }
414    
415            public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
416                    long groupId, long folderId, java.lang.String nameWithExtension)
417                    throws com.liferay.portal.kernel.exception.PortalException,
418                            com.liferay.portal.kernel.exception.SystemException {
419                    return getService()
420                                       .getImageByFolderIdAndNameWithExtension(groupId, folderId,
421                            nameWithExtension);
422            }
423    
424            public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
425                    long largeImageId)
426                    throws com.liferay.portal.kernel.exception.PortalException,
427                            com.liferay.portal.kernel.exception.SystemException {
428                    return getService().getImageByLargeImageId(largeImageId);
429            }
430    
431            public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
432                    long smallImageId)
433                    throws com.liferay.portal.kernel.exception.PortalException,
434                            com.liferay.portal.kernel.exception.SystemException {
435                    return getService().getImageBySmallImageId(smallImageId);
436            }
437    
438            public static com.liferay.portlet.imagegallery.model.IGImage getImageByUuidAndGroupId(
439                    java.lang.String uuid, long groupId)
440                    throws com.liferay.portal.kernel.exception.PortalException,
441                            com.liferay.portal.kernel.exception.SystemException {
442                    return getService().getImageByUuidAndGroupId(uuid, groupId);
443            }
444    
445            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
446                    long groupId, long folderId)
447                    throws com.liferay.portal.kernel.exception.SystemException {
448                    return getService().getImages(groupId, folderId);
449            }
450    
451            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
452                    long groupId, long folderId, int start, int end)
453                    throws com.liferay.portal.kernel.exception.SystemException {
454                    return getService().getImages(groupId, folderId, start, end);
455            }
456    
457            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
458                    long groupId, long folderId, int start, int end,
459                    com.liferay.portal.kernel.util.OrderByComparator obc)
460                    throws com.liferay.portal.kernel.exception.SystemException {
461                    return getService().getImages(groupId, folderId, start, end, obc);
462            }
463    
464            public static int getImagesCount(long groupId, long folderId)
465                    throws com.liferay.portal.kernel.exception.SystemException {
466                    return getService().getImagesCount(groupId, folderId);
467            }
468    
469            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getNoAssetImages()
470                    throws com.liferay.portal.kernel.exception.SystemException {
471                    return getService().getNoAssetImages();
472            }
473    
474            public static void updateAsset(long userId,
475                    com.liferay.portlet.imagegallery.model.IGImage image,
476                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
477                    java.lang.String contentType)
478                    throws com.liferay.portal.kernel.exception.PortalException,
479                            com.liferay.portal.kernel.exception.SystemException {
480                    getService()
481                            .updateAsset(userId, image, assetCategoryIds, assetTagNames,
482                            contentType);
483            }
484    
485            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
486                    long userId, long imageId, long groupId, long folderId,
487                    java.lang.String name, java.lang.String description, byte[] bytes,
488                    java.lang.String contentType,
489                    com.liferay.portal.service.ServiceContext serviceContext)
490                    throws com.liferay.portal.kernel.exception.PortalException,
491                            com.liferay.portal.kernel.exception.SystemException {
492                    return getService()
493                                       .updateImage(userId, imageId, groupId, folderId, name,
494                            description, bytes, contentType, serviceContext);
495            }
496    
497            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
498                    long userId, long imageId, long groupId, long folderId,
499                    java.lang.String name, java.lang.String description, java.io.File file,
500                    java.lang.String contentType,
501                    com.liferay.portal.service.ServiceContext serviceContext)
502                    throws com.liferay.portal.kernel.exception.PortalException,
503                            com.liferay.portal.kernel.exception.SystemException {
504                    return getService()
505                                       .updateImage(userId, imageId, groupId, folderId, name,
506                            description, file, contentType, serviceContext);
507            }
508    
509            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
510                    long userId, long imageId, long groupId, long folderId,
511                    java.lang.String name, java.lang.String description,
512                    java.io.InputStream is, java.lang.String contentType,
513                    com.liferay.portal.service.ServiceContext serviceContext)
514                    throws com.liferay.portal.kernel.exception.PortalException,
515                            com.liferay.portal.kernel.exception.SystemException {
516                    return getService()
517                                       .updateImage(userId, imageId, groupId, folderId, name,
518                            description, is, contentType, serviceContext);
519            }
520    
521            public static void updateSmallImage(long smallImageId, long largeImageId)
522                    throws com.liferay.portal.kernel.exception.PortalException,
523                            com.liferay.portal.kernel.exception.SystemException {
524                    getService().updateSmallImage(smallImageId, largeImageId);
525            }
526    
527            public static IGImageLocalService getService() {
528                    if (_service == null) {
529                            _service = (IGImageLocalService)PortalBeanLocatorUtil.locate(IGImageLocalService.class.getName());
530    
531                            ReferenceRegistry.registerReference(IGImageLocalServiceUtil.class,
532                                    "_service");
533                            MethodCache.remove(IGImageLocalService.class);
534                    }
535    
536                    return _service;
537            }
538    
539            public void setService(IGImageLocalService service) {
540                    MethodCache.remove(IGImageLocalService.class);
541    
542                    _service = service;
543    
544                    ReferenceRegistry.registerReference(IGImageLocalServiceUtil.class,
545                            "_service");
546                    MethodCache.remove(IGImageLocalService.class);
547            }
548    
549            private static IGImageLocalService _service;
550    }