1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.imagegallery.service;
24  
25  
26  /**
27   * <a href="IGImageServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portlet.imagegallery.service.IGImageService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portlet.imagegallery.service.IGImageService
45   *
46   */
47  public class IGImageServiceUtil {
48      public static com.liferay.portlet.imagegallery.model.IGImage addImage(
49          long folderId, java.lang.String name, java.lang.String description,
50          java.io.File file, java.lang.String contentType,
51          java.lang.String[] tagsEntries, boolean addCommunityPermissions,
52          boolean addGuestPermissions)
53          throws com.liferay.portal.PortalException,
54              com.liferay.portal.SystemException, java.rmi.RemoteException {
55          return getService()
56                     .addImage(folderId, name, description, file, contentType,
57              tagsEntries, addCommunityPermissions, addGuestPermissions);
58      }
59  
60      public static com.liferay.portlet.imagegallery.model.IGImage addImage(
61          long folderId, java.lang.String name, java.lang.String description,
62          java.io.File file, java.lang.String contentType,
63          java.lang.String[] tagsEntries,
64          java.lang.String[] communityPermissions,
65          java.lang.String[] guestPermissions)
66          throws com.liferay.portal.PortalException,
67              com.liferay.portal.SystemException, java.rmi.RemoteException {
68          return getService()
69                     .addImage(folderId, name, description, file, contentType,
70              tagsEntries, communityPermissions, guestPermissions);
71      }
72  
73      public static void deleteImage(long imageId)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException, java.rmi.RemoteException {
76          getService().deleteImage(imageId);
77      }
78  
79      public static void deleteImageByFolderIdAndNameWithExtension(
80          long folderId, java.lang.String nameWithExtension)
81          throws com.liferay.portal.PortalException,
82              com.liferay.portal.SystemException, java.rmi.RemoteException {
83          getService()
84              .deleteImageByFolderIdAndNameWithExtension(folderId,
85              nameWithExtension);
86      }
87  
88      public static com.liferay.portlet.imagegallery.model.IGImage getImage(
89          long imageId)
90          throws com.liferay.portal.PortalException,
91              com.liferay.portal.SystemException, java.rmi.RemoteException {
92          return getService().getImage(imageId);
93      }
94  
95      public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
96          long folderId, java.lang.String nameWithExtension)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException, java.rmi.RemoteException {
99          return getService()
100                    .getImageByFolderIdAndNameWithExtension(folderId,
101             nameWithExtension);
102     }
103 
104     public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
105         long largeImageId)
106         throws com.liferay.portal.PortalException,
107             com.liferay.portal.SystemException, java.rmi.RemoteException {
108         return getService().getImageByLargeImageId(largeImageId);
109     }
110 
111     public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
112         long smallImageId)
113         throws com.liferay.portal.PortalException,
114             com.liferay.portal.SystemException, java.rmi.RemoteException {
115         return getService().getImageBySmallImageId(smallImageId);
116     }
117 
118     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
119         long folderId)
120         throws com.liferay.portal.PortalException,
121             com.liferay.portal.SystemException, java.rmi.RemoteException {
122         return getService().getImages(folderId);
123     }
124 
125     public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
126         long imageId, long folderId, java.lang.String name,
127         java.lang.String description, java.io.File file,
128         java.lang.String contentType, java.lang.String[] tagsEntries)
129         throws com.liferay.portal.PortalException,
130             com.liferay.portal.SystemException, java.rmi.RemoteException {
131         return getService()
132                    .updateImage(imageId, folderId, name, description, file,
133             contentType, tagsEntries);
134     }
135 
136     public static IGImageService getService() {
137         if (_service == null) {
138             throw new RuntimeException("IGImageService is not set");
139         }
140 
141         return _service;
142     }
143 
144     public void setService(IGImageService service) {
145         _service = service;
146     }
147 
148     private static IGImageService _service;
149 }