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 com.liferay.portal.service.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(
089                    com.liferay.portal.service.ImageService imageService) {
090                    this.imageService = imageService;
091            }
092    
093            /**
094             * Returns the image persistence.
095             *
096             * @return the image persistence
097             */
098            public ImagePersistence getImagePersistence() {
099                    return imagePersistence;
100            }
101    
102            /**
103             * Sets the image persistence.
104             *
105             * @param imagePersistence the image persistence
106             */
107            public void setImagePersistence(ImagePersistence imagePersistence) {
108                    this.imagePersistence = imagePersistence;
109            }
110    
111            /**
112             * Returns the counter local service.
113             *
114             * @return the counter local service
115             */
116            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
117                    return counterLocalService;
118            }
119    
120            /**
121             * Sets the counter local service.
122             *
123             * @param counterLocalService the counter local service
124             */
125            public void setCounterLocalService(
126                    com.liferay.counter.service.CounterLocalService counterLocalService) {
127                    this.counterLocalService = counterLocalService;
128            }
129    
130            /**
131             * Returns the document library file entry local service.
132             *
133             * @return the document library file entry local service
134             */
135            public com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService getDLFileEntryLocalService() {
136                    return dlFileEntryLocalService;
137            }
138    
139            /**
140             * Sets the document library file entry local service.
141             *
142             * @param dlFileEntryLocalService the document library file entry local service
143             */
144            public void setDLFileEntryLocalService(
145                    com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService) {
146                    this.dlFileEntryLocalService = dlFileEntryLocalService;
147            }
148    
149            /**
150             * Returns the document library file entry remote service.
151             *
152             * @return the document library file entry remote service
153             */
154            public com.liferay.portlet.documentlibrary.service.DLFileEntryService getDLFileEntryService() {
155                    return dlFileEntryService;
156            }
157    
158            /**
159             * Sets the document library file entry remote service.
160             *
161             * @param dlFileEntryService the document library file entry remote service
162             */
163            public void setDLFileEntryService(
164                    com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService) {
165                    this.dlFileEntryService = dlFileEntryService;
166            }
167    
168            /**
169             * Returns the document library file entry persistence.
170             *
171             * @return the document library file entry persistence
172             */
173            public DLFileEntryPersistence getDLFileEntryPersistence() {
174                    return dlFileEntryPersistence;
175            }
176    
177            /**
178             * Sets the document library file entry persistence.
179             *
180             * @param dlFileEntryPersistence the document library file entry persistence
181             */
182            public void setDLFileEntryPersistence(
183                    DLFileEntryPersistence dlFileEntryPersistence) {
184                    this.dlFileEntryPersistence = dlFileEntryPersistence;
185            }
186    
187            /**
188             * Returns the document library file entry finder.
189             *
190             * @return the document library file entry finder
191             */
192            public DLFileEntryFinder getDLFileEntryFinder() {
193                    return dlFileEntryFinder;
194            }
195    
196            /**
197             * Sets the document library file entry finder.
198             *
199             * @param dlFileEntryFinder the document library file entry finder
200             */
201            public void setDLFileEntryFinder(DLFileEntryFinder dlFileEntryFinder) {
202                    this.dlFileEntryFinder = dlFileEntryFinder;
203            }
204    
205            public void afterPropertiesSet() {
206            }
207    
208            public void destroy() {
209            }
210    
211            /**
212             * Returns the Spring bean ID for this bean.
213             *
214             * @return the Spring bean ID for this bean
215             */
216            @Override
217            public String getBeanIdentifier() {
218                    return _beanIdentifier;
219            }
220    
221            /**
222             * Sets the Spring bean ID for this bean.
223             *
224             * @param beanIdentifier the Spring bean ID for this bean
225             */
226            @Override
227            public void setBeanIdentifier(String beanIdentifier) {
228                    _beanIdentifier = beanIdentifier;
229            }
230    
231            protected Class<?> getModelClass() {
232                    return Image.class;
233            }
234    
235            protected String getModelClassName() {
236                    return Image.class.getName();
237            }
238    
239            /**
240             * Performs a SQL query.
241             *
242             * @param sql the sql query
243             */
244            protected void runSQL(String sql) {
245                    try {
246                            DataSource dataSource = imagePersistence.getDataSource();
247    
248                            DB db = DBFactoryUtil.getDB();
249    
250                            sql = db.buildSQL(sql);
251                            sql = PortalUtil.transformSQL(sql);
252    
253                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
254                                            sql, new int[0]);
255    
256                            sqlUpdate.update();
257                    }
258                    catch (Exception e) {
259                            throw new SystemException(e);
260                    }
261            }
262    
263            @BeanReference(type = com.liferay.portal.service.ImageLocalService.class)
264            protected com.liferay.portal.service.ImageLocalService imageLocalService;
265            @BeanReference(type = com.liferay.portal.service.ImageService.class)
266            protected com.liferay.portal.service.ImageService imageService;
267            @BeanReference(type = ImagePersistence.class)
268            protected ImagePersistence imagePersistence;
269            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
270            protected com.liferay.counter.service.CounterLocalService counterLocalService;
271            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService.class)
272            protected com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService;
273            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryService.class)
274            protected com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService;
275            @BeanReference(type = DLFileEntryPersistence.class)
276            protected DLFileEntryPersistence dlFileEntryPersistence;
277            @BeanReference(type = DLFileEntryFinder.class)
278            protected DLFileEntryFinder dlFileEntryFinder;
279            private String _beanIdentifier;
280    }