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 matching the dynamic query.
203             *
204             * @param dynamicQuery the dynamic query
205             * @return the number of rows matching 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 matching 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 matching 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            /**
356             * Returns all the wiki nodes matching the UUID and company.
357             *
358             * @param uuid the UUID of the wiki nodes
359             * @param companyId the primary key of the company
360             * @return the matching wiki nodes, or an empty list if no matches were found
361             */
362            @Override
363            public List<WikiNode> getWikiNodesByUuidAndCompanyId(String uuid,
364                    long companyId) {
365                    return wikiNodePersistence.findByUuid_C(uuid, companyId);
366            }
367    
368            /**
369             * Returns a range of wiki nodes matching the UUID and company.
370             *
371             * @param uuid the UUID of the wiki nodes
372             * @param companyId the primary key of the company
373             * @param start the lower bound of the range of wiki nodes
374             * @param end the upper bound of the range of wiki nodes (not inclusive)
375             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
376             * @return the range of matching wiki nodes, or an empty list if no matches were found
377             */
378            @Override
379            public List<WikiNode> getWikiNodesByUuidAndCompanyId(String uuid,
380                    long companyId, int start, int end,
381                    OrderByComparator<WikiNode> orderByComparator) {
382                    return wikiNodePersistence.findByUuid_C(uuid, companyId, start, end,
383                            orderByComparator);
384            }
385    
386            /**
387             * Returns the wiki node matching the UUID and group.
388             *
389             * @param uuid the wiki node's UUID
390             * @param groupId the primary key of the group
391             * @return the matching wiki node
392             * @throws PortalException if a matching wiki node could not be found
393             */
394            @Override
395            public WikiNode getWikiNodeByUuidAndGroupId(String uuid, long groupId)
396                    throws PortalException {
397                    return wikiNodePersistence.findByUUID_G(uuid, groupId);
398            }
399    
400            /**
401             * Returns a range of all the wiki nodes.
402             *
403             * <p>
404             * 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.
405             * </p>
406             *
407             * @param start the lower bound of the range of wiki nodes
408             * @param end the upper bound of the range of wiki nodes (not inclusive)
409             * @return the range of wiki nodes
410             */
411            @Override
412            public List<WikiNode> getWikiNodes(int start, int end) {
413                    return wikiNodePersistence.findAll(start, end);
414            }
415    
416            /**
417             * Returns the number of wiki nodes.
418             *
419             * @return the number of wiki nodes
420             */
421            @Override
422            public int getWikiNodesCount() {
423                    return wikiNodePersistence.countAll();
424            }
425    
426            /**
427             * Updates the wiki node in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
428             *
429             * @param wikiNode the wiki node
430             * @return the wiki node that was updated
431             */
432            @Indexable(type = IndexableType.REINDEX)
433            @Override
434            public WikiNode updateWikiNode(WikiNode wikiNode) {
435                    return wikiNodePersistence.update(wikiNode);
436            }
437    
438            /**
439             * Returns the wiki node local service.
440             *
441             * @return the wiki node local service
442             */
443            public com.liferay.portlet.wiki.service.WikiNodeLocalService getWikiNodeLocalService() {
444                    return wikiNodeLocalService;
445            }
446    
447            /**
448             * Sets the wiki node local service.
449             *
450             * @param wikiNodeLocalService the wiki node local service
451             */
452            public void setWikiNodeLocalService(
453                    com.liferay.portlet.wiki.service.WikiNodeLocalService wikiNodeLocalService) {
454                    this.wikiNodeLocalService = wikiNodeLocalService;
455            }
456    
457            /**
458             * Returns the wiki node remote service.
459             *
460             * @return the wiki node remote service
461             */
462            public com.liferay.portlet.wiki.service.WikiNodeService getWikiNodeService() {
463                    return wikiNodeService;
464            }
465    
466            /**
467             * Sets the wiki node remote service.
468             *
469             * @param wikiNodeService the wiki node remote service
470             */
471            public void setWikiNodeService(
472                    com.liferay.portlet.wiki.service.WikiNodeService wikiNodeService) {
473                    this.wikiNodeService = wikiNodeService;
474            }
475    
476            /**
477             * Returns the wiki node persistence.
478             *
479             * @return the wiki node persistence
480             */
481            public WikiNodePersistence getWikiNodePersistence() {
482                    return wikiNodePersistence;
483            }
484    
485            /**
486             * Sets the wiki node persistence.
487             *
488             * @param wikiNodePersistence the wiki node persistence
489             */
490            public void setWikiNodePersistence(WikiNodePersistence wikiNodePersistence) {
491                    this.wikiNodePersistence = wikiNodePersistence;
492            }
493    
494            /**
495             * Returns the counter local service.
496             *
497             * @return the counter local service
498             */
499            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
500                    return counterLocalService;
501            }
502    
503            /**
504             * Sets the counter local service.
505             *
506             * @param counterLocalService the counter local service
507             */
508            public void setCounterLocalService(
509                    com.liferay.counter.service.CounterLocalService counterLocalService) {
510                    this.counterLocalService = counterLocalService;
511            }
512    
513            /**
514             * Returns the group local service.
515             *
516             * @return the group local service
517             */
518            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
519                    return groupLocalService;
520            }
521    
522            /**
523             * Sets the group local service.
524             *
525             * @param groupLocalService the group local service
526             */
527            public void setGroupLocalService(
528                    com.liferay.portal.service.GroupLocalService groupLocalService) {
529                    this.groupLocalService = groupLocalService;
530            }
531    
532            /**
533             * Returns the group remote service.
534             *
535             * @return the group remote service
536             */
537            public com.liferay.portal.service.GroupService getGroupService() {
538                    return groupService;
539            }
540    
541            /**
542             * Sets the group remote service.
543             *
544             * @param groupService the group remote service
545             */
546            public void setGroupService(
547                    com.liferay.portal.service.GroupService groupService) {
548                    this.groupService = groupService;
549            }
550    
551            /**
552             * Returns the group persistence.
553             *
554             * @return the group persistence
555             */
556            public GroupPersistence getGroupPersistence() {
557                    return groupPersistence;
558            }
559    
560            /**
561             * Sets the group persistence.
562             *
563             * @param groupPersistence the group persistence
564             */
565            public void setGroupPersistence(GroupPersistence groupPersistence) {
566                    this.groupPersistence = groupPersistence;
567            }
568    
569            /**
570             * Returns the group finder.
571             *
572             * @return the group finder
573             */
574            public GroupFinder getGroupFinder() {
575                    return groupFinder;
576            }
577    
578            /**
579             * Sets the group finder.
580             *
581             * @param groupFinder the group finder
582             */
583            public void setGroupFinder(GroupFinder groupFinder) {
584                    this.groupFinder = groupFinder;
585            }
586    
587            /**
588             * Returns the resource local service.
589             *
590             * @return the resource local service
591             */
592            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
593                    return resourceLocalService;
594            }
595    
596            /**
597             * Sets the resource local service.
598             *
599             * @param resourceLocalService the resource local service
600             */
601            public void setResourceLocalService(
602                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
603                    this.resourceLocalService = resourceLocalService;
604            }
605    
606            /**
607             * Returns the subscription local service.
608             *
609             * @return the subscription local service
610             */
611            public com.liferay.portal.service.SubscriptionLocalService getSubscriptionLocalService() {
612                    return subscriptionLocalService;
613            }
614    
615            /**
616             * Sets the subscription local service.
617             *
618             * @param subscriptionLocalService the subscription local service
619             */
620            public void setSubscriptionLocalService(
621                    com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService) {
622                    this.subscriptionLocalService = subscriptionLocalService;
623            }
624    
625            /**
626             * Returns the subscription persistence.
627             *
628             * @return the subscription persistence
629             */
630            public SubscriptionPersistence getSubscriptionPersistence() {
631                    return subscriptionPersistence;
632            }
633    
634            /**
635             * Sets the subscription persistence.
636             *
637             * @param subscriptionPersistence the subscription persistence
638             */
639            public void setSubscriptionPersistence(
640                    SubscriptionPersistence subscriptionPersistence) {
641                    this.subscriptionPersistence = subscriptionPersistence;
642            }
643    
644            /**
645             * Returns the system event local service.
646             *
647             * @return the system event local service
648             */
649            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
650                    return systemEventLocalService;
651            }
652    
653            /**
654             * Sets the system event local service.
655             *
656             * @param systemEventLocalService the system event local service
657             */
658            public void setSystemEventLocalService(
659                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
660                    this.systemEventLocalService = systemEventLocalService;
661            }
662    
663            /**
664             * Returns the system event persistence.
665             *
666             * @return the system event persistence
667             */
668            public SystemEventPersistence getSystemEventPersistence() {
669                    return systemEventPersistence;
670            }
671    
672            /**
673             * Sets the system event persistence.
674             *
675             * @param systemEventPersistence the system event persistence
676             */
677            public void setSystemEventPersistence(
678                    SystemEventPersistence systemEventPersistence) {
679                    this.systemEventPersistence = systemEventPersistence;
680            }
681    
682            /**
683             * Returns the user local service.
684             *
685             * @return the user local service
686             */
687            public com.liferay.portal.service.UserLocalService getUserLocalService() {
688                    return userLocalService;
689            }
690    
691            /**
692             * Sets the user local service.
693             *
694             * @param userLocalService the user local service
695             */
696            public void setUserLocalService(
697                    com.liferay.portal.service.UserLocalService userLocalService) {
698                    this.userLocalService = userLocalService;
699            }
700    
701            /**
702             * Returns the user remote service.
703             *
704             * @return the user remote service
705             */
706            public com.liferay.portal.service.UserService getUserService() {
707                    return userService;
708            }
709    
710            /**
711             * Sets the user remote service.
712             *
713             * @param userService the user remote service
714             */
715            public void setUserService(
716                    com.liferay.portal.service.UserService userService) {
717                    this.userService = userService;
718            }
719    
720            /**
721             * Returns the user persistence.
722             *
723             * @return the user persistence
724             */
725            public UserPersistence getUserPersistence() {
726                    return userPersistence;
727            }
728    
729            /**
730             * Sets the user persistence.
731             *
732             * @param userPersistence the user persistence
733             */
734            public void setUserPersistence(UserPersistence userPersistence) {
735                    this.userPersistence = userPersistence;
736            }
737    
738            /**
739             * Returns the user finder.
740             *
741             * @return the user finder
742             */
743            public UserFinder getUserFinder() {
744                    return userFinder;
745            }
746    
747            /**
748             * Sets the user finder.
749             *
750             * @param userFinder the user finder
751             */
752            public void setUserFinder(UserFinder userFinder) {
753                    this.userFinder = userFinder;
754            }
755    
756            /**
757             * Returns the workflow instance link local service.
758             *
759             * @return the workflow instance link local service
760             */
761            public com.liferay.portal.service.WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
762                    return workflowInstanceLinkLocalService;
763            }
764    
765            /**
766             * Sets the workflow instance link local service.
767             *
768             * @param workflowInstanceLinkLocalService the workflow instance link local service
769             */
770            public void setWorkflowInstanceLinkLocalService(
771                    com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
772                    this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
773            }
774    
775            /**
776             * Returns the workflow instance link persistence.
777             *
778             * @return the workflow instance link persistence
779             */
780            public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
781                    return workflowInstanceLinkPersistence;
782            }
783    
784            /**
785             * Sets the workflow instance link persistence.
786             *
787             * @param workflowInstanceLinkPersistence the workflow instance link persistence
788             */
789            public void setWorkflowInstanceLinkPersistence(
790                    WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
791                    this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
792            }
793    
794            /**
795             * Returns the asset entry local service.
796             *
797             * @return the asset entry local service
798             */
799            public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
800                    return assetEntryLocalService;
801            }
802    
803            /**
804             * Sets the asset entry local service.
805             *
806             * @param assetEntryLocalService the asset entry local service
807             */
808            public void setAssetEntryLocalService(
809                    com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
810                    this.assetEntryLocalService = assetEntryLocalService;
811            }
812    
813            /**
814             * Returns the asset entry remote service.
815             *
816             * @return the asset entry remote service
817             */
818            public com.liferay.portlet.asset.service.AssetEntryService getAssetEntryService() {
819                    return assetEntryService;
820            }
821    
822            /**
823             * Sets the asset entry remote service.
824             *
825             * @param assetEntryService the asset entry remote service
826             */
827            public void setAssetEntryService(
828                    com.liferay.portlet.asset.service.AssetEntryService assetEntryService) {
829                    this.assetEntryService = assetEntryService;
830            }
831    
832            /**
833             * Returns the asset entry persistence.
834             *
835             * @return the asset entry persistence
836             */
837            public AssetEntryPersistence getAssetEntryPersistence() {
838                    return assetEntryPersistence;
839            }
840    
841            /**
842             * Sets the asset entry persistence.
843             *
844             * @param assetEntryPersistence the asset entry persistence
845             */
846            public void setAssetEntryPersistence(
847                    AssetEntryPersistence assetEntryPersistence) {
848                    this.assetEntryPersistence = assetEntryPersistence;
849            }
850    
851            /**
852             * Returns the asset entry finder.
853             *
854             * @return the asset entry finder
855             */
856            public AssetEntryFinder getAssetEntryFinder() {
857                    return assetEntryFinder;
858            }
859    
860            /**
861             * Sets the asset entry finder.
862             *
863             * @param assetEntryFinder the asset entry finder
864             */
865            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
866                    this.assetEntryFinder = assetEntryFinder;
867            }
868    
869            /**
870             * Returns the trash entry local service.
871             *
872             * @return the trash entry local service
873             */
874            public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
875                    return trashEntryLocalService;
876            }
877    
878            /**
879             * Sets the trash entry local service.
880             *
881             * @param trashEntryLocalService the trash entry local service
882             */
883            public void setTrashEntryLocalService(
884                    com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
885                    this.trashEntryLocalService = trashEntryLocalService;
886            }
887    
888            /**
889             * Returns the trash entry remote service.
890             *
891             * @return the trash entry remote service
892             */
893            public com.liferay.portlet.trash.service.TrashEntryService getTrashEntryService() {
894                    return trashEntryService;
895            }
896    
897            /**
898             * Sets the trash entry remote service.
899             *
900             * @param trashEntryService the trash entry remote service
901             */
902            public void setTrashEntryService(
903                    com.liferay.portlet.trash.service.TrashEntryService trashEntryService) {
904                    this.trashEntryService = trashEntryService;
905            }
906    
907            /**
908             * Returns the trash entry persistence.
909             *
910             * @return the trash entry persistence
911             */
912            public TrashEntryPersistence getTrashEntryPersistence() {
913                    return trashEntryPersistence;
914            }
915    
916            /**
917             * Sets the trash entry persistence.
918             *
919             * @param trashEntryPersistence the trash entry persistence
920             */
921            public void setTrashEntryPersistence(
922                    TrashEntryPersistence trashEntryPersistence) {
923                    this.trashEntryPersistence = trashEntryPersistence;
924            }
925    
926            /**
927             * Returns the trash version local service.
928             *
929             * @return the trash version local service
930             */
931            public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
932                    return trashVersionLocalService;
933            }
934    
935            /**
936             * Sets the trash version local service.
937             *
938             * @param trashVersionLocalService the trash version local service
939             */
940            public void setTrashVersionLocalService(
941                    com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
942                    this.trashVersionLocalService = trashVersionLocalService;
943            }
944    
945            /**
946             * Returns the trash version persistence.
947             *
948             * @return the trash version persistence
949             */
950            public TrashVersionPersistence getTrashVersionPersistence() {
951                    return trashVersionPersistence;
952            }
953    
954            /**
955             * Sets the trash version persistence.
956             *
957             * @param trashVersionPersistence the trash version persistence
958             */
959            public void setTrashVersionPersistence(
960                    TrashVersionPersistence trashVersionPersistence) {
961                    this.trashVersionPersistence = trashVersionPersistence;
962            }
963    
964            /**
965             * Returns the wiki page local service.
966             *
967             * @return the wiki page local service
968             */
969            public com.liferay.portlet.wiki.service.WikiPageLocalService getWikiPageLocalService() {
970                    return wikiPageLocalService;
971            }
972    
973            /**
974             * Sets the wiki page local service.
975             *
976             * @param wikiPageLocalService the wiki page local service
977             */
978            public void setWikiPageLocalService(
979                    com.liferay.portlet.wiki.service.WikiPageLocalService wikiPageLocalService) {
980                    this.wikiPageLocalService = wikiPageLocalService;
981            }
982    
983            /**
984             * Returns the wiki page remote service.
985             *
986             * @return the wiki page remote service
987             */
988            public com.liferay.portlet.wiki.service.WikiPageService getWikiPageService() {
989                    return wikiPageService;
990            }
991    
992            /**
993             * Sets the wiki page remote service.
994             *
995             * @param wikiPageService the wiki page remote service
996             */
997            public void setWikiPageService(
998                    com.liferay.portlet.wiki.service.WikiPageService wikiPageService) {
999                    this.wikiPageService = wikiPageService;
1000            }
1001    
1002            /**
1003             * Returns the wiki page persistence.
1004             *
1005             * @return the wiki page persistence
1006             */
1007            public WikiPagePersistence getWikiPagePersistence() {
1008                    return wikiPagePersistence;
1009            }
1010    
1011            /**
1012             * Sets the wiki page persistence.
1013             *
1014             * @param wikiPagePersistence the wiki page persistence
1015             */
1016            public void setWikiPagePersistence(WikiPagePersistence wikiPagePersistence) {
1017                    this.wikiPagePersistence = wikiPagePersistence;
1018            }
1019    
1020            /**
1021             * Returns the wiki page finder.
1022             *
1023             * @return the wiki page finder
1024             */
1025            public WikiPageFinder getWikiPageFinder() {
1026                    return wikiPageFinder;
1027            }
1028    
1029            /**
1030             * Sets the wiki page finder.
1031             *
1032             * @param wikiPageFinder the wiki page finder
1033             */
1034            public void setWikiPageFinder(WikiPageFinder wikiPageFinder) {
1035                    this.wikiPageFinder = wikiPageFinder;
1036            }
1037    
1038            public void afterPropertiesSet() {
1039                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.wiki.model.WikiNode",
1040                            wikiNodeLocalService);
1041            }
1042    
1043            public void destroy() {
1044                    persistedModelLocalServiceRegistry.unregister(
1045                            "com.liferay.portlet.wiki.model.WikiNode");
1046            }
1047    
1048            /**
1049             * Returns the Spring bean ID for this bean.
1050             *
1051             * @return the Spring bean ID for this bean
1052             */
1053            @Override
1054            public String getBeanIdentifier() {
1055                    return _beanIdentifier;
1056            }
1057    
1058            /**
1059             * Sets the Spring bean ID for this bean.
1060             *
1061             * @param beanIdentifier the Spring bean ID for this bean
1062             */
1063            @Override
1064            public void setBeanIdentifier(String beanIdentifier) {
1065                    _beanIdentifier = beanIdentifier;
1066            }
1067    
1068            protected Class<?> getModelClass() {
1069                    return WikiNode.class;
1070            }
1071    
1072            protected String getModelClassName() {
1073                    return WikiNode.class.getName();
1074            }
1075    
1076            /**
1077             * Performs a SQL query.
1078             *
1079             * @param sql the sql query
1080             */
1081            protected void runSQL(String sql) {
1082                    try {
1083                            DataSource dataSource = wikiNodePersistence.getDataSource();
1084    
1085                            DB db = DBFactoryUtil.getDB();
1086    
1087                            sql = db.buildSQL(sql);
1088                            sql = PortalUtil.transformSQL(sql);
1089    
1090                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1091                                            sql, new int[0]);
1092    
1093                            sqlUpdate.update();
1094                    }
1095                    catch (Exception e) {
1096                            throw new SystemException(e);
1097                    }
1098            }
1099    
1100            @BeanReference(type = com.liferay.portlet.wiki.service.WikiNodeLocalService.class)
1101            protected com.liferay.portlet.wiki.service.WikiNodeLocalService wikiNodeLocalService;
1102            @BeanReference(type = com.liferay.portlet.wiki.service.WikiNodeService.class)
1103            protected com.liferay.portlet.wiki.service.WikiNodeService wikiNodeService;
1104            @BeanReference(type = WikiNodePersistence.class)
1105            protected WikiNodePersistence wikiNodePersistence;
1106            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1107            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1108            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1109            protected com.liferay.portal.service.GroupLocalService groupLocalService;
1110            @BeanReference(type = com.liferay.portal.service.GroupService.class)
1111            protected com.liferay.portal.service.GroupService groupService;
1112            @BeanReference(type = GroupPersistence.class)
1113            protected GroupPersistence groupPersistence;
1114            @BeanReference(type = GroupFinder.class)
1115            protected GroupFinder groupFinder;
1116            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1117            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1118            @BeanReference(type = com.liferay.portal.service.SubscriptionLocalService.class)
1119            protected com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService;
1120            @BeanReference(type = SubscriptionPersistence.class)
1121            protected SubscriptionPersistence subscriptionPersistence;
1122            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
1123            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
1124            @BeanReference(type = SystemEventPersistence.class)
1125            protected SystemEventPersistence systemEventPersistence;
1126            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1127            protected com.liferay.portal.service.UserLocalService userLocalService;
1128            @BeanReference(type = com.liferay.portal.service.UserService.class)
1129            protected com.liferay.portal.service.UserService userService;
1130            @BeanReference(type = UserPersistence.class)
1131            protected UserPersistence userPersistence;
1132            @BeanReference(type = UserFinder.class)
1133            protected UserFinder userFinder;
1134            @BeanReference(type = com.liferay.portal.service.WorkflowInstanceLinkLocalService.class)
1135            protected com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
1136            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1137            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1138            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryLocalService.class)
1139            protected com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService;
1140            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryService.class)
1141            protected com.liferay.portlet.asset.service.AssetEntryService assetEntryService;
1142            @BeanReference(type = AssetEntryPersistence.class)
1143            protected AssetEntryPersistence assetEntryPersistence;
1144            @BeanReference(type = AssetEntryFinder.class)
1145            protected AssetEntryFinder assetEntryFinder;
1146            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
1147            protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
1148            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
1149            protected com.liferay.portlet.trash.service.TrashEntryService trashEntryService;
1150            @BeanReference(type = TrashEntryPersistence.class)
1151            protected TrashEntryPersistence trashEntryPersistence;
1152            @BeanReference(type = com.liferay.portlet.trash.service.TrashVersionLocalService.class)
1153            protected com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService;
1154            @BeanReference(type = TrashVersionPersistence.class)
1155            protected TrashVersionPersistence trashVersionPersistence;
1156            @BeanReference(type = com.liferay.portlet.wiki.service.WikiPageLocalService.class)
1157            protected com.liferay.portlet.wiki.service.WikiPageLocalService wikiPageLocalService;
1158            @BeanReference(type = com.liferay.portlet.wiki.service.WikiPageService.class)
1159            protected com.liferay.portlet.wiki.service.WikiPageService wikiPageService;
1160            @BeanReference(type = WikiPagePersistence.class)
1161            protected WikiPagePersistence wikiPagePersistence;
1162            @BeanReference(type = WikiPageFinder.class)
1163            protected WikiPageFinder wikiPageFinder;
1164            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1165            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1166            private String _beanIdentifier;
1167    }