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