001    /**
002     * Copyright (c) 2000-2010 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.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * The utility for the image local service. This utility wraps {@link com.liferay.portal.service.impl.ImageLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
021     *
022     * <p>
023     * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ImageLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
024     * </p>
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see ImageLocalService
032     * @see com.liferay.portal.service.base.ImageLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ImageLocalServiceImpl
034     * @generated
035     */
036    public class ImageLocalServiceUtil {
037            /**
038            * Adds the image to the database. Also notifies the appropriate model listeners.
039            *
040            * @param image the image to add
041            * @return the image that was added
042            * @throws SystemException if a system exception occurred
043            */
044            public static com.liferay.portal.model.Image addImage(
045                    com.liferay.portal.model.Image image)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getService().addImage(image);
048            }
049    
050            /**
051            * Creates a new image with the primary key. Does not add the image to the database.
052            *
053            * @param imageId the primary key for the new image
054            * @return the new image
055            */
056            public static com.liferay.portal.model.Image createImage(long imageId) {
057                    return getService().createImage(imageId);
058            }
059    
060            /**
061            * Deletes the image with the primary key from the database. Also notifies the appropriate model listeners.
062            *
063            * @param imageId the primary key of the image to delete
064            * @throws PortalException if a image with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public static void deleteImage(long imageId)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    getService().deleteImage(imageId);
071            }
072    
073            /**
074            * Deletes the image from the database. Also notifies the appropriate model listeners.
075            *
076            * @param image the image to delete
077            * @throws SystemException if a system exception occurred
078            */
079            public static void deleteImage(com.liferay.portal.model.Image image)
080                    throws com.liferay.portal.kernel.exception.SystemException {
081                    getService().deleteImage(image);
082            }
083    
084            /**
085            * Performs a dynamic query on the database and returns the matching rows.
086            *
087            * @param dynamicQuery the dynamic query to search with
088            * @return the matching rows
089            * @throws SystemException if a system exception occurred
090            */
091            @SuppressWarnings("rawtypes")
092            public static java.util.List dynamicQuery(
093                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
094                    throws com.liferay.portal.kernel.exception.SystemException {
095                    return getService().dynamicQuery(dynamicQuery);
096            }
097    
098            /**
099            * Performs a dynamic query on the database and returns a range of the matching rows.
100            *
101            * <p>
102            * 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.
103            * </p>
104            *
105            * @param dynamicQuery the dynamic query to search with
106            * @param start the lower bound of the range of model instances to return
107            * @param end the upper bound of the range of model instances to return (not inclusive)
108            * @return the range of matching rows
109            * @throws SystemException if a system exception occurred
110            */
111            @SuppressWarnings("rawtypes")
112            public static java.util.List dynamicQuery(
113                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
114                    int end) throws com.liferay.portal.kernel.exception.SystemException {
115                    return getService().dynamicQuery(dynamicQuery, start, end);
116            }
117    
118            /**
119            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
120            *
121            * <p>
122            * 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.
123            * </p>
124            *
125            * @param dynamicQuery the dynamic query to search with
126            * @param start the lower bound of the range of model instances to return
127            * @param end the upper bound of the range of model instances to return (not inclusive)
128            * @param orderByComparator the comparator to order the results by
129            * @return the ordered range of matching rows
130            * @throws SystemException if a system exception occurred
131            */
132            @SuppressWarnings("rawtypes")
133            public static java.util.List dynamicQuery(
134                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
135                    int end,
136                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
137                    throws com.liferay.portal.kernel.exception.SystemException {
138                    return getService()
139                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
140            }
141    
142            /**
143            * Counts the number of rows that match the dynamic query.
144            *
145            * @param dynamicQuery the dynamic query to search with
146            * @return the number of rows that match the dynamic query
147            * @throws SystemException if a system exception occurred
148            */
149            public static long dynamicQueryCount(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
151                    throws com.liferay.portal.kernel.exception.SystemException {
152                    return getService().dynamicQueryCount(dynamicQuery);
153            }
154    
155            /**
156            * Gets the image with the primary key.
157            *
158            * @param imageId the primary key of the image to get
159            * @return the image
160            * @throws PortalException if a image with the primary key could not be found
161            * @throws SystemException if a system exception occurred
162            */
163            public static com.liferay.portal.model.Image getImage(long imageId)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException {
166                    return getService().getImage(imageId);
167            }
168    
169            /**
170            * Gets a range of all the images.
171            *
172            * <p>
173            * 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.
174            * </p>
175            *
176            * @param start the lower bound of the range of images to return
177            * @param end the upper bound of the range of images to return (not inclusive)
178            * @return the range of images
179            * @throws SystemException if a system exception occurred
180            */
181            public static java.util.List<com.liferay.portal.model.Image> getImages(
182                    int start, int end)
183                    throws com.liferay.portal.kernel.exception.SystemException {
184                    return getService().getImages(start, end);
185            }
186    
187            /**
188            * Gets the number of images.
189            *
190            * @return the number of images
191            * @throws SystemException if a system exception occurred
192            */
193            public static int getImagesCount()
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getService().getImagesCount();
196            }
197    
198            /**
199            * Updates the image in the database. Also notifies the appropriate model listeners.
200            *
201            * @param image the image to update
202            * @return the image that was updated
203            * @throws SystemException if a system exception occurred
204            */
205            public static com.liferay.portal.model.Image updateImage(
206                    com.liferay.portal.model.Image image)
207                    throws com.liferay.portal.kernel.exception.SystemException {
208                    return getService().updateImage(image);
209            }
210    
211            /**
212            * Updates the image in the database. Also notifies the appropriate model listeners.
213            *
214            * @param image the image to update
215            * @param merge whether to merge the 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.
216            * @return the image that was updated
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portal.model.Image updateImage(
220                    com.liferay.portal.model.Image image, boolean merge)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getService().updateImage(image, merge);
223            }
224    
225            public static com.liferay.portal.model.Image getCompanyLogo(long imageId) {
226                    return getService().getCompanyLogo(imageId);
227            }
228    
229            public static com.liferay.portal.model.Image getDefaultCompanyLogo() {
230                    return getService().getDefaultCompanyLogo();
231            }
232    
233            public static com.liferay.portal.model.Image getDefaultOrganizationLogo() {
234                    return getService().getDefaultOrganizationLogo();
235            }
236    
237            public static com.liferay.portal.model.Image getDefaultSpacer() {
238                    return getService().getDefaultSpacer();
239            }
240    
241            public static com.liferay.portal.model.Image getDefaultUserFemalePortrait() {
242                    return getService().getDefaultUserFemalePortrait();
243            }
244    
245            public static com.liferay.portal.model.Image getDefaultUserMalePortrait() {
246                    return getService().getDefaultUserMalePortrait();
247            }
248    
249            public static com.liferay.portal.model.Image getImage(byte[] bytes)
250                    throws com.liferay.portal.kernel.exception.PortalException,
251                            com.liferay.portal.kernel.exception.SystemException {
252                    return getService().getImage(bytes);
253            }
254    
255            public static com.liferay.portal.model.Image getImage(java.io.File file)
256                    throws com.liferay.portal.kernel.exception.PortalException,
257                            com.liferay.portal.kernel.exception.SystemException {
258                    return getService().getImage(file);
259            }
260    
261            public static com.liferay.portal.model.Image getImage(
262                    java.io.InputStream is)
263                    throws com.liferay.portal.kernel.exception.PortalException,
264                            com.liferay.portal.kernel.exception.SystemException {
265                    return getService().getImage(is);
266            }
267    
268            public static com.liferay.portal.model.Image getImageOrDefault(long imageId) {
269                    return getService().getImageOrDefault(imageId);
270            }
271    
272            public static java.util.List<com.liferay.portal.model.Image> getImages()
273                    throws com.liferay.portal.kernel.exception.SystemException {
274                    return getService().getImages();
275            }
276    
277            public static java.util.List<com.liferay.portal.model.Image> getImagesBySize(
278                    int size) throws com.liferay.portal.kernel.exception.SystemException {
279                    return getService().getImagesBySize(size);
280            }
281    
282            public static boolean isNullOrDefaultSpacer(byte[] bytes) {
283                    return getService().isNullOrDefaultSpacer(bytes);
284            }
285    
286            public static com.liferay.portal.model.Image updateImage(long imageId,
287                    byte[] bytes)
288                    throws com.liferay.portal.kernel.exception.PortalException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    return getService().updateImage(imageId, bytes);
291            }
292    
293            public static com.liferay.portal.model.Image updateImage(long imageId,
294                    java.io.File file)
295                    throws com.liferay.portal.kernel.exception.PortalException,
296                            com.liferay.portal.kernel.exception.SystemException {
297                    return getService().updateImage(imageId, file);
298            }
299    
300            public static com.liferay.portal.model.Image updateImage(long imageId,
301                    java.io.InputStream is)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException {
304                    return getService().updateImage(imageId, is);
305            }
306    
307            public static com.liferay.portal.model.Image updateImage(long imageId,
308                    byte[] bytes, java.lang.String type, int height, int width, int size)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    return getService()
312                                       .updateImage(imageId, bytes, type, height, width, size);
313            }
314    
315            public static ImageLocalService getService() {
316                    if (_service == null) {
317                            _service = (ImageLocalService)PortalBeanLocatorUtil.locate(ImageLocalService.class.getName());
318                    }
319    
320                    return _service;
321            }
322    
323            public void setService(ImageLocalService service) {
324                    _service = service;
325            }
326    
327            private static ImageLocalService _service;
328    }