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.DBManagerUtil;
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 persistence.
115             *
116             * @return the plugin setting persistence
117             */
118            public PluginSettingPersistence getPluginSettingPersistence() {
119                    return pluginSettingPersistence;
120            }
121    
122            /**
123             * Sets the plugin setting persistence.
124             *
125             * @param pluginSettingPersistence the plugin setting persistence
126             */
127            public void setPluginSettingPersistence(
128                    PluginSettingPersistence pluginSettingPersistence) {
129                    this.pluginSettingPersistence = pluginSettingPersistence;
130            }
131    
132            public void afterPropertiesSet() {
133            }
134    
135            public void destroy() {
136            }
137    
138            /**
139             * Returns the OSGi service identifier.
140             *
141             * @return the OSGi service identifier
142             */
143            @Override
144            public String getOSGiServiceIdentifier() {
145                    return LayoutTemplateLocalService.class.getName();
146            }
147    
148            /**
149             * Performs a SQL query.
150             *
151             * @param sql the sql query
152             */
153            protected void runSQL(String sql) {
154                    try {
155                            DataSource dataSource = InfrastructureUtil.getDataSource();
156    
157                            DB db = DBManagerUtil.getDB();
158    
159                            sql = db.buildSQL(sql);
160                            sql = PortalUtil.transformSQL(sql);
161    
162                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
163                                            sql, new int[0]);
164    
165                            sqlUpdate.update();
166                    }
167                    catch (Exception e) {
168                            throw new SystemException(e);
169                    }
170            }
171    
172            @BeanReference(type = com.liferay.portal.service.LayoutTemplateLocalService.class)
173            protected LayoutTemplateLocalService layoutTemplateLocalService;
174            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
175            protected com.liferay.counter.service.CounterLocalService counterLocalService;
176            @BeanReference(type = com.liferay.portal.service.PluginSettingLocalService.class)
177            protected com.liferay.portal.service.PluginSettingLocalService pluginSettingLocalService;
178            @BeanReference(type = PluginSettingPersistence.class)
179            protected PluginSettingPersistence pluginSettingPersistence;
180    }