1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.imagegallery.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="IGImageServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link IGImageService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       IGImageService
39   * @generated
40   */
41  public class IGImageServiceUtil {
42      public static com.liferay.portlet.imagegallery.model.IGImage addImage(
43          long folderId, java.lang.String name, java.lang.String description,
44          java.io.File file, java.lang.String contentType,
45          com.liferay.portal.service.ServiceContext serviceContext)
46          throws com.liferay.portal.PortalException,
47              com.liferay.portal.SystemException {
48          return getService()
49                     .addImage(folderId, name, description, file, contentType,
50              serviceContext);
51      }
52  
53      public static void deleteImage(long imageId)
54          throws com.liferay.portal.PortalException,
55              com.liferay.portal.SystemException {
56          getService().deleteImage(imageId);
57      }
58  
59      public static void deleteImageByFolderIdAndNameWithExtension(
60          long folderId, java.lang.String nameWithExtension)
61          throws com.liferay.portal.PortalException,
62              com.liferay.portal.SystemException {
63          getService()
64              .deleteImageByFolderIdAndNameWithExtension(folderId,
65              nameWithExtension);
66      }
67  
68      public static com.liferay.portlet.imagegallery.model.IGImage getImage(
69          long imageId)
70          throws com.liferay.portal.PortalException,
71              com.liferay.portal.SystemException {
72          return getService().getImage(imageId);
73      }
74  
75      public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
76          long folderId, java.lang.String nameWithExtension)
77          throws com.liferay.portal.PortalException,
78              com.liferay.portal.SystemException {
79          return getService()
80                     .getImageByFolderIdAndNameWithExtension(folderId,
81              nameWithExtension);
82      }
83  
84      public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
85          long largeImageId)
86          throws com.liferay.portal.PortalException,
87              com.liferay.portal.SystemException {
88          return getService().getImageByLargeImageId(largeImageId);
89      }
90  
91      public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
92          long smallImageId)
93          throws com.liferay.portal.PortalException,
94              com.liferay.portal.SystemException {
95          return getService().getImageBySmallImageId(smallImageId);
96      }
97  
98      public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
99          long folderId)
100         throws com.liferay.portal.PortalException,
101             com.liferay.portal.SystemException {
102         return getService().getImages(folderId);
103     }
104 
105     public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
106         long imageId, long folderId, java.lang.String name,
107         java.lang.String description, java.io.File file,
108         java.lang.String contentType,
109         com.liferay.portal.service.ServiceContext serviceContext)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         return getService()
113                    .updateImage(imageId, folderId, name, description, file,
114             contentType, serviceContext);
115     }
116 
117     public static IGImageService getService() {
118         if (_service == null) {
119             _service = (IGImageService)PortalBeanLocatorUtil.locate(IGImageService.class.getName());
120 
121             ReferenceRegistry.registerReference(IGImageServiceUtil.class,
122                 "_service");
123             MethodCache.remove(IGImageService.class);
124         }
125 
126         return _service;
127     }
128 
129     public void setService(IGImageService service) {
130         MethodCache.remove(IGImageService.class);
131 
132         _service = service;
133 
134         ReferenceRegistry.registerReference(IGImageServiceUtil.class, "_service");
135         MethodCache.remove(IGImageService.class);
136     }
137 
138     private static IGImageService _service;
139 }