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.dao.db.DB;
019    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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, IdentifiableOSGiService {
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 OSGi service identifier.
212             *
213             * @return the OSGi service identifier
214             */
215            @Override
216            public String getOSGiServiceIdentifier() {
217                    return ImageService.class.getName();
218            }
219    
220            protected Class<?> getModelClass() {
221                    return Image.class;
222            }
223    
224            protected String getModelClassName() {
225                    return Image.class.getName();
226            }
227    
228            /**
229             * Performs a SQL query.
230             *
231             * @param sql the sql query
232             */
233            protected void runSQL(String sql) {
234                    try {
235                            DataSource dataSource = imagePersistence.getDataSource();
236    
237                            DB db = DBManagerUtil.getDB();
238    
239                            sql = db.buildSQL(sql);
240                            sql = PortalUtil.transformSQL(sql);
241    
242                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
243                                            sql, new int[0]);
244    
245                            sqlUpdate.update();
246                    }
247                    catch (Exception e) {
248                            throw new SystemException(e);
249                    }
250            }
251    
252            @BeanReference(type = com.liferay.portal.service.ImageLocalService.class)
253            protected com.liferay.portal.service.ImageLocalService imageLocalService;
254            @BeanReference(type = com.liferay.portal.service.ImageService.class)
255            protected ImageService imageService;
256            @BeanReference(type = ImagePersistence.class)
257            protected ImagePersistence imagePersistence;
258            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
259            protected com.liferay.counter.service.CounterLocalService counterLocalService;
260            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService.class)
261            protected com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService dlFileEntryLocalService;
262            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLFileEntryService.class)
263            protected com.liferay.portlet.documentlibrary.service.DLFileEntryService dlFileEntryService;
264            @BeanReference(type = DLFileEntryPersistence.class)
265            protected DLFileEntryPersistence dlFileEntryPersistence;
266            @BeanReference(type = DLFileEntryFinder.class)
267            protected DLFileEntryFinder dlFileEntryFinder;
268    }