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 com.liferay.portlet.imagegallery.model.IGImage getImage(
061                    long imageId)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    return getService().getImage(imageId);
065            }
066    
067            public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
068                    long groupId, long folderId, java.lang.String nameWithExtension)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    return getService()
072                                       .getImageByFolderIdAndNameWithExtension(groupId, folderId,
073                            nameWithExtension);
074            }
075    
076            public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
077                    long largeImageId)
078                    throws com.liferay.portal.kernel.exception.PortalException,
079                            com.liferay.portal.kernel.exception.SystemException {
080                    return getService().getImageByLargeImageId(largeImageId);
081            }
082    
083            public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
084                    long smallImageId)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    return getService().getImageBySmallImageId(smallImageId);
088            }
089    
090            public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
091                    long groupId, long folderId)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException {
094                    return getService().getImages(groupId, folderId);
095            }
096    
097            public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
098                    long imageId, long groupId, long folderId, java.lang.String name,
099                    java.lang.String description, java.io.File file,
100                    java.lang.String contentType,
101                    com.liferay.portal.service.ServiceContext serviceContext)
102                    throws com.liferay.portal.kernel.exception.PortalException,
103                            com.liferay.portal.kernel.exception.SystemException {
104                    return getService()
105                                       .updateImage(imageId, groupId, folderId, name, description,
106                            file, contentType, serviceContext);
107            }
108    
109            public static IGImageService getService() {
110                    if (_service == null) {
111                            _service = (IGImageService)PortalBeanLocatorUtil.locate(IGImageService.class.getName());
112                    }
113    
114                    return _service;
115            }
116    
117            public void setService(IGImageService service) {
118                    _service = service;
119            }
120    
121            private static IGImageService _service;
122    }