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