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.kernel.util.InfrastructureUtil;
025    import com.liferay.portal.service.BaseServiceImpl;
026    import com.liferay.portal.service.ThemeService;
027    import com.liferay.portal.service.persistence.PluginSettingPersistence;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import javax.sql.DataSource;
031    
032    /**
033     * Provides the base implementation for the theme remote service.
034     *
035     * <p>
036     * 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.ThemeServiceImpl}.
037     * </p>
038     *
039     * @author Brian Wing Shun Chan
040     * @see com.liferay.portal.service.impl.ThemeServiceImpl
041     * @see com.liferay.portal.service.ThemeServiceUtil
042     * @generated
043     */
044    public abstract class ThemeServiceBaseImpl extends BaseServiceImpl
045            implements ThemeService, IdentifiableOSGiService {
046            /*
047             * NOTE FOR DEVELOPERS:
048             *
049             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.ThemeServiceUtil} to access the theme remote service.
050             */
051    
052            /**
053             * Returns the theme local service.
054             *
055             * @return the theme local service
056             */
057            public com.liferay.portal.service.ThemeLocalService getThemeLocalService() {
058                    return themeLocalService;
059            }
060    
061            /**
062             * Sets the theme local service.
063             *
064             * @param themeLocalService the theme local service
065             */
066            public void setThemeLocalService(
067                    com.liferay.portal.service.ThemeLocalService themeLocalService) {
068                    this.themeLocalService = themeLocalService;
069            }
070    
071            /**
072             * Returns the theme remote service.
073             *
074             * @return the theme remote service
075             */
076            public ThemeService getThemeService() {
077                    return themeService;
078            }
079    
080            /**
081             * Sets the theme remote service.
082             *
083             * @param themeService the theme remote service
084             */
085            public void setThemeService(ThemeService themeService) {
086                    this.themeService = themeService;
087            }
088    
089            /**
090             * Returns the counter local service.
091             *
092             * @return the counter local service
093             */
094            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
095                    return counterLocalService;
096            }
097    
098            /**
099             * Sets the counter local service.
100             *
101             * @param counterLocalService the counter local service
102             */
103            public void setCounterLocalService(
104                    com.liferay.counter.service.CounterLocalService counterLocalService) {
105                    this.counterLocalService = counterLocalService;
106            }
107    
108            /**
109             * Returns the layout template local service.
110             *
111             * @return the layout template local service
112             */
113            public com.liferay.portal.service.LayoutTemplateLocalService getLayoutTemplateLocalService() {
114                    return layoutTemplateLocalService;
115            }
116    
117            /**
118             * Sets the layout template local service.
119             *
120             * @param layoutTemplateLocalService the layout template local service
121             */
122            public void setLayoutTemplateLocalService(
123                    com.liferay.portal.service.LayoutTemplateLocalService layoutTemplateLocalService) {
124                    this.layoutTemplateLocalService = layoutTemplateLocalService;
125            }
126    
127            /**
128             * Returns the plugin setting local service.
129             *
130             * @return the plugin setting local service
131             */
132            public com.liferay.portal.service.PluginSettingLocalService getPluginSettingLocalService() {
133                    return pluginSettingLocalService;
134            }
135    
136            /**
137             * Sets the plugin setting local service.
138             *
139             * @param pluginSettingLocalService the plugin setting local service
140             */
141            public void setPluginSettingLocalService(
142                    com.liferay.portal.service.PluginSettingLocalService pluginSettingLocalService) {
143                    this.pluginSettingLocalService = pluginSettingLocalService;
144            }
145    
146            /**
147             * Returns the plugin setting remote service.
148             *
149             * @return the plugin setting remote service
150             */
151            public com.liferay.portal.service.PluginSettingService getPluginSettingService() {
152                    return pluginSettingService;
153            }
154    
155            /**
156             * Sets the plugin setting remote service.
157             *
158             * @param pluginSettingService the plugin setting remote service
159             */
160            public void setPluginSettingService(
161                    com.liferay.portal.service.PluginSettingService pluginSettingService) {
162                    this.pluginSettingService = pluginSettingService;
163            }
164    
165            /**
166             * Returns the plugin setting persistence.
167             *
168             * @return the plugin setting persistence
169             */
170            public PluginSettingPersistence getPluginSettingPersistence() {
171                    return pluginSettingPersistence;
172            }
173    
174            /**
175             * Sets the plugin setting persistence.
176             *
177             * @param pluginSettingPersistence the plugin setting persistence
178             */
179            public void setPluginSettingPersistence(
180                    PluginSettingPersistence pluginSettingPersistence) {
181                    this.pluginSettingPersistence = pluginSettingPersistence;
182            }
183    
184            public void afterPropertiesSet() {
185            }
186    
187            public void destroy() {
188            }
189    
190            /**
191             * Returns the OSGi service identifier.
192             *
193             * @return the OSGi service identifier
194             */
195            @Override
196            public String getOSGiServiceIdentifier() {
197                    return ThemeService.class.getName();
198            }
199    
200            /**
201             * Performs a SQL query.
202             *
203             * @param sql the sql query
204             */
205            protected void runSQL(String sql) {
206                    try {
207                            DataSource dataSource = InfrastructureUtil.getDataSource();
208    
209                            DB db = DBManagerUtil.getDB();
210    
211                            sql = db.buildSQL(sql);
212                            sql = PortalUtil.transformSQL(sql);
213    
214                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
215                                            sql, new int[0]);
216    
217                            sqlUpdate.update();
218                    }
219                    catch (Exception e) {
220                            throw new SystemException(e);
221                    }
222            }
223    
224            @BeanReference(type = com.liferay.portal.service.ThemeLocalService.class)
225            protected com.liferay.portal.service.ThemeLocalService themeLocalService;
226            @BeanReference(type = com.liferay.portal.service.ThemeService.class)
227            protected ThemeService themeService;
228            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
229            protected com.liferay.counter.service.CounterLocalService counterLocalService;
230            @BeanReference(type = com.liferay.portal.service.LayoutTemplateLocalService.class)
231            protected com.liferay.portal.service.LayoutTemplateLocalService layoutTemplateLocalService;
232            @BeanReference(type = com.liferay.portal.service.PluginSettingLocalService.class)
233            protected com.liferay.portal.service.PluginSettingLocalService pluginSettingLocalService;
234            @BeanReference(type = com.liferay.portal.service.PluginSettingService.class)
235            protected com.liferay.portal.service.PluginSettingService pluginSettingService;
236            @BeanReference(type = PluginSettingPersistence.class)
237            protected PluginSettingPersistence pluginSettingPersistence;
238    }