001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.imagegallery.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link IGImageService} bean. The static methods of
023     * this class calls the same methods of the bean instance. It's convenient to be
024     * able to just write one line to call a method on a bean instead of writing a
025     * lookup call and a method call.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       IGImageService
030     * @generated
031     */
032    public class IGImageServiceUtil {
033            public static com.liferay.portlet.imagegallery.model.IGImage addImage(
034                    long groupId, long folderId, java.lang.String name,
035                    java.lang.String description, java.io.File file,
036                    java.lang.String contentType,
037                    com.liferay.portal.service.ServiceContext serviceContext)
038                    throws com.liferay.portal.kernel.exception.PortalException,
039                            com.liferay.portal.kernel.exception.SystemException {
040                    return getService()
041                                       .addImage(groupId, folderId, name, description, file,
042                            contentType, serviceContext);
043            }
044    
045            public static void deleteImage(long imageId)
046                    throws com.liferay.portal.kernel.exception.PortalException,
047                            com.liferay.portal.kernel.exception.SystemException {
048                    getService().deleteImage(imageId);
049            }
050    
051            public static void deleteImageByFolderIdAndNameWithExtension(long groupId,
052                    long folderId, java.lang.String nameWithExtension)
053                    throws com.liferay.portal.kernel.exception.PortalException,
054                            com.liferay.portal.kernel.exception.SystemException {
055                    getService()
056                            .deleteImageByFolderIdAndNameWithExtension(groupId, folderId,
057                            nameWithExtension);
058            }
059    
060            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getGroupImages(
061                    long groupId, long userId, int start, int end)
062                    throws com.liferay.portal.kernel.exception.SystemException {
063                    return getService().getGroupImages(groupId, userId, start, end);
064            }
065    
066            public static int getGroupImagesCount(long groupId, long userId)
067                    throws com.liferay.portal.kernel.exception.SystemException {
068                    return getService().getGroupImagesCount(groupId, userId);
069            }
070    
071            public static com.liferay.portlet.imagegallery.model.IGImage getImage(
072                    long imageId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    return getService().getImage(imageId);
076            }
077    
078            public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
079                    long groupId, long folderId, java.lang.String nameWithExtension)
080                    throws com.liferay.portal.kernel.exception.PortalException,
081                            com.liferay.portal.kernel.exception.SystemException {
082                    return getService()
083                                       .getImageByFolderIdAndNameWithExtension(groupId, folderId,
084                            nameWithExtension);
085            }
086    
087            public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
088                    long largeImageId)
089                    throws com.liferay.portal.kernel.exception.PortalException,
090                            com.liferay.portal.kernel.exception.SystemException {
091                    return getService().getImageByLargeImageId(largeImageId);
092            }
093    
094            public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
095                    long smallImageId)
096                    throws com.liferay.portal.kernel.exception.PortalException,
097                            com.liferay.portal.kernel.exception.SystemException {
098                    return getService().getImageBySmallImageId(smallImageId);
099            }
100    
101            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
102                    long groupId, long folderId)
103                    throws com.liferay.portal.kernel.exception.SystemException {
104                    return getService().getImages(groupId, folderId);
105            }
106    
107            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
108                    long groupId, long folderId, int start, int end)
109                    throws com.liferay.portal.kernel.exception.SystemException {
110                    return getService().getImages(groupId, folderId, start, end);
111            }
112    
113            public static int getImagesCount(long groupId, long folderId)
114                    throws com.liferay.portal.kernel.exception.SystemException {
115                    return getService().getImagesCount(groupId, folderId);
116            }
117    
118            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
119                    long imageId, long groupId, long folderId, java.lang.String name,
120                    java.lang.String description, java.io.File file,
121                    java.lang.String contentType,
122                    com.liferay.portal.service.ServiceContext serviceContext)
123                    throws com.liferay.portal.kernel.exception.PortalException,
124                            com.liferay.portal.kernel.exception.SystemException {
125                    return getService()
126                                       .updateImage(imageId, groupId, folderId, name, description,
127                            file, contentType, serviceContext);
128            }
129    
130            public static IGImageService getService() {
131                    if (_service == null) {
132                            _service = (IGImageService)PortalBeanLocatorUtil.locate(IGImageService.class.getName());
133                    }
134    
135                    return _service;
136            }
137    
138            public void setService(IGImageService service) {
139                    _service = service;
140            }
141    
142            private static IGImageService _service;
143    }