001    /**
002     * Copyright (c) 2000-present 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.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for Image. This utility wraps
024     * {@link com.liferay.portal.service.impl.ImageLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
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    @ProviderType
037    public class ImageLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ImageLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
052                    return getService().getIndexableActionableDynamicQuery();
053            }
054    
055            /**
056            * Adds the image to the database. Also notifies the appropriate model listeners.
057            *
058            * @param image the image
059            * @return the image that was added
060            */
061            public static com.liferay.portal.kernel.model.Image addImage(
062                    com.liferay.portal.kernel.model.Image image) {
063                    return getService().addImage(image);
064            }
065    
066            /**
067            * Creates a new image with the primary key. Does not add the image to the database.
068            *
069            * @param imageId the primary key for the new image
070            * @return the new image
071            */
072            public static com.liferay.portal.kernel.model.Image createImage(
073                    long imageId) {
074                    return getService().createImage(imageId);
075            }
076    
077            /**
078            * Deletes the image from the database. Also notifies the appropriate model listeners.
079            *
080            * @param image the image
081            * @return the image that was removed
082            */
083            public static com.liferay.portal.kernel.model.Image deleteImage(
084                    com.liferay.portal.kernel.model.Image image) {
085                    return getService().deleteImage(image);
086            }
087    
088            /**
089            * Deletes the image with the primary key from the database. Also notifies the appropriate model listeners.
090            *
091            * @param imageId the primary key of the image
092            * @return the image that was removed
093            * @throws PortalException if a image with the primary key could not be found
094            */
095            public static com.liferay.portal.kernel.model.Image deleteImage(
096                    long imageId)
097                    throws com.liferay.portal.kernel.exception.PortalException {
098                    return getService().deleteImage(imageId);
099            }
100    
101            public static com.liferay.portal.kernel.model.Image fetchImage(long imageId) {
102                    return getService().fetchImage(imageId);
103            }
104    
105            public static com.liferay.portal.kernel.model.Image getCompanyLogo(
106                    long imageId) {
107                    return getService().getCompanyLogo(imageId);
108            }
109    
110            /**
111            * Returns the image with the primary key.
112            *
113            * @param imageId the primary key of the image
114            * @return the image
115            * @throws PortalException if a image with the primary key could not be found
116            */
117            public static com.liferay.portal.kernel.model.Image getImage(long imageId)
118                    throws com.liferay.portal.kernel.exception.PortalException {
119                    return getService().getImage(imageId);
120            }
121    
122            public static com.liferay.portal.kernel.model.Image getImageOrDefault(
123                    long imageId) {
124                    return getService().getImageOrDefault(imageId);
125            }
126    
127            public static com.liferay.portal.kernel.model.Image moveImage(
128                    long imageId, byte[] bytes)
129                    throws com.liferay.portal.kernel.exception.PortalException {
130                    return getService().moveImage(imageId, bytes);
131            }
132    
133            /**
134            * Updates the image in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
135            *
136            * @param image the image
137            * @return the image that was updated
138            */
139            public static com.liferay.portal.kernel.model.Image updateImage(
140                    com.liferay.portal.kernel.model.Image image) {
141                    return getService().updateImage(image);
142            }
143    
144            public static com.liferay.portal.kernel.model.Image updateImage(
145                    long imageId, byte[] bytes)
146                    throws com.liferay.portal.kernel.exception.PortalException {
147                    return getService().updateImage(imageId, bytes);
148            }
149    
150            public static com.liferay.portal.kernel.model.Image updateImage(
151                    long imageId, byte[] bytes, java.lang.String type, int height,
152                    int width, int size)
153                    throws com.liferay.portal.kernel.exception.PortalException {
154                    return getService()
155                                       .updateImage(imageId, bytes, type, height, width, size);
156            }
157    
158            public static com.liferay.portal.kernel.model.Image updateImage(
159                    long imageId, java.io.File file)
160                    throws com.liferay.portal.kernel.exception.PortalException {
161                    return getService().updateImage(imageId, file);
162            }
163    
164            public static com.liferay.portal.kernel.model.Image updateImage(
165                    long imageId, java.io.InputStream is)
166                    throws com.liferay.portal.kernel.exception.PortalException {
167                    return getService().updateImage(imageId, is);
168            }
169    
170            public static com.liferay.portal.kernel.model.Image updateImage(
171                    long imageId, java.io.InputStream is, boolean cleanUpStream)
172                    throws com.liferay.portal.kernel.exception.PortalException {
173                    return getService().updateImage(imageId, is, cleanUpStream);
174            }
175    
176            /**
177            * @throws PortalException
178            */
179            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
180                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
181                    throws com.liferay.portal.kernel.exception.PortalException {
182                    return getService().deletePersistedModel(persistedModel);
183            }
184    
185            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
186                    java.io.Serializable primaryKeyObj)
187                    throws com.liferay.portal.kernel.exception.PortalException {
188                    return getService().getPersistedModel(primaryKeyObj);
189            }
190    
191            /**
192            * Returns the number of images.
193            *
194            * @return the number of images
195            */
196            public static int getImagesCount() {
197                    return getService().getImagesCount();
198            }
199    
200            /**
201            * Returns the OSGi service identifier.
202            *
203            * @return the OSGi service identifier
204            */
205            public static java.lang.String getOSGiServiceIdentifier() {
206                    return getService().getOSGiServiceIdentifier();
207            }
208    
209            /**
210            * Performs a dynamic query on the database and returns the matching rows.
211            *
212            * @param dynamicQuery the dynamic query
213            * @return the matching rows
214            */
215            public static <T> java.util.List<T> dynamicQuery(
216                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
217                    return getService().dynamicQuery(dynamicQuery);
218            }
219    
220            /**
221            * Performs a dynamic query on the database and returns a range of the matching rows.
222            *
223            * <p>
224            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ImageModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
225            * </p>
226            *
227            * @param dynamicQuery the dynamic query
228            * @param start the lower bound of the range of model instances
229            * @param end the upper bound of the range of model instances (not inclusive)
230            * @return the range of matching rows
231            */
232            public static <T> java.util.List<T> dynamicQuery(
233                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
234                    int end) {
235                    return getService().dynamicQuery(dynamicQuery, start, end);
236            }
237    
238            /**
239            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
240            *
241            * <p>
242            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ImageModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
243            * </p>
244            *
245            * @param dynamicQuery the dynamic query
246            * @param start the lower bound of the range of model instances
247            * @param end the upper bound of the range of model instances (not inclusive)
248            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
249            * @return the ordered range of matching rows
250            */
251            public static <T> java.util.List<T> dynamicQuery(
252                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
253                    int end,
254                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
255                    return getService()
256                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
257            }
258    
259            public static java.util.List<com.liferay.portal.kernel.model.Image> getImages() {
260                    return getService().getImages();
261            }
262    
263            /**
264            * Returns a range of all the images.
265            *
266            * <p>
267            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ImageModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
268            * </p>
269            *
270            * @param start the lower bound of the range of images
271            * @param end the upper bound of the range of images (not inclusive)
272            * @return the range of images
273            */
274            public static java.util.List<com.liferay.portal.kernel.model.Image> getImages(
275                    int start, int end) {
276                    return getService().getImages(start, end);
277            }
278    
279            public static java.util.List<com.liferay.portal.kernel.model.Image> getImagesBySize(
280                    int size) {
281                    return getService().getImagesBySize(size);
282            }
283    
284            /**
285            * Returns the number of rows matching the dynamic query.
286            *
287            * @param dynamicQuery the dynamic query
288            * @return the number of rows matching the dynamic query
289            */
290            public static long dynamicQueryCount(
291                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
292                    return getService().dynamicQueryCount(dynamicQuery);
293            }
294    
295            /**
296            * Returns the number of rows matching the dynamic query.
297            *
298            * @param dynamicQuery the dynamic query
299            * @param projection the projection to apply to the query
300            * @return the number of rows matching the dynamic query
301            */
302            public static long dynamicQueryCount(
303                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
304                    com.liferay.portal.kernel.dao.orm.Projection projection) {
305                    return getService().dynamicQueryCount(dynamicQuery, projection);
306            }
307    
308            public static ImageLocalService getService() {
309                    if (_service == null) {
310                            _service = (ImageLocalService)PortalBeanLocatorUtil.locate(ImageLocalService.class.getName());
311    
312                            ReferenceRegistry.registerReference(ImageLocalServiceUtil.class,
313                                    "_service");
314                    }
315    
316                    return _service;
317            }
318    
319            private static ImageLocalService _service;
320    }