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.model.Portlet;
025    import com.liferay.portal.service.BaseServiceImpl;
026    import com.liferay.portal.service.PortletService;
027    import com.liferay.portal.service.persistence.PortletPersistence;
028    import com.liferay.portal.service.persistence.PortletPreferencesFinder;
029    import com.liferay.portal.service.persistence.PortletPreferencesPersistence;
030    import com.liferay.portal.service.persistence.ResourceActionPersistence;
031    import com.liferay.portal.service.persistence.ResourceBlockFinder;
032    import com.liferay.portal.service.persistence.ResourceBlockPersistence;
033    import com.liferay.portal.service.persistence.ResourcePermissionFinder;
034    import com.liferay.portal.service.persistence.ResourcePermissionPersistence;
035    import com.liferay.portal.service.persistence.RoleFinder;
036    import com.liferay.portal.service.persistence.RolePersistence;
037    import com.liferay.portal.util.PortalUtil;
038    
039    import javax.sql.DataSource;
040    
041    /**
042     * Provides the base implementation for the portlet remote service.
043     *
044     * <p>
045     * 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.PortletServiceImpl}.
046     * </p>
047     *
048     * @author Brian Wing Shun Chan
049     * @see com.liferay.portal.service.impl.PortletServiceImpl
050     * @see com.liferay.portal.service.PortletServiceUtil
051     * @generated
052     */
053    public abstract class PortletServiceBaseImpl extends BaseServiceImpl
054            implements PortletService, IdentifiableOSGiService {
055            /*
056             * NOTE FOR DEVELOPERS:
057             *
058             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.PortletServiceUtil} to access the portlet remote service.
059             */
060    
061            /**
062             * Returns the portlet local service.
063             *
064             * @return the portlet local service
065             */
066            public com.liferay.portal.service.PortletLocalService getPortletLocalService() {
067                    return portletLocalService;
068            }
069    
070            /**
071             * Sets the portlet local service.
072             *
073             * @param portletLocalService the portlet local service
074             */
075            public void setPortletLocalService(
076                    com.liferay.portal.service.PortletLocalService portletLocalService) {
077                    this.portletLocalService = portletLocalService;
078            }
079    
080            /**
081             * Returns the portlet remote service.
082             *
083             * @return the portlet remote service
084             */
085            public PortletService getPortletService() {
086                    return portletService;
087            }
088    
089            /**
090             * Sets the portlet remote service.
091             *
092             * @param portletService the portlet remote service
093             */
094            public void setPortletService(PortletService portletService) {
095                    this.portletService = portletService;
096            }
097    
098            /**
099             * Returns the portlet persistence.
100             *
101             * @return the portlet persistence
102             */
103            public PortletPersistence getPortletPersistence() {
104                    return portletPersistence;
105            }
106    
107            /**
108             * Sets the portlet persistence.
109             *
110             * @param portletPersistence the portlet persistence
111             */
112            public void setPortletPersistence(PortletPersistence portletPersistence) {
113                    this.portletPersistence = portletPersistence;
114            }
115    
116            /**
117             * Returns the counter local service.
118             *
119             * @return the counter local service
120             */
121            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
122                    return counterLocalService;
123            }
124    
125            /**
126             * Sets the counter local service.
127             *
128             * @param counterLocalService the counter local service
129             */
130            public void setCounterLocalService(
131                    com.liferay.counter.service.CounterLocalService counterLocalService) {
132                    this.counterLocalService = counterLocalService;
133            }
134    
135            /**
136             * Returns the portlet preferences local service.
137             *
138             * @return the portlet preferences local service
139             */
140            public com.liferay.portal.service.PortletPreferencesLocalService getPortletPreferencesLocalService() {
141                    return portletPreferencesLocalService;
142            }
143    
144            /**
145             * Sets the portlet preferences local service.
146             *
147             * @param portletPreferencesLocalService the portlet preferences local service
148             */
149            public void setPortletPreferencesLocalService(
150                    com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService) {
151                    this.portletPreferencesLocalService = portletPreferencesLocalService;
152            }
153    
154            /**
155             * Returns the portlet preferences remote service.
156             *
157             * @return the portlet preferences remote service
158             */
159            public com.liferay.portal.service.PortletPreferencesService getPortletPreferencesService() {
160                    return portletPreferencesService;
161            }
162    
163            /**
164             * Sets the portlet preferences remote service.
165             *
166             * @param portletPreferencesService the portlet preferences remote service
167             */
168            public void setPortletPreferencesService(
169                    com.liferay.portal.service.PortletPreferencesService portletPreferencesService) {
170                    this.portletPreferencesService = portletPreferencesService;
171            }
172    
173            /**
174             * Returns the portlet preferences persistence.
175             *
176             * @return the portlet preferences persistence
177             */
178            public PortletPreferencesPersistence getPortletPreferencesPersistence() {
179                    return portletPreferencesPersistence;
180            }
181    
182            /**
183             * Sets the portlet preferences persistence.
184             *
185             * @param portletPreferencesPersistence the portlet preferences persistence
186             */
187            public void setPortletPreferencesPersistence(
188                    PortletPreferencesPersistence portletPreferencesPersistence) {
189                    this.portletPreferencesPersistence = portletPreferencesPersistence;
190            }
191    
192            /**
193             * Returns the portlet preferences finder.
194             *
195             * @return the portlet preferences finder
196             */
197            public PortletPreferencesFinder getPortletPreferencesFinder() {
198                    return portletPreferencesFinder;
199            }
200    
201            /**
202             * Sets the portlet preferences finder.
203             *
204             * @param portletPreferencesFinder the portlet preferences finder
205             */
206            public void setPortletPreferencesFinder(
207                    PortletPreferencesFinder portletPreferencesFinder) {
208                    this.portletPreferencesFinder = portletPreferencesFinder;
209            }
210    
211            /**
212             * Returns the resource local service.
213             *
214             * @return the resource local service
215             */
216            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
217                    return resourceLocalService;
218            }
219    
220            /**
221             * Sets the resource local service.
222             *
223             * @param resourceLocalService the resource local service
224             */
225            public void setResourceLocalService(
226                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
227                    this.resourceLocalService = resourceLocalService;
228            }
229    
230            /**
231             * Returns the resource action local service.
232             *
233             * @return the resource action local service
234             */
235            public com.liferay.portal.service.ResourceActionLocalService getResourceActionLocalService() {
236                    return resourceActionLocalService;
237            }
238    
239            /**
240             * Sets the resource action local service.
241             *
242             * @param resourceActionLocalService the resource action local service
243             */
244            public void setResourceActionLocalService(
245                    com.liferay.portal.service.ResourceActionLocalService resourceActionLocalService) {
246                    this.resourceActionLocalService = resourceActionLocalService;
247            }
248    
249            /**
250             * Returns the resource action persistence.
251             *
252             * @return the resource action persistence
253             */
254            public ResourceActionPersistence getResourceActionPersistence() {
255                    return resourceActionPersistence;
256            }
257    
258            /**
259             * Sets the resource action persistence.
260             *
261             * @param resourceActionPersistence the resource action persistence
262             */
263            public void setResourceActionPersistence(
264                    ResourceActionPersistence resourceActionPersistence) {
265                    this.resourceActionPersistence = resourceActionPersistence;
266            }
267    
268            /**
269             * Returns the resource block local service.
270             *
271             * @return the resource block local service
272             */
273            public com.liferay.portal.service.ResourceBlockLocalService getResourceBlockLocalService() {
274                    return resourceBlockLocalService;
275            }
276    
277            /**
278             * Sets the resource block local service.
279             *
280             * @param resourceBlockLocalService the resource block local service
281             */
282            public void setResourceBlockLocalService(
283                    com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService) {
284                    this.resourceBlockLocalService = resourceBlockLocalService;
285            }
286    
287            /**
288             * Returns the resource block remote service.
289             *
290             * @return the resource block remote service
291             */
292            public com.liferay.portal.service.ResourceBlockService getResourceBlockService() {
293                    return resourceBlockService;
294            }
295    
296            /**
297             * Sets the resource block remote service.
298             *
299             * @param resourceBlockService the resource block remote service
300             */
301            public void setResourceBlockService(
302                    com.liferay.portal.service.ResourceBlockService resourceBlockService) {
303                    this.resourceBlockService = resourceBlockService;
304            }
305    
306            /**
307             * Returns the resource block persistence.
308             *
309             * @return the resource block persistence
310             */
311            public ResourceBlockPersistence getResourceBlockPersistence() {
312                    return resourceBlockPersistence;
313            }
314    
315            /**
316             * Sets the resource block persistence.
317             *
318             * @param resourceBlockPersistence the resource block persistence
319             */
320            public void setResourceBlockPersistence(
321                    ResourceBlockPersistence resourceBlockPersistence) {
322                    this.resourceBlockPersistence = resourceBlockPersistence;
323            }
324    
325            /**
326             * Returns the resource block finder.
327             *
328             * @return the resource block finder
329             */
330            public ResourceBlockFinder getResourceBlockFinder() {
331                    return resourceBlockFinder;
332            }
333    
334            /**
335             * Sets the resource block finder.
336             *
337             * @param resourceBlockFinder the resource block finder
338             */
339            public void setResourceBlockFinder(ResourceBlockFinder resourceBlockFinder) {
340                    this.resourceBlockFinder = resourceBlockFinder;
341            }
342    
343            /**
344             * Returns the resource permission local service.
345             *
346             * @return the resource permission local service
347             */
348            public com.liferay.portal.service.ResourcePermissionLocalService getResourcePermissionLocalService() {
349                    return resourcePermissionLocalService;
350            }
351    
352            /**
353             * Sets the resource permission local service.
354             *
355             * @param resourcePermissionLocalService the resource permission local service
356             */
357            public void setResourcePermissionLocalService(
358                    com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService) {
359                    this.resourcePermissionLocalService = resourcePermissionLocalService;
360            }
361    
362            /**
363             * Returns the resource permission remote service.
364             *
365             * @return the resource permission remote service
366             */
367            public com.liferay.portal.service.ResourcePermissionService getResourcePermissionService() {
368                    return resourcePermissionService;
369            }
370    
371            /**
372             * Sets the resource permission remote service.
373             *
374             * @param resourcePermissionService the resource permission remote service
375             */
376            public void setResourcePermissionService(
377                    com.liferay.portal.service.ResourcePermissionService resourcePermissionService) {
378                    this.resourcePermissionService = resourcePermissionService;
379            }
380    
381            /**
382             * Returns the resource permission persistence.
383             *
384             * @return the resource permission persistence
385             */
386            public ResourcePermissionPersistence getResourcePermissionPersistence() {
387                    return resourcePermissionPersistence;
388            }
389    
390            /**
391             * Sets the resource permission persistence.
392             *
393             * @param resourcePermissionPersistence the resource permission persistence
394             */
395            public void setResourcePermissionPersistence(
396                    ResourcePermissionPersistence resourcePermissionPersistence) {
397                    this.resourcePermissionPersistence = resourcePermissionPersistence;
398            }
399    
400            /**
401             * Returns the resource permission finder.
402             *
403             * @return the resource permission finder
404             */
405            public ResourcePermissionFinder getResourcePermissionFinder() {
406                    return resourcePermissionFinder;
407            }
408    
409            /**
410             * Sets the resource permission finder.
411             *
412             * @param resourcePermissionFinder the resource permission finder
413             */
414            public void setResourcePermissionFinder(
415                    ResourcePermissionFinder resourcePermissionFinder) {
416                    this.resourcePermissionFinder = resourcePermissionFinder;
417            }
418    
419            /**
420             * Returns the role local service.
421             *
422             * @return the role local service
423             */
424            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
425                    return roleLocalService;
426            }
427    
428            /**
429             * Sets the role local service.
430             *
431             * @param roleLocalService the role local service
432             */
433            public void setRoleLocalService(
434                    com.liferay.portal.service.RoleLocalService roleLocalService) {
435                    this.roleLocalService = roleLocalService;
436            }
437    
438            /**
439             * Returns the role remote service.
440             *
441             * @return the role remote service
442             */
443            public com.liferay.portal.service.RoleService getRoleService() {
444                    return roleService;
445            }
446    
447            /**
448             * Sets the role remote service.
449             *
450             * @param roleService the role remote service
451             */
452            public void setRoleService(
453                    com.liferay.portal.service.RoleService roleService) {
454                    this.roleService = roleService;
455            }
456    
457            /**
458             * Returns the role persistence.
459             *
460             * @return the role persistence
461             */
462            public RolePersistence getRolePersistence() {
463                    return rolePersistence;
464            }
465    
466            /**
467             * Sets the role persistence.
468             *
469             * @param rolePersistence the role persistence
470             */
471            public void setRolePersistence(RolePersistence rolePersistence) {
472                    this.rolePersistence = rolePersistence;
473            }
474    
475            /**
476             * Returns the role finder.
477             *
478             * @return the role finder
479             */
480            public RoleFinder getRoleFinder() {
481                    return roleFinder;
482            }
483    
484            /**
485             * Sets the role finder.
486             *
487             * @param roleFinder the role finder
488             */
489            public void setRoleFinder(RoleFinder roleFinder) {
490                    this.roleFinder = roleFinder;
491            }
492    
493            public void afterPropertiesSet() {
494            }
495    
496            public void destroy() {
497            }
498    
499            /**
500             * Returns the OSGi service identifier.
501             *
502             * @return the OSGi service identifier
503             */
504            @Override
505            public String getOSGiServiceIdentifier() {
506                    return PortletService.class.getName();
507            }
508    
509            protected Class<?> getModelClass() {
510                    return Portlet.class;
511            }
512    
513            protected String getModelClassName() {
514                    return Portlet.class.getName();
515            }
516    
517            /**
518             * Performs a SQL query.
519             *
520             * @param sql the sql query
521             */
522            protected void runSQL(String sql) {
523                    try {
524                            DataSource dataSource = portletPersistence.getDataSource();
525    
526                            DB db = DBManagerUtil.getDB();
527    
528                            sql = db.buildSQL(sql);
529                            sql = PortalUtil.transformSQL(sql);
530    
531                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
532                                            sql, new int[0]);
533    
534                            sqlUpdate.update();
535                    }
536                    catch (Exception e) {
537                            throw new SystemException(e);
538                    }
539            }
540    
541            @BeanReference(type = com.liferay.portal.service.PortletLocalService.class)
542            protected com.liferay.portal.service.PortletLocalService portletLocalService;
543            @BeanReference(type = com.liferay.portal.service.PortletService.class)
544            protected PortletService portletService;
545            @BeanReference(type = PortletPersistence.class)
546            protected PortletPersistence portletPersistence;
547            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
548            protected com.liferay.counter.service.CounterLocalService counterLocalService;
549            @BeanReference(type = com.liferay.portal.service.PortletPreferencesLocalService.class)
550            protected com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService;
551            @BeanReference(type = com.liferay.portal.service.PortletPreferencesService.class)
552            protected com.liferay.portal.service.PortletPreferencesService portletPreferencesService;
553            @BeanReference(type = PortletPreferencesPersistence.class)
554            protected PortletPreferencesPersistence portletPreferencesPersistence;
555            @BeanReference(type = PortletPreferencesFinder.class)
556            protected PortletPreferencesFinder portletPreferencesFinder;
557            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
558            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
559            @BeanReference(type = com.liferay.portal.service.ResourceActionLocalService.class)
560            protected com.liferay.portal.service.ResourceActionLocalService resourceActionLocalService;
561            @BeanReference(type = ResourceActionPersistence.class)
562            protected ResourceActionPersistence resourceActionPersistence;
563            @BeanReference(type = com.liferay.portal.service.ResourceBlockLocalService.class)
564            protected com.liferay.portal.service.ResourceBlockLocalService resourceBlockLocalService;
565            @BeanReference(type = com.liferay.portal.service.ResourceBlockService.class)
566            protected com.liferay.portal.service.ResourceBlockService resourceBlockService;
567            @BeanReference(type = ResourceBlockPersistence.class)
568            protected ResourceBlockPersistence resourceBlockPersistence;
569            @BeanReference(type = ResourceBlockFinder.class)
570            protected ResourceBlockFinder resourceBlockFinder;
571            @BeanReference(type = com.liferay.portal.service.ResourcePermissionLocalService.class)
572            protected com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService;
573            @BeanReference(type = com.liferay.portal.service.ResourcePermissionService.class)
574            protected com.liferay.portal.service.ResourcePermissionService resourcePermissionService;
575            @BeanReference(type = ResourcePermissionPersistence.class)
576            protected ResourcePermissionPersistence resourcePermissionPersistence;
577            @BeanReference(type = ResourcePermissionFinder.class)
578            protected ResourcePermissionFinder resourcePermissionFinder;
579            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
580            protected com.liferay.portal.service.RoleLocalService roleLocalService;
581            @BeanReference(type = com.liferay.portal.service.RoleService.class)
582            protected com.liferay.portal.service.RoleService roleService;
583            @BeanReference(type = RolePersistence.class)
584            protected RolePersistence rolePersistence;
585            @BeanReference(type = RoleFinder.class)
586            protected RoleFinder roleFinder;
587    }