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