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