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.portlet.documentlibrary.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.util.PortalUtil;
027    
028    import com.liferay.portlet.documentlibrary.service.DLTrashService;
029    
030    import javax.sql.DataSource;
031    
032    /**
033     * Provides the base implementation for the d l trash 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.portlet.documentlibrary.service.impl.DLTrashServiceImpl}.
037     * </p>
038     *
039     * @author Brian Wing Shun Chan
040     * @see com.liferay.portlet.documentlibrary.service.impl.DLTrashServiceImpl
041     * @see com.liferay.portlet.documentlibrary.service.DLTrashServiceUtil
042     * @generated
043     */
044    public abstract class DLTrashServiceBaseImpl extends BaseServiceImpl
045            implements DLTrashService, IdentifiableOSGiService {
046            /*
047             * NOTE FOR DEVELOPERS:
048             *
049             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.documentlibrary.service.DLTrashServiceUtil} to access the d l trash remote service.
050             */
051    
052            /**
053             * Returns the d l trash local service.
054             *
055             * @return the d l trash local service
056             */
057            public com.liferay.portlet.documentlibrary.service.DLTrashLocalService getDLTrashLocalService() {
058                    return dlTrashLocalService;
059            }
060    
061            /**
062             * Sets the d l trash local service.
063             *
064             * @param dlTrashLocalService the d l trash local service
065             */
066            public void setDLTrashLocalService(
067                    com.liferay.portlet.documentlibrary.service.DLTrashLocalService dlTrashLocalService) {
068                    this.dlTrashLocalService = dlTrashLocalService;
069            }
070    
071            /**
072             * Returns the d l trash remote service.
073             *
074             * @return the d l trash remote service
075             */
076            public DLTrashService getDLTrashService() {
077                    return dlTrashService;
078            }
079    
080            /**
081             * Sets the d l trash remote service.
082             *
083             * @param dlTrashService the d l trash remote service
084             */
085            public void setDLTrashService(DLTrashService dlTrashService) {
086                    this.dlTrashService = dlTrashService;
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 d l app helper local service.
110             *
111             * @return the d l app helper local service
112             */
113            public com.liferay.portlet.documentlibrary.service.DLAppHelperLocalService getDLAppHelperLocalService() {
114                    return dlAppHelperLocalService;
115            }
116    
117            /**
118             * Sets the d l app helper local service.
119             *
120             * @param dlAppHelperLocalService the d l app helper local service
121             */
122            public void setDLAppHelperLocalService(
123                    com.liferay.portlet.documentlibrary.service.DLAppHelperLocalService dlAppHelperLocalService) {
124                    this.dlAppHelperLocalService = dlAppHelperLocalService;
125            }
126    
127            public void afterPropertiesSet() {
128            }
129    
130            public void destroy() {
131            }
132    
133            /**
134             * Returns the OSGi service identifier.
135             *
136             * @return the OSGi service identifier
137             */
138            @Override
139            public String getOSGiServiceIdentifier() {
140                    return DLTrashService.class.getName();
141            }
142    
143            /**
144             * Performs a SQL query.
145             *
146             * @param sql the sql query
147             */
148            protected void runSQL(String sql) {
149                    try {
150                            DataSource dataSource = InfrastructureUtil.getDataSource();
151    
152                            DB db = DBManagerUtil.getDB();
153    
154                            sql = db.buildSQL(sql);
155                            sql = PortalUtil.transformSQL(sql);
156    
157                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
158                                            sql, new int[0]);
159    
160                            sqlUpdate.update();
161                    }
162                    catch (Exception e) {
163                            throw new SystemException(e);
164                    }
165            }
166    
167            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLTrashLocalService.class)
168            protected com.liferay.portlet.documentlibrary.service.DLTrashLocalService dlTrashLocalService;
169            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLTrashService.class)
170            protected DLTrashService dlTrashService;
171            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
172            protected com.liferay.counter.service.CounterLocalService counterLocalService;
173            @BeanReference(type = com.liferay.portlet.documentlibrary.service.DLAppHelperLocalService.class)
174            protected com.liferay.portlet.documentlibrary.service.DLAppHelperLocalService dlAppHelperLocalService;
175    }