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.base;
016    
017    import com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.exception.SystemException;
024    import com.liferay.portal.model.Image;
025    import com.liferay.portal.service.BaseServiceImpl;
026    import com.liferay.portal.service.ImageService;
027    import com.liferay.portal.service.persistence.ImagePersistence;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryFinder;
031    import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistence;
032    
033    import javax.sql.DataSource;
034    
035    /**
036     * Provides the base implementation for the image remote service.
037     *
038     * <p>
039     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portal.service.impl.ImageServiceImpl}.
040     * </p>
041     *
042     * @author Brian Wing Shun Chan
043     * @see com.liferay.portal.service.impl.ImageServiceImpl
044     * @see com.liferay.portal.service.ImageServiceUtil
045     * @generated
046     */
047    public abstract class ImageServiceBaseImpl extends BaseServiceImpl
048            implements ImageService, IdentifiableBean {
049            /*
050             * NOTE FOR DEVELOPERS:
051             *
052             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.ImageServiceUtil} to access the image remote service.
053             */
054    
055            /**
056             * Returns the image local service.
057             *
058             * @return the image local service
059             */
060            public com.liferay.portal.service.ImageLocalService getImageLocalService() {
061                    return imageLocalService;
062            }
063    
064            /**
065             * Sets the image local service.
066             *
067             * @param imageLocalService the image local service
068             */
069            public void setImageLocalService(
070                    com.liferay.portal.service.ImageLocalService imageLocalService) {
071                    this.imageLocalService = imageLocalService;
072            }
073    
074            /**
075             * Returns the image remote service.
076             *
077             * @return the image remote service
078             */
079            public ImageService getImageService() {
080                    return imageService;
081            }
082    
083            /**
084             * Sets the image remote service.
085             *
086             * @param imageService the image remote service
087             */
088            public void setImageService(ImageService imageService) {
089                    this.imageService = imageService;
090            }
091    
092            /**
093             * Returns the image persistence.
094             *
095             * @return the image persistence
096             */
097            public ImagePersistence getImagePersistence() {
098                    return imagePersistence;
099            }
100    
101            /**
102             * Sets the image persistence.
103             *
104             * @param imagePersistence the image persistence
105             */
106            public void setImagePersistence(ImagePersistence imagePersistence) {
107                    this.imagePersistence = imagePersistence;
108            }
109    
110            /**
111             * Returns the counter local service.
112             *
113             * @return the counter local service
114             */
115            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
116                    return counterLocalService;
117            }
118    
119            /**
120             * Sets the counter local service.
121             *
122             * @param counterLocalService the counter local service
123             */
124            public void setCounterLocalService(
125                    com.liferay.counter.service.CounterLocalService counterLocalService) {
126                    this.counterLocalService = counterLocalService;
127            }
128    
129            /**
130             * Returns the document library file entry local service.
131             *
132             * @return the document library file entry local service
133             */
134            public com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService getDLFileEntryLocalService() {
135                    return dlFileEntryLocalService;
136            }
137    
138            /**
139             * Sets the document library file entry local service.
140             *
141             * @param dlFileEntryLocalService the document library file entry local service
142             */
143            public void setDLFileEntryLocalService(
144                    com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService) {
145                    this.dlFileEntryLocalService = dlFileEntryLocalService;
146            }
147    
148            /**
149             * Returns the document library file entry remote service.
150             *
151             * @return the document library file entry remote service
152             */
153            public com.liferay.portlet.documentlibrary.service.DLFileEntryService getDLFileEntryService() {
154                    return dlFileEntryService;
155            }
156    
157            /**
158             * Sets the document library file entry remote service.
159             *
160             * @param dlFileEntryService the document library file entry remote service
161             */
162            public void setDLFileEntryService(
163                    com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService) {
164                    this.dlFileEntryService = dlFileEntryService;
165            }
166    
167            /**
168             * Returns the document library file entry persistence.
169             *
170             * @return the document library file entry persistence
171             */
172            public DLFileEntryPersistence getDLFileEntryPersistence() {
173                    return dlFileEntryPersistence;
174            }
175    
176            /**
177             * Sets the document library file entry persistence.
178             *
179             * @param dlFileEntryPersistence the document library file entry persistence
180             */
181            public void setDLFileEntryPersistence(
182                    DLFileEntryPersistence dlFileEntryPersistence) {
183                    this.dlFileEntryPersistence = dlFileEntryPersistence;
184            }
185    
186            /**
187             * Returns the document library file entry finder.
188             *
189             * @return the document library file entry finder
190             */
191            public DLFileEntryFinder getDLFileEntryFinder() {
192                    return dlFileEntryFinder;
193            }
194    
195            /**
196             * Sets the document library file entry finder.
197             *
198             * @param dlFileEntryFinder the document library file entry finder
199             */
200            public void setDLFileEntryFinder(DLFileEntryFinder dlFileEntryFinder) {
201                    this.dlFileEntryFinder = dlFileEntryFinder;
202            }
203    
204            public void afterPropertiesSet() {
205            }
206    
207            public void destroy() {
208            }
209    
210            /**
211             * Returns the Spring bean ID for this bean.
212             *
213             * @return the Spring bean ID for this bean
214             */
215            @Override
216            public String getBeanIdentifier() {
217                    return _beanIdentifier;
218            }
219    
220            /**
221             * Sets the Spring bean ID for this bean.
222             *
223             * @param beanIdentifier the Spring bean ID for this bean
224             */
225            @Override
226            public void setBeanIdentifier(String beanIdentifier) {
227                    _beanIdentifier = beanIdentifier;
228            }
229    
230            protected Class<?> getModelClass() {
231                    return Image.class;
232            }
233    
234            protected String getModelClassName() {
235                    return Image.class.getName();
236            }
237    
238            /**
239             * Performs a SQL query.
240             *
241             * @param sql the sql query
242             */
243            protected void runSQL(String sql) {
244                    try {
245                            DataSource dataSource = imagePersistence.getDataSource();
246    
247                            DB db = DBFactoryUtil.getDB();
248    
249                            sql = db.buildSQL(sql);
250                            sql = PortalUtil.transformSQL(sql);
251    
252                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
253                                            sql, new int[0]);
254    
255                            sqlUpdate.update();
256                    }
257                    catch (Exception e) {
258                            throw new SystemException(e);
259                    }
260            }
261    
262            @BeanReference(type = com.liferay.portal.service.ImageLocalService.class)
263            protected com.liferay.portal.service.ImageLocalService imageLocalService;
264            @BeanReference(type = com.liferay.portal.service.ImageService.class)
265            protected ImageService imageService;
266            @BeanReference(type = ImagePersistence.class)
267            protected ImagePersistence imagePersistence;
268            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
269            protected com.liferay.counter.service.CounterLocalService counterLocalService;
270            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService.class)
271            protected com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService;
272            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryService.class)
273            protected com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService;
274            @BeanReference(type = DLFileEntryPersistence.class)
275            protected DLFileEntryPersistence dlFileEntryPersistence;
276            @BeanReference(type = DLFileEntryFinder.class)
277            protected DLFileEntryFinder dlFileEntryFinder;
278            private String _beanIdentifier;
279    }