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.PortalService;
027    import com.liferay.portal.service.persistence.ClassNamePersistence;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import javax.sql.DataSource;
031    
032    /**
033     * Provides the base implementation for the portal 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.PortalServiceImpl}.
037     * </p>
038     *
039     * @author Brian Wing Shun Chan
040     * @see com.liferay.portal.service.impl.PortalServiceImpl
041     * @see com.liferay.portal.service.PortalServiceUtil
042     * @generated
043     */
044    public abstract class PortalServiceBaseImpl extends BaseServiceImpl
045            implements PortalService, IdentifiableOSGiService {
046            /*
047             * NOTE FOR DEVELOPERS:
048             *
049             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.PortalServiceUtil} to access the portal remote service.
050             */
051    
052            /**
053             * Returns the portal local service.
054             *
055             * @return the portal local service
056             */
057            public com.liferay.portal.service.PortalLocalService getPortalLocalService() {
058                    return portalLocalService;
059            }
060    
061            /**
062             * Sets the portal local service.
063             *
064             * @param portalLocalService the portal local service
065             */
066            public void setPortalLocalService(
067                    com.liferay.portal.service.PortalLocalService portalLocalService) {
068                    this.portalLocalService = portalLocalService;
069            }
070    
071            /**
072             * Returns the portal remote service.
073             *
074             * @return the portal remote service
075             */
076            public PortalService getPortalService() {
077                    return portalService;
078            }
079    
080            /**
081             * Sets the portal remote service.
082             *
083             * @param portalService the portal remote service
084             */
085            public void setPortalService(PortalService portalService) {
086                    this.portalService = portalService;
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 class name local service.
110             *
111             * @return the class name local service
112             */
113            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
114                    return classNameLocalService;
115            }
116    
117            /**
118             * Sets the class name local service.
119             *
120             * @param classNameLocalService the class name local service
121             */
122            public void setClassNameLocalService(
123                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
124                    this.classNameLocalService = classNameLocalService;
125            }
126    
127            /**
128             * Returns the class name remote service.
129             *
130             * @return the class name remote service
131             */
132            public com.liferay.portal.service.ClassNameService getClassNameService() {
133                    return classNameService;
134            }
135    
136            /**
137             * Sets the class name remote service.
138             *
139             * @param classNameService the class name remote service
140             */
141            public void setClassNameService(
142                    com.liferay.portal.service.ClassNameService classNameService) {
143                    this.classNameService = classNameService;
144            }
145    
146            /**
147             * Returns the class name persistence.
148             *
149             * @return the class name persistence
150             */
151            public ClassNamePersistence getClassNamePersistence() {
152                    return classNamePersistence;
153            }
154    
155            /**
156             * Sets the class name persistence.
157             *
158             * @param classNamePersistence the class name persistence
159             */
160            public void setClassNamePersistence(
161                    ClassNamePersistence classNamePersistence) {
162                    this.classNamePersistence = classNamePersistence;
163            }
164    
165            public void afterPropertiesSet() {
166            }
167    
168            public void destroy() {
169            }
170    
171            /**
172             * Returns the OSGi service identifier.
173             *
174             * @return the OSGi service identifier
175             */
176            @Override
177            public String getOSGiServiceIdentifier() {
178                    return PortalService.class.getName();
179            }
180    
181            /**
182             * Performs a SQL query.
183             *
184             * @param sql the sql query
185             */
186            protected void runSQL(String sql) {
187                    try {
188                            DataSource dataSource = InfrastructureUtil.getDataSource();
189    
190                            DB db = DBManagerUtil.getDB();
191    
192                            sql = db.buildSQL(sql);
193                            sql = PortalUtil.transformSQL(sql);
194    
195                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
196                                            sql, new int[0]);
197    
198                            sqlUpdate.update();
199                    }
200                    catch (Exception e) {
201                            throw new SystemException(e);
202                    }
203            }
204    
205            @BeanReference(type = com.liferay.portal.service.PortalLocalService.class)
206            protected com.liferay.portal.service.PortalLocalService portalLocalService;
207            @BeanReference(type = com.liferay.portal.service.PortalService.class)
208            protected PortalService portalService;
209            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
210            protected com.liferay.counter.service.CounterLocalService counterLocalService;
211            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
212            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
213            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
214            protected com.liferay.portal.service.ClassNameService classNameService;
215            @BeanReference(type = ClassNamePersistence.class)
216            protected ClassNamePersistence classNamePersistence;
217    }