001    /**
002     * Copyright (c) 2000-2013 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.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the image local service.
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 ImageLocalServiceUtil
032     * @see com.liferay.portal.service.base.ImageLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ImageLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface ImageLocalService extends BaseLocalService,
039            PersistedModelLocalService {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify or reference this interface directly. Always use {@link ImageLocalServiceUtil} to access the image local service. Add custom service methods to {@link com.liferay.portal.service.impl.ImageLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
044             */
045    
046            /**
047            * Adds the image to the database. Also notifies the appropriate model listeners.
048            *
049            * @param image the image
050            * @return the image that was added
051            * @throws SystemException if a system exception occurred
052            */
053            public com.liferay.portal.model.Image addImage(
054                    com.liferay.portal.model.Image image)
055                    throws com.liferay.portal.kernel.exception.SystemException;
056    
057            /**
058            * Creates a new image with the primary key. Does not add the image to the database.
059            *
060            * @param imageId the primary key for the new image
061            * @return the new image
062            */
063            public com.liferay.portal.model.Image createImage(long imageId);
064    
065            /**
066            * Deletes the image with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param imageId the primary key of the image
069            * @return the image that was removed
070            * @throws PortalException if a image with the primary key could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public com.liferay.portal.model.Image deleteImage(long imageId)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException;
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            * @throws SystemException if a system exception occurred
083            */
084            public com.liferay.portal.model.Image deleteImage(
085                    com.liferay.portal.model.Image image)
086                    throws com.liferay.portal.kernel.exception.SystemException;
087    
088            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException;
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 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    
120            /**
121            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
122            *
123            * <p>
124            * 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.
125            * </p>
126            *
127            * @param dynamicQuery the dynamic query
128            * @param start the lower bound of the range of model instances
129            * @param end the upper bound of the range of model instances (not inclusive)
130            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
131            * @return the ordered range of matching rows
132            * @throws SystemException if a system exception occurred
133            */
134            @SuppressWarnings("rawtypes")
135            public java.util.List dynamicQuery(
136                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
137                    int end,
138                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
139                    throws com.liferay.portal.kernel.exception.SystemException;
140    
141            /**
142            * Returns the number of rows that match the dynamic query.
143            *
144            * @param dynamicQuery the dynamic query
145            * @return the number of rows that match the dynamic query
146            * @throws SystemException if a system exception occurred
147            */
148            public long dynamicQueryCount(
149                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
150                    throws com.liferay.portal.kernel.exception.SystemException;
151    
152            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153            public com.liferay.portal.model.Image fetchImage(long imageId)
154                    throws com.liferay.portal.kernel.exception.SystemException;
155    
156            /**
157            * Returns the image with the primary key.
158            *
159            * @param imageId the primary key of the image
160            * @return the image
161            * @throws PortalException if a image with the primary key could not be found
162            * @throws SystemException if a system exception occurred
163            */
164            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165            public com.liferay.portal.model.Image getImage(long imageId)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException;
168    
169            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170            public com.liferay.portal.model.PersistedModel getPersistedModel(
171                    java.io.Serializable primaryKeyObj)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException;
174    
175            /**
176            * Returns a range of all the images.
177            *
178            * <p>
179            * 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.
180            * </p>
181            *
182            * @param start the lower bound of the range of images
183            * @param end the upper bound of the range of images (not inclusive)
184            * @return the range of images
185            * @throws SystemException if a system exception occurred
186            */
187            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
188            public java.util.List<com.liferay.portal.model.Image> getImages(int start,
189                    int end) throws com.liferay.portal.kernel.exception.SystemException;
190    
191            /**
192            * Returns the number of images.
193            *
194            * @return the number of images
195            * @throws SystemException if a system exception occurred
196            */
197            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
198            public int getImagesCount()
199                    throws com.liferay.portal.kernel.exception.SystemException;
200    
201            /**
202            * Updates the image in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
203            *
204            * @param image the image
205            * @return the image that was updated
206            * @throws SystemException if a system exception occurred
207            */
208            public com.liferay.portal.model.Image updateImage(
209                    com.liferay.portal.model.Image image)
210                    throws com.liferay.portal.kernel.exception.SystemException;
211    
212            /**
213            * Updates the image in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
214            *
215            * @param image the image
216            * @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.
217            * @return the image that was updated
218            * @throws SystemException if a system exception occurred
219            */
220            public com.liferay.portal.model.Image updateImage(
221                    com.liferay.portal.model.Image image, boolean merge)
222                    throws com.liferay.portal.kernel.exception.SystemException;
223    
224            /**
225            * Returns the Spring bean ID for this bean.
226            *
227            * @return the Spring bean ID for this bean
228            */
229            public java.lang.String getBeanIdentifier();
230    
231            /**
232            * Sets the Spring bean ID for this bean.
233            *
234            * @param beanIdentifier the Spring bean ID for this bean
235            */
236            public void setBeanIdentifier(java.lang.String beanIdentifier);
237    
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public com.liferay.portal.model.Image getCompanyLogo(long imageId);
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public com.liferay.portal.model.Image getDefaultCompanyLogo();
243    
244            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
245            public com.liferay.portal.model.Image getDefaultOrganizationLogo();
246    
247            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
248            public com.liferay.portal.model.Image getDefaultSpacer();
249    
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public com.liferay.portal.model.Image getDefaultUserFemalePortrait();
252    
253            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254            public com.liferay.portal.model.Image getDefaultUserMalePortrait();
255    
256            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
257            public com.liferay.portal.model.Image getImage(byte[] bytes)
258                    throws com.liferay.portal.kernel.exception.PortalException,
259                            com.liferay.portal.kernel.exception.SystemException;
260    
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public com.liferay.portal.model.Image getImage(java.io.File file)
263                    throws com.liferay.portal.kernel.exception.PortalException,
264                            com.liferay.portal.kernel.exception.SystemException;
265    
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public com.liferay.portal.model.Image getImage(java.io.InputStream is)
268                    throws com.liferay.portal.kernel.exception.PortalException,
269                            com.liferay.portal.kernel.exception.SystemException;
270    
271            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272            public com.liferay.portal.model.Image getImage(java.io.InputStream is,
273                    boolean cleanUpStream)
274                    throws com.liferay.portal.kernel.exception.PortalException,
275                            com.liferay.portal.kernel.exception.SystemException;
276    
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public com.liferay.portal.model.Image getImageOrDefault(long imageId);
279    
280            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281            public java.util.List<com.liferay.portal.model.Image> getImages()
282                    throws com.liferay.portal.kernel.exception.SystemException;
283    
284            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
285            public java.util.List<com.liferay.portal.model.Image> getImagesBySize(
286                    int size) throws com.liferay.portal.kernel.exception.SystemException;
287    
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public boolean isNullOrDefaultSpacer(byte[] bytes);
290    
291            public com.liferay.portal.model.Image updateImage(long imageId, byte[] bytes)
292                    throws com.liferay.portal.kernel.exception.PortalException,
293                            com.liferay.portal.kernel.exception.SystemException;
294    
295            public com.liferay.portal.model.Image updateImage(long imageId,
296                    byte[] bytes, java.lang.String type, int height, int width, int size)
297                    throws com.liferay.portal.kernel.exception.PortalException,
298                            com.liferay.portal.kernel.exception.SystemException;
299    
300            public com.liferay.portal.model.Image updateImage(long imageId,
301                    java.io.File file)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException;
304    
305            public com.liferay.portal.model.Image updateImage(long imageId,
306                    java.io.InputStream is)
307                    throws com.liferay.portal.kernel.exception.PortalException,
308                            com.liferay.portal.kernel.exception.SystemException;
309    
310            public com.liferay.portal.model.Image updateImage(long imageId,
311                    java.io.InputStream is, boolean cleanUpStream)
312                    throws com.liferay.portal.kernel.exception.PortalException,
313                            com.liferay.portal.kernel.exception.SystemException;
314    }