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.Website;
025    import com.liferay.portal.service.BaseServiceImpl;
026    import com.liferay.portal.service.WebsiteService;
027    import com.liferay.portal.service.persistence.ClassNamePersistence;
028    import com.liferay.portal.service.persistence.ListTypePersistence;
029    import com.liferay.portal.service.persistence.UserFinder;
030    import com.liferay.portal.service.persistence.UserPersistence;
031    import com.liferay.portal.service.persistence.WebsitePersistence;
032    import com.liferay.portal.util.PortalUtil;
033    
034    import javax.sql.DataSource;
035    
036    /**
037     * Provides the base implementation for the website remote service.
038     *
039     * <p>
040     * 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.WebsiteServiceImpl}.
041     * </p>
042     *
043     * @author Brian Wing Shun Chan
044     * @see com.liferay.portal.service.impl.WebsiteServiceImpl
045     * @see com.liferay.portal.service.WebsiteServiceUtil
046     * @generated
047     */
048    public abstract class WebsiteServiceBaseImpl extends BaseServiceImpl
049            implements WebsiteService, IdentifiableOSGiService {
050            /*
051             * NOTE FOR DEVELOPERS:
052             *
053             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.WebsiteServiceUtil} to access the website remote service.
054             */
055    
056            /**
057             * Returns the website local service.
058             *
059             * @return the website local service
060             */
061            public com.liferay.portal.service.WebsiteLocalService getWebsiteLocalService() {
062                    return websiteLocalService;
063            }
064    
065            /**
066             * Sets the website local service.
067             *
068             * @param websiteLocalService the website local service
069             */
070            public void setWebsiteLocalService(
071                    com.liferay.portal.service.WebsiteLocalService websiteLocalService) {
072                    this.websiteLocalService = websiteLocalService;
073            }
074    
075            /**
076             * Returns the website remote service.
077             *
078             * @return the website remote service
079             */
080            public WebsiteService getWebsiteService() {
081                    return websiteService;
082            }
083    
084            /**
085             * Sets the website remote service.
086             *
087             * @param websiteService the website remote service
088             */
089            public void setWebsiteService(WebsiteService websiteService) {
090                    this.websiteService = websiteService;
091            }
092    
093            /**
094             * Returns the website persistence.
095             *
096             * @return the website persistence
097             */
098            public WebsitePersistence getWebsitePersistence() {
099                    return websitePersistence;
100            }
101    
102            /**
103             * Sets the website persistence.
104             *
105             * @param websitePersistence the website persistence
106             */
107            public void setWebsitePersistence(WebsitePersistence websitePersistence) {
108                    this.websitePersistence = websitePersistence;
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 class name local service.
132             *
133             * @return the class name local service
134             */
135            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
136                    return classNameLocalService;
137            }
138    
139            /**
140             * Sets the class name local service.
141             *
142             * @param classNameLocalService the class name local service
143             */
144            public void setClassNameLocalService(
145                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
146                    this.classNameLocalService = classNameLocalService;
147            }
148    
149            /**
150             * Returns the class name remote service.
151             *
152             * @return the class name remote service
153             */
154            public com.liferay.portal.service.ClassNameService getClassNameService() {
155                    return classNameService;
156            }
157    
158            /**
159             * Sets the class name remote service.
160             *
161             * @param classNameService the class name remote service
162             */
163            public void setClassNameService(
164                    com.liferay.portal.service.ClassNameService classNameService) {
165                    this.classNameService = classNameService;
166            }
167    
168            /**
169             * Returns the class name persistence.
170             *
171             * @return the class name persistence
172             */
173            public ClassNamePersistence getClassNamePersistence() {
174                    return classNamePersistence;
175            }
176    
177            /**
178             * Sets the class name persistence.
179             *
180             * @param classNamePersistence the class name persistence
181             */
182            public void setClassNamePersistence(
183                    ClassNamePersistence classNamePersistence) {
184                    this.classNamePersistence = classNamePersistence;
185            }
186    
187            /**
188             * Returns the list type local service.
189             *
190             * @return the list type local service
191             */
192            public com.liferay.portal.service.ListTypeLocalService getListTypeLocalService() {
193                    return listTypeLocalService;
194            }
195    
196            /**
197             * Sets the list type local service.
198             *
199             * @param listTypeLocalService the list type local service
200             */
201            public void setListTypeLocalService(
202                    com.liferay.portal.service.ListTypeLocalService listTypeLocalService) {
203                    this.listTypeLocalService = listTypeLocalService;
204            }
205    
206            /**
207             * Returns the list type remote service.
208             *
209             * @return the list type remote service
210             */
211            public com.liferay.portal.service.ListTypeService getListTypeService() {
212                    return listTypeService;
213            }
214    
215            /**
216             * Sets the list type remote service.
217             *
218             * @param listTypeService the list type remote service
219             */
220            public void setListTypeService(
221                    com.liferay.portal.service.ListTypeService listTypeService) {
222                    this.listTypeService = listTypeService;
223            }
224    
225            /**
226             * Returns the list type persistence.
227             *
228             * @return the list type persistence
229             */
230            public ListTypePersistence getListTypePersistence() {
231                    return listTypePersistence;
232            }
233    
234            /**
235             * Sets the list type persistence.
236             *
237             * @param listTypePersistence the list type persistence
238             */
239            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
240                    this.listTypePersistence = listTypePersistence;
241            }
242    
243            /**
244             * Returns the user local service.
245             *
246             * @return the user local service
247             */
248            public com.liferay.portal.service.UserLocalService getUserLocalService() {
249                    return userLocalService;
250            }
251    
252            /**
253             * Sets the user local service.
254             *
255             * @param userLocalService the user local service
256             */
257            public void setUserLocalService(
258                    com.liferay.portal.service.UserLocalService userLocalService) {
259                    this.userLocalService = userLocalService;
260            }
261    
262            /**
263             * Returns the user remote service.
264             *
265             * @return the user remote service
266             */
267            public com.liferay.portal.service.UserService getUserService() {
268                    return userService;
269            }
270    
271            /**
272             * Sets the user remote service.
273             *
274             * @param userService the user remote service
275             */
276            public void setUserService(
277                    com.liferay.portal.service.UserService userService) {
278                    this.userService = userService;
279            }
280    
281            /**
282             * Returns the user persistence.
283             *
284             * @return the user persistence
285             */
286            public UserPersistence getUserPersistence() {
287                    return userPersistence;
288            }
289    
290            /**
291             * Sets the user persistence.
292             *
293             * @param userPersistence the user persistence
294             */
295            public void setUserPersistence(UserPersistence userPersistence) {
296                    this.userPersistence = userPersistence;
297            }
298    
299            /**
300             * Returns the user finder.
301             *
302             * @return the user finder
303             */
304            public UserFinder getUserFinder() {
305                    return userFinder;
306            }
307    
308            /**
309             * Sets the user finder.
310             *
311             * @param userFinder the user finder
312             */
313            public void setUserFinder(UserFinder userFinder) {
314                    this.userFinder = userFinder;
315            }
316    
317            public void afterPropertiesSet() {
318            }
319    
320            public void destroy() {
321            }
322    
323            /**
324             * Returns the OSGi service identifier.
325             *
326             * @return the OSGi service identifier
327             */
328            @Override
329            public String getOSGiServiceIdentifier() {
330                    return WebsiteService.class.getName();
331            }
332    
333            protected Class<?> getModelClass() {
334                    return Website.class;
335            }
336    
337            protected String getModelClassName() {
338                    return Website.class.getName();
339            }
340    
341            /**
342             * Performs a SQL query.
343             *
344             * @param sql the sql query
345             */
346            protected void runSQL(String sql) {
347                    try {
348                            DataSource dataSource = websitePersistence.getDataSource();
349    
350                            DB db = DBManagerUtil.getDB();
351    
352                            sql = db.buildSQL(sql);
353                            sql = PortalUtil.transformSQL(sql);
354    
355                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
356                                            sql, new int[0]);
357    
358                            sqlUpdate.update();
359                    }
360                    catch (Exception e) {
361                            throw new SystemException(e);
362                    }
363            }
364    
365            @BeanReference(type = com.liferay.portal.service.WebsiteLocalService.class)
366            protected com.liferay.portal.service.WebsiteLocalService websiteLocalService;
367            @BeanReference(type = com.liferay.portal.service.WebsiteService.class)
368            protected WebsiteService websiteService;
369            @BeanReference(type = WebsitePersistence.class)
370            protected WebsitePersistence websitePersistence;
371            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
372            protected com.liferay.counter.service.CounterLocalService counterLocalService;
373            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
374            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
375            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
376            protected com.liferay.portal.service.ClassNameService classNameService;
377            @BeanReference(type = ClassNamePersistence.class)
378            protected ClassNamePersistence classNamePersistence;
379            @BeanReference(type = com.liferay.portal.service.ListTypeLocalService.class)
380            protected com.liferay.portal.service.ListTypeLocalService listTypeLocalService;
381            @BeanReference(type = com.liferay.portal.service.ListTypeService.class)
382            protected com.liferay.portal.service.ListTypeService listTypeService;
383            @BeanReference(type = ListTypePersistence.class)
384            protected ListTypePersistence listTypePersistence;
385            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
386            protected com.liferay.portal.service.UserLocalService userLocalService;
387            @BeanReference(type = com.liferay.portal.service.UserService.class)
388            protected com.liferay.portal.service.UserService userService;
389            @BeanReference(type = UserPersistence.class)
390            protected UserPersistence userPersistence;
391            @BeanReference(type = UserFinder.class)
392            protected UserFinder userFinder;
393    }