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.wiki.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.dao.orm.Property;
032    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
033    import com.liferay.portal.kernel.exception.PortalException;
034    import com.liferay.portal.kernel.exception.SystemException;
035    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
036    import com.liferay.portal.kernel.lar.ManifestSummary;
037    import com.liferay.portal.kernel.lar.PortletDataContext;
038    import com.liferay.portal.kernel.lar.StagedModelDataHandler;
039    import com.liferay.portal.kernel.lar.StagedModelDataHandlerRegistryUtil;
040    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
041    import com.liferay.portal.kernel.lar.StagedModelType;
042    import com.liferay.portal.kernel.search.Indexable;
043    import com.liferay.portal.kernel.search.IndexableType;
044    import com.liferay.portal.kernel.util.OrderByComparator;
045    import com.liferay.portal.model.PersistedModel;
046    import com.liferay.portal.service.BaseLocalServiceImpl;
047    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
048    import com.liferay.portal.service.persistence.GroupFinder;
049    import com.liferay.portal.service.persistence.GroupPersistence;
050    import com.liferay.portal.service.persistence.SubscriptionPersistence;
051    import com.liferay.portal.service.persistence.SystemEventPersistence;
052    import com.liferay.portal.service.persistence.UserFinder;
053    import com.liferay.portal.service.persistence.UserPersistence;
054    import com.liferay.portal.service.persistence.WorkflowInstanceLinkPersistence;
055    import com.liferay.portal.util.PortalUtil;
056    
057    import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
058    import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
059    import com.liferay.portlet.trash.service.persistence.TrashEntryPersistence;
060    import com.liferay.portlet.trash.service.persistence.TrashVersionPersistence;
061    import com.liferay.portlet.wiki.model.WikiNode;
062    import com.liferay.portlet.wiki.service.WikiNodeLocalService;
063    import com.liferay.portlet.wiki.service.persistence.WikiNodePersistence;
064    import com.liferay.portlet.wiki.service.persistence.WikiPageFinder;
065    import com.liferay.portlet.wiki.service.persistence.WikiPagePersistence;
066    
067    import java.io.Serializable;
068    
069    import java.util.List;
070    
071    import javax.sql.DataSource;
072    
073    /**
074     * Provides the base implementation for the wiki node local service.
075     *
076     * <p>
077     * 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.wiki.service.impl.WikiNodeLocalServiceImpl}.
078     * </p>
079     *
080     * @author Brian Wing Shun Chan
081     * @see com.liferay.portlet.wiki.service.impl.WikiNodeLocalServiceImpl
082     * @see com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil
083     * @generated
084     */
085    @ProviderType
086    public abstract class WikiNodeLocalServiceBaseImpl extends BaseLocalServiceImpl
087            implements WikiNodeLocalService, IdentifiableBean {
088            /*
089             * NOTE FOR DEVELOPERS:
090             *
091             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil} to access the wiki node local service.
092             */
093    
094            /**
095             * Adds the wiki node to the database. Also notifies the appropriate model listeners.
096             *
097             * @param wikiNode the wiki node
098             * @return the wiki node that was added
099             */
100            @Indexable(type = IndexableType.REINDEX)
101            @Override
102            public WikiNode addWikiNode(WikiNode wikiNode) {
103                    wikiNode.setNew(true);
104    
105                    return wikiNodePersistence.update(wikiNode);
106            }
107    
108            /**
109             * Creates a new wiki node with the primary key. Does not add the wiki node to the database.
110             *
111             * @param nodeId the primary key for the new wiki node
112             * @return the new wiki node
113             */
114            @Override
115            public WikiNode createWikiNode(long nodeId) {
116                    return wikiNodePersistence.create(nodeId);
117            }
118    
119            /**
120             * Deletes the wiki node with the primary key from the database. Also notifies the appropriate model listeners.
121             *
122             * @param nodeId the primary key of the wiki node
123             * @return the wiki node that was removed
124             * @throws PortalException if a wiki node with the primary key could not be found
125             */
126            @Indexable(type = IndexableType.DELETE)
127            @Override
128            public WikiNode deleteWikiNode(long nodeId) throws PortalException {
129                    return wikiNodePersistence.remove(nodeId);
130            }
131    
132            /**
133             * Deletes the wiki node from the database. Also notifies the appropriate model listeners.
134             *
135             * @param wikiNode the wiki node
136             * @return the wiki node that was removed
137             */
138            @Indexable(type = IndexableType.DELETE)
139            @Override
140            public WikiNode deleteWikiNode(WikiNode wikiNode) {
141                    return wikiNodePersistence.remove(wikiNode);
142            }
143    
144            @Override
145            public DynamicQuery dynamicQuery() {
146                    Class<?> clazz = getClass();
147    
148                    return DynamicQueryFactoryUtil.forClass(WikiNode.class,
149                            clazz.getClassLoader());
150            }
151    
152            /**
153             * Performs a dynamic query on the database and returns the matching rows.
154             *
155             * @param dynamicQuery the dynamic query
156             * @return the matching rows
157             */
158            @Override
159            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
160                    return wikiNodePersistence.findWithDynamicQuery(dynamicQuery);
161            }
162    
163            /**
164             * Performs a dynamic query on the database and returns a range of the matching rows.
165             *
166             * <p>
167             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.wiki.model.impl.WikiNodeModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
168             * </p>
169             *
170             * @param dynamicQuery the dynamic query
171             * @param start the lower bound of the range of model instances
172             * @param end the upper bound of the range of model instances (not inclusive)
173             * @return the range of matching rows
174             */
175            @Override
176            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
177                    int end) {
178                    return wikiNodePersistence.findWithDynamicQuery(dynamicQuery, start, end);
179            }
180    
181            /**
182             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
183             *
184             * <p>
185             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.wiki.model.impl.WikiNodeModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
186             * </p>
187             *
188             * @param dynamicQuery the dynamic query
189             * @param start the lower bound of the range of model instances
190             * @param end the upper bound of the range of model instances (not inclusive)
191             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
192             * @return the ordered range of matching rows
193             */
194            @Override
195            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
196                    int end, OrderByComparator<T> orderByComparator) {
197                    return wikiNodePersistence.findWithDynamicQuery(dynamicQuery, start,
198                            end, orderByComparator);
199            }
200    
201            /**
202             * Returns the number of rows that match the dynamic query.
203             *
204             * @param dynamicQuery the dynamic query
205             * @return the number of rows that match the dynamic query
206             */
207            @Override
208            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
209                    return wikiNodePersistence.countWithDynamicQuery(dynamicQuery);
210            }
211    
212            /**
213             * Returns the number of rows that match the dynamic query.
214             *
215             * @param dynamicQuery the dynamic query
216             * @param projection the projection to apply to the query
217             * @return the number of rows that match the dynamic query
218             */
219            @Override
220            public long dynamicQueryCount(DynamicQuery dynamicQuery,
221                    Projection projection) {
222                    return wikiNodePersistence.countWithDynamicQuery(dynamicQuery,
223                            projection);
224            }
225    
226            @Override
227            public WikiNode fetchWikiNode(long nodeId) {
228                    return wikiNodePersistence.fetchByPrimaryKey(nodeId);
229            }
230    
231            /**
232             * Returns the wiki node matching the UUID and group.
233             *
234             * @param uuid the wiki node's UUID
235             * @param groupId the primary key of the group
236             * @return the matching wiki node, or <code>null</code> if a matching wiki node could not be found
237             */
238            @Override
239            public WikiNode fetchWikiNodeByUuidAndGroupId(String uuid, long groupId) {
240                    return wikiNodePersistence.fetchByUUID_G(uuid, groupId);
241            }
242    
243            /**
244             * Returns the wiki node with the primary key.
245             *
246             * @param nodeId the primary key of the wiki node
247             * @return the wiki node
248             * @throws PortalException if a wiki node with the primary key could not be found
249             */
250            @Override
251            public WikiNode getWikiNode(long nodeId) throws PortalException {
252                    return wikiNodePersistence.findByPrimaryKey(nodeId);
253            }
254    
255            @Override
256            public ActionableDynamicQuery getActionableDynamicQuery() {
257                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
258    
259                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil.getService());
260                    actionableDynamicQuery.setClass(WikiNode.class);
261                    actionableDynamicQuery.setClassLoader(getClassLoader());
262    
263                    actionableDynamicQuery.setPrimaryKeyPropertyName("nodeId");
264    
265                    return actionableDynamicQuery;
266            }
267    
268            protected void initActionableDynamicQuery(
269                    ActionableDynamicQuery actionableDynamicQuery) {
270                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil.getService());
271                    actionableDynamicQuery.setClass(WikiNode.class);
272                    actionableDynamicQuery.setClassLoader(getClassLoader());
273    
274                    actionableDynamicQuery.setPrimaryKeyPropertyName("nodeId");
275            }
276    
277            @Override
278            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
279                    final PortletDataContext portletDataContext) {
280                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
281                                    @Override
282                                    public long performCount() throws PortalException {
283                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
284    
285                                            StagedModelType stagedModelType = getStagedModelType();
286    
287                                            long modelAdditionCount = super.performCount();
288    
289                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
290                                                    modelAdditionCount);
291    
292                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
293                                                            stagedModelType);
294    
295                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
296                                                    modelDeletionCount);
297    
298                                            return modelAdditionCount;
299                                    }
300                            };
301    
302                    initActionableDynamicQuery(exportActionableDynamicQuery);
303    
304                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
305                                    @Override
306                                    public void addCriteria(DynamicQuery dynamicQuery) {
307                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
308                                                    "modifiedDate");
309    
310                                            StagedModelDataHandler<?> stagedModelDataHandler = StagedModelDataHandlerRegistryUtil.getStagedModelDataHandler(WikiNode.class.getName());
311    
312                                            Property workflowStatusProperty = PropertyFactoryUtil.forName(
313                                                            "status");
314    
315                                            dynamicQuery.add(workflowStatusProperty.in(
316                                                            stagedModelDataHandler.getExportableStatuses()));
317                                    }
318                            });
319    
320                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
321    
322                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
323    
324                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
325                                    @Override
326                                    public void performAction(Object object)
327                                            throws PortalException {
328                                            WikiNode stagedModel = (WikiNode)object;
329    
330                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
331                                                    stagedModel);
332                                    }
333                            });
334                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
335                                    PortalUtil.getClassNameId(WikiNode.class.getName())));
336    
337                    return exportActionableDynamicQuery;
338            }
339    
340            /**
341             * @throws PortalException
342             */
343            @Override
344            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
345                    throws PortalException {
346                    return wikiNodeLocalService.deleteWikiNode((WikiNode)persistedModel);
347            }
348    
349            @Override
350            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
351                    throws PortalException {
352                    return wikiNodePersistence.findByPrimaryKey(primaryKeyObj);
353            }
354    
355            @Override
356            public List<WikiNode> getWikiNodesByUuidAndCompanyId(String uuid,
357                    long companyId) {
358                    return wikiNodePersistence.findByUuid_C(uuid, companyId);
359            }
360    
361            @Override
362            public List<WikiNode> getWikiNodesByUuidAndCompanyId(String uuid,
363                    long companyId, int start, int end,
364                    OrderByComparator<WikiNode> orderByComparator) {
365                    return wikiNodePersistence.findByUuid_C(uuid, companyId, start, end,
366                            orderByComparator);
367            }
368    
369            /**
370             * Returns the wiki node matching the UUID and group.
371             *
372             * @param uuid the wiki node's UUID
373             * @param groupId the primary key of the group
374             * @return the matching wiki node
375             * @throws PortalException if a matching wiki node could not be found
376             */
377            @Override
378            public WikiNode getWikiNodeByUuidAndGroupId(String uuid, long groupId)
379                    throws PortalException {
380                    return wikiNodePersistence.findByUUID_G(uuid, groupId);
381            }
382    
383            /**
384             * Returns a range of all the wiki nodes.
385             *
386             * <p>
387             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.wiki.model.impl.WikiNodeModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
388             * </p>
389             *
390             * @param start the lower bound of the range of wiki nodes
391             * @param end the upper bound of the range of wiki nodes (not inclusive)
392             * @return the range of wiki nodes
393             */
394            @Override
395            public List<WikiNode> getWikiNodes(int start, int end) {
396                    return wikiNodePersistence.findAll(start, end);
397            }
398    
399            /**
400             * Returns the number of wiki nodes.
401             *
402             * @return the number of wiki nodes
403             */
404            @Override
405            public int getWikiNodesCount() {
406                    return wikiNodePersistence.countAll();
407            }
408    
409            /**
410             * Updates the wiki node in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
411             *
412             * @param wikiNode the wiki node
413             * @return the wiki node that was updated
414             */
415            @Indexable(type = IndexableType.REINDEX)
416            @Override
417            public WikiNode updateWikiNode(WikiNode wikiNode) {
418                    return wikiNodePersistence.update(wikiNode);
419            }
420    
421            /**
422             * Returns the wiki node local service.
423             *
424             * @return the wiki node local service
425             */
426            public com.liferay.portlet.wiki.service.WikiNodeLocalService getWikiNodeLocalService() {
427                    return wikiNodeLocalService;
428            }
429    
430            /**
431             * Sets the wiki node local service.
432             *
433             * @param wikiNodeLocalService the wiki node local service
434             */
435            public void setWikiNodeLocalService(
436                    com.liferay.portlet.wiki.service.WikiNodeLocalService wikiNodeLocalService) {
437                    this.wikiNodeLocalService = wikiNodeLocalService;
438            }
439    
440            /**
441             * Returns the wiki node remote service.
442             *
443             * @return the wiki node remote service
444             */
445            public com.liferay.portlet.wiki.service.WikiNodeService getWikiNodeService() {
446                    return wikiNodeService;
447            }
448    
449            /**
450             * Sets the wiki node remote service.
451             *
452             * @param wikiNodeService the wiki node remote service
453             */
454            public void setWikiNodeService(
455                    com.liferay.portlet.wiki.service.WikiNodeService wikiNodeService) {
456                    this.wikiNodeService = wikiNodeService;
457            }
458    
459            /**
460             * Returns the wiki node persistence.
461             *
462             * @return the wiki node persistence
463             */
464            public WikiNodePersistence getWikiNodePersistence() {
465                    return wikiNodePersistence;
466            }
467    
468            /**
469             * Sets the wiki node persistence.
470             *
471             * @param wikiNodePersistence the wiki node persistence
472             */
473            public void setWikiNodePersistence(WikiNodePersistence wikiNodePersistence) {
474                    this.wikiNodePersistence = wikiNodePersistence;
475            }
476    
477            /**
478             * Returns the counter local service.
479             *
480             * @return the counter local service
481             */
482            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
483                    return counterLocalService;
484            }
485    
486            /**
487             * Sets the counter local service.
488             *
489             * @param counterLocalService the counter local service
490             */
491            public void setCounterLocalService(
492                    com.liferay.counter.service.CounterLocalService counterLocalService) {
493                    this.counterLocalService = counterLocalService;
494            }
495    
496            /**
497             * Returns the group local service.
498             *
499             * @return the group local service
500             */
501            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
502                    return groupLocalService;
503            }
504    
505            /**
506             * Sets the group local service.
507             *
508             * @param groupLocalService the group local service
509             */
510            public void setGroupLocalService(
511                    com.liferay.portal.service.GroupLocalService groupLocalService) {
512                    this.groupLocalService = groupLocalService;
513            }
514    
515            /**
516             * Returns the group remote service.
517             *
518             * @return the group remote service
519             */
520            public com.liferay.portal.service.GroupService getGroupService() {
521                    return groupService;
522            }
523    
524            /**
525             * Sets the group remote service.
526             *
527             * @param groupService the group remote service
528             */
529            public void setGroupService(
530                    com.liferay.portal.service.GroupService groupService) {
531                    this.groupService = groupService;
532            }
533    
534            /**
535             * Returns the group persistence.
536             *
537             * @return the group persistence
538             */
539            public GroupPersistence getGroupPersistence() {
540                    return groupPersistence;
541            }
542    
543            /**
544             * Sets the group persistence.
545             *
546             * @param groupPersistence the group persistence
547             */
548            public void setGroupPersistence(GroupPersistence groupPersistence) {
549                    this.groupPersistence = groupPersistence;
550            }
551    
552            /**
553             * Returns the group finder.
554             *
555             * @return the group finder
556             */
557            public GroupFinder getGroupFinder() {
558                    return groupFinder;
559            }
560    
561            /**
562             * Sets the group finder.
563             *
564             * @param groupFinder the group finder
565             */
566            public void setGroupFinder(GroupFinder groupFinder) {
567                    this.groupFinder = groupFinder;
568            }
569    
570            /**
571             * Returns the resource local service.
572             *
573             * @return the resource local service
574             */
575            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
576                    return resourceLocalService;
577            }
578    
579            /**
580             * Sets the resource local service.
581             *
582             * @param resourceLocalService the resource local service
583             */
584            public void setResourceLocalService(
585                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
586                    this.resourceLocalService = resourceLocalService;
587            }
588    
589            /**
590             * Returns the subscription local service.
591             *
592             * @return the subscription local service
593             */
594            public com.liferay.portal.service.SubscriptionLocalService getSubscriptionLocalService() {
595                    return subscriptionLocalService;
596            }
597    
598            /**
599             * Sets the subscription local service.
600             *
601             * @param subscriptionLocalService the subscription local service
602             */
603            public void setSubscriptionLocalService(
604                    com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService) {
605                    this.subscriptionLocalService = subscriptionLocalService;
606            }
607    
608            /**
609             * Returns the subscription persistence.
610             *
611             * @return the subscription persistence
612             */
613            public SubscriptionPersistence getSubscriptionPersistence() {
614                    return subscriptionPersistence;
615            }
616    
617            /**
618             * Sets the subscription persistence.
619             *
620             * @param subscriptionPersistence the subscription persistence
621             */
622            public void setSubscriptionPersistence(
623                    SubscriptionPersistence subscriptionPersistence) {
624                    this.subscriptionPersistence = subscriptionPersistence;
625            }
626    
627            /**
628             * Returns the system event local service.
629             *
630             * @return the system event local service
631             */
632            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
633                    return systemEventLocalService;
634            }
635    
636            /**
637             * Sets the system event local service.
638             *
639             * @param systemEventLocalService the system event local service
640             */
641            public void setSystemEventLocalService(
642                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
643                    this.systemEventLocalService = systemEventLocalService;
644            }
645    
646            /**
647             * Returns the system event persistence.
648             *
649             * @return the system event persistence
650             */
651            public SystemEventPersistence getSystemEventPersistence() {
652                    return systemEventPersistence;
653            }
654    
655            /**
656             * Sets the system event persistence.
657             *
658             * @param systemEventPersistence the system event persistence
659             */
660            public void setSystemEventPersistence(
661                    SystemEventPersistence systemEventPersistence) {
662                    this.systemEventPersistence = systemEventPersistence;
663            }
664    
665            /**
666             * Returns the user local service.
667             *
668             * @return the user local service
669             */
670            public com.liferay.portal.service.UserLocalService getUserLocalService() {
671                    return userLocalService;
672            }
673    
674            /**
675             * Sets the user local service.
676             *
677             * @param userLocalService the user local service
678             */
679            public void setUserLocalService(
680                    com.liferay.portal.service.UserLocalService userLocalService) {
681                    this.userLocalService = userLocalService;
682            }
683    
684            /**
685             * Returns the user remote service.
686             *
687             * @return the user remote service
688             */
689            public com.liferay.portal.service.UserService getUserService() {
690                    return userService;
691            }
692    
693            /**
694             * Sets the user remote service.
695             *
696             * @param userService the user remote service
697             */
698            public void setUserService(
699                    com.liferay.portal.service.UserService userService) {
700                    this.userService = userService;
701            }
702    
703            /**
704             * Returns the user persistence.
705             *
706             * @return the user persistence
707             */
708            public UserPersistence getUserPersistence() {
709                    return userPersistence;
710            }
711    
712            /**
713             * Sets the user persistence.
714             *
715             * @param userPersistence the user persistence
716             */
717            public void setUserPersistence(UserPersistence userPersistence) {
718                    this.userPersistence = userPersistence;
719            }
720    
721            /**
722             * Returns the user finder.
723             *
724             * @return the user finder
725             */
726            public UserFinder getUserFinder() {
727                    return userFinder;
728            }
729    
730            /**
731             * Sets the user finder.
732             *
733             * @param userFinder the user finder
734             */
735            public void setUserFinder(UserFinder userFinder) {
736                    this.userFinder = userFinder;
737            }
738    
739            /**
740             * Returns the workflow instance link local service.
741             *
742             * @return the workflow instance link local service
743             */
744            public com.liferay.portal.service.WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
745                    return workflowInstanceLinkLocalService;
746            }
747    
748            /**
749             * Sets the workflow instance link local service.
750             *
751             * @param workflowInstanceLinkLocalService the workflow instance link local service
752             */
753            public void setWorkflowInstanceLinkLocalService(
754                    com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
755                    this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
756            }
757    
758            /**
759             * Returns the workflow instance link persistence.
760             *
761             * @return the workflow instance link persistence
762             */
763            public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
764                    return workflowInstanceLinkPersistence;
765            }
766    
767            /**
768             * Sets the workflow instance link persistence.
769             *
770             * @param workflowInstanceLinkPersistence the workflow instance link persistence
771             */
772            public void setWorkflowInstanceLinkPersistence(
773                    WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
774                    this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
775            }
776    
777            /**
778             * Returns the asset entry local service.
779             *
780             * @return the asset entry local service
781             */
782            public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
783                    return assetEntryLocalService;
784            }
785    
786            /**
787             * Sets the asset entry local service.
788             *
789             * @param assetEntryLocalService the asset entry local service
790             */
791            public void setAssetEntryLocalService(
792                    com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
793                    this.assetEntryLocalService = assetEntryLocalService;
794            }
795    
796            /**
797             * Returns the asset entry remote service.
798             *
799             * @return the asset entry remote service
800             */
801            public com.liferay.portlet.asset.service.AssetEntryService getAssetEntryService() {
802                    return assetEntryService;
803            }
804    
805            /**
806             * Sets the asset entry remote service.
807             *
808             * @param assetEntryService the asset entry remote service
809             */
810            public void setAssetEntryService(
811                    com.liferay.portlet.asset.service.AssetEntryService assetEntryService) {
812                    this.assetEntryService = assetEntryService;
813            }
814    
815            /**
816             * Returns the asset entry persistence.
817             *
818             * @return the asset entry persistence
819             */
820            public AssetEntryPersistence getAssetEntryPersistence() {
821                    return assetEntryPersistence;
822            }
823    
824            /**
825             * Sets the asset entry persistence.
826             *
827             * @param assetEntryPersistence the asset entry persistence
828             */
829            public void setAssetEntryPersistence(
830                    AssetEntryPersistence assetEntryPersistence) {
831                    this.assetEntryPersistence = assetEntryPersistence;
832            }
833    
834            /**
835             * Returns the asset entry finder.
836             *
837             * @return the asset entry finder
838             */
839            public AssetEntryFinder getAssetEntryFinder() {
840                    return assetEntryFinder;
841            }
842    
843            /**
844             * Sets the asset entry finder.
845             *
846             * @param assetEntryFinder the asset entry finder
847             */
848            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
849                    this.assetEntryFinder = assetEntryFinder;
850            }
851    
852            /**
853             * Returns the trash entry local service.
854             *
855             * @return the trash entry local service
856             */
857            public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
858                    return trashEntryLocalService;
859            }
860    
861            /**
862             * Sets the trash entry local service.
863             *
864             * @param trashEntryLocalService the trash entry local service
865             */
866            public void setTrashEntryLocalService(
867                    com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
868                    this.trashEntryLocalService = trashEntryLocalService;
869            }
870    
871            /**
872             * Returns the trash entry remote service.
873             *
874             * @return the trash entry remote service
875             */
876            public com.liferay.portlet.trash.service.TrashEntryService getTrashEntryService() {
877                    return trashEntryService;
878            }
879    
880            /**
881             * Sets the trash entry remote service.
882             *
883             * @param trashEntryService the trash entry remote service
884             */
885            public void setTrashEntryService(
886                    com.liferay.portlet.trash.service.TrashEntryService trashEntryService) {
887                    this.trashEntryService = trashEntryService;
888            }
889    
890            /**
891             * Returns the trash entry persistence.
892             *
893             * @return the trash entry persistence
894             */
895            public TrashEntryPersistence getTrashEntryPersistence() {
896                    return trashEntryPersistence;
897            }
898    
899            /**
900             * Sets the trash entry persistence.
901             *
902             * @param trashEntryPersistence the trash entry persistence
903             */
904            public void setTrashEntryPersistence(
905                    TrashEntryPersistence trashEntryPersistence) {
906                    this.trashEntryPersistence = trashEntryPersistence;
907            }
908    
909            /**
910             * Returns the trash version local service.
911             *
912             * @return the trash version local service
913             */
914            public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
915                    return trashVersionLocalService;
916            }
917    
918            /**
919             * Sets the trash version local service.
920             *
921             * @param trashVersionLocalService the trash version local service
922             */
923            public void setTrashVersionLocalService(
924                    com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
925                    this.trashVersionLocalService = trashVersionLocalService;
926            }
927    
928            /**
929             * Returns the trash version persistence.
930             *
931             * @return the trash version persistence
932             */
933            public TrashVersionPersistence getTrashVersionPersistence() {
934                    return trashVersionPersistence;
935            }
936    
937            /**
938             * Sets the trash version persistence.
939             *
940             * @param trashVersionPersistence the trash version persistence
941             */
942            public void setTrashVersionPersistence(
943                    TrashVersionPersistence trashVersionPersistence) {
944                    this.trashVersionPersistence = trashVersionPersistence;
945            }
946    
947            /**
948             * Returns the wiki page local service.
949             *
950             * @return the wiki page local service
951             */
952            public com.liferay.portlet.wiki.service.WikiPageLocalService getWikiPageLocalService() {
953                    return wikiPageLocalService;
954            }
955    
956            /**
957             * Sets the wiki page local service.
958             *
959             * @param wikiPageLocalService the wiki page local service
960             */
961            public void setWikiPageLocalService(
962                    com.liferay.portlet.wiki.service.WikiPageLocalService wikiPageLocalService) {
963                    this.wikiPageLocalService = wikiPageLocalService;
964            }
965    
966            /**
967             * Returns the wiki page remote service.
968             *
969             * @return the wiki page remote service
970             */
971            public com.liferay.portlet.wiki.service.WikiPageService getWikiPageService() {
972                    return wikiPageService;
973            }
974    
975            /**
976             * Sets the wiki page remote service.
977             *
978             * @param wikiPageService the wiki page remote service
979             */
980            public void setWikiPageService(
981                    com.liferay.portlet.wiki.service.WikiPageService wikiPageService) {
982                    this.wikiPageService = wikiPageService;
983            }
984    
985            /**
986             * Returns the wiki page persistence.
987             *
988             * @return the wiki page persistence
989             */
990            public WikiPagePersistence getWikiPagePersistence() {
991                    return wikiPagePersistence;
992            }
993    
994            /**
995             * Sets the wiki page persistence.
996             *
997             * @param wikiPagePersistence the wiki page persistence
998             */
999            public void setWikiPagePersistence(WikiPagePersistence wikiPagePersistence) {
1000                    this.wikiPagePersistence = wikiPagePersistence;
1001            }
1002    
1003            /**
1004             * Returns the wiki page finder.
1005             *
1006             * @return the wiki page finder
1007             */
1008            public WikiPageFinder getWikiPageFinder() {
1009                    return wikiPageFinder;
1010            }
1011    
1012            /**
1013             * Sets the wiki page finder.
1014             *
1015             * @param wikiPageFinder the wiki page finder
1016             */
1017            public void setWikiPageFinder(WikiPageFinder wikiPageFinder) {
1018                    this.wikiPageFinder = wikiPageFinder;
1019            }
1020    
1021            public void afterPropertiesSet() {
1022                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.wiki.model.WikiNode",
1023                            wikiNodeLocalService);
1024            }
1025    
1026            public void destroy() {
1027                    persistedModelLocalServiceRegistry.unregister(
1028                            "com.liferay.portlet.wiki.model.WikiNode");
1029            }
1030    
1031            /**
1032             * Returns the Spring bean ID for this bean.
1033             *
1034             * @return the Spring bean ID for this bean
1035             */
1036            @Override
1037            public String getBeanIdentifier() {
1038                    return _beanIdentifier;
1039            }
1040    
1041            /**
1042             * Sets the Spring bean ID for this bean.
1043             *
1044             * @param beanIdentifier the Spring bean ID for this bean
1045             */
1046            @Override
1047            public void setBeanIdentifier(String beanIdentifier) {
1048                    _beanIdentifier = beanIdentifier;
1049            }
1050    
1051            protected Class<?> getModelClass() {
1052                    return WikiNode.class;
1053            }
1054    
1055            protected String getModelClassName() {
1056                    return WikiNode.class.getName();
1057            }
1058    
1059            /**
1060             * Performs a SQL query.
1061             *
1062             * @param sql the sql query
1063             */
1064            protected void runSQL(String sql) {
1065                    try {
1066                            DataSource dataSource = wikiNodePersistence.getDataSource();
1067    
1068                            DB db = DBFactoryUtil.getDB();
1069    
1070                            sql = db.buildSQL(sql);
1071                            sql = PortalUtil.transformSQL(sql);
1072    
1073                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1074                                            sql, new int[0]);
1075    
1076                            sqlUpdate.update();
1077                    }
1078                    catch (Exception e) {
1079                            throw new SystemException(e);
1080                    }
1081            }
1082    
1083            @BeanReference(type = com.liferay.portlet.wiki.service.WikiNodeLocalService.class)
1084            protected com.liferay.portlet.wiki.service.WikiNodeLocalService wikiNodeLocalService;
1085            @BeanReference(type = com.liferay.portlet.wiki.service.WikiNodeService.class)
1086            protected com.liferay.portlet.wiki.service.WikiNodeService wikiNodeService;
1087            @BeanReference(type = WikiNodePersistence.class)
1088            protected WikiNodePersistence wikiNodePersistence;
1089            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1090            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1091            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1092            protected com.liferay.portal.service.GroupLocalService groupLocalService;
1093            @BeanReference(type = com.liferay.portal.service.GroupService.class)
1094            protected com.liferay.portal.service.GroupService groupService;
1095            @BeanReference(type = GroupPersistence.class)
1096            protected GroupPersistence groupPersistence;
1097            @BeanReference(type = GroupFinder.class)
1098            protected GroupFinder groupFinder;
1099            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1100            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1101            @BeanReference(type = com.liferay.portal.service.SubscriptionLocalService.class)
1102            protected com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService;
1103            @BeanReference(type = SubscriptionPersistence.class)
1104            protected SubscriptionPersistence subscriptionPersistence;
1105            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
1106            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
1107            @BeanReference(type = SystemEventPersistence.class)
1108            protected SystemEventPersistence systemEventPersistence;
1109            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1110            protected com.liferay.portal.service.UserLocalService userLocalService;
1111            @BeanReference(type = com.liferay.portal.service.UserService.class)
1112            protected com.liferay.portal.service.UserService userService;
1113            @BeanReference(type = UserPersistence.class)
1114            protected UserPersistence userPersistence;
1115            @BeanReference(type = UserFinder.class)
1116            protected UserFinder userFinder;
1117            @BeanReference(type = com.liferay.portal.service.WorkflowInstanceLinkLocalService.class)
1118            protected com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
1119            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1120            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1121            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryLocalService.class)
1122            protected com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService;
1123            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryService.class)
1124            protected com.liferay.portlet.asset.service.AssetEntryService assetEntryService;
1125            @BeanReference(type = AssetEntryPersistence.class)
1126            protected AssetEntryPersistence assetEntryPersistence;
1127            @BeanReference(type = AssetEntryFinder.class)
1128            protected AssetEntryFinder assetEntryFinder;
1129            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
1130            protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
1131            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
1132            protected com.liferay.portlet.trash.service.TrashEntryService trashEntryService;
1133            @BeanReference(type = TrashEntryPersistence.class)
1134            protected TrashEntryPersistence trashEntryPersistence;
1135            @BeanReference(type = com.liferay.portlet.trash.service.TrashVersionLocalService.class)
1136            protected com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService;
1137            @BeanReference(type = TrashVersionPersistence.class)
1138            protected TrashVersionPersistence trashVersionPersistence;
1139            @BeanReference(type = com.liferay.portlet.wiki.service.WikiPageLocalService.class)
1140            protected com.liferay.portlet.wiki.service.WikiPageLocalService wikiPageLocalService;
1141            @BeanReference(type = com.liferay.portlet.wiki.service.WikiPageService.class)
1142            protected com.liferay.portlet.wiki.service.WikiPageService wikiPageService;
1143            @BeanReference(type = WikiPagePersistence.class)
1144            protected WikiPagePersistence wikiPagePersistence;
1145            @BeanReference(type = WikiPageFinder.class)
1146            protected WikiPageFinder wikiPageFinder;
1147            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1148            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1149            private String _beanIdentifier;
1150    }