001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.documentlibrary.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.asset.kernel.service.persistence.AssetEntryFinder;
020    import com.liferay.asset.kernel.service.persistence.AssetEntryPersistence;
021    import com.liferay.asset.kernel.service.persistence.AssetTagFinder;
022    import com.liferay.asset.kernel.service.persistence.AssetTagPersistence;
023    
024    import com.liferay.document.library.kernel.model.DLFileShortcut;
025    import com.liferay.document.library.kernel.service.DLFileShortcutLocalService;
026    import com.liferay.document.library.kernel.service.persistence.DLFileShortcutPersistence;
027    import com.liferay.document.library.kernel.service.persistence.DLFolderFinder;
028    import com.liferay.document.library.kernel.service.persistence.DLFolderPersistence;
029    
030    import com.liferay.exportimport.kernel.lar.ExportImportHelperUtil;
031    import com.liferay.exportimport.kernel.lar.ManifestSummary;
032    import com.liferay.exportimport.kernel.lar.PortletDataContext;
033    import com.liferay.exportimport.kernel.lar.StagedModelDataHandler;
034    import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerRegistryUtil;
035    import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil;
036    import com.liferay.exportimport.kernel.lar.StagedModelType;
037    
038    import com.liferay.portal.kernel.bean.BeanReference;
039    import com.liferay.portal.kernel.dao.db.DB;
040    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
041    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
042    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
043    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
044    import com.liferay.portal.kernel.dao.orm.Criterion;
045    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
046    import com.liferay.portal.kernel.dao.orm.Disjunction;
047    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
048    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
049    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
050    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
051    import com.liferay.portal.kernel.dao.orm.Projection;
052    import com.liferay.portal.kernel.dao.orm.Property;
053    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
054    import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
055    import com.liferay.portal.kernel.exception.PortalException;
056    import com.liferay.portal.kernel.exception.SystemException;
057    import com.liferay.portal.kernel.model.PersistedModel;
058    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
059    import com.liferay.portal.kernel.search.Indexable;
060    import com.liferay.portal.kernel.search.IndexableType;
061    import com.liferay.portal.kernel.service.BaseLocalServiceImpl;
062    import com.liferay.portal.kernel.service.PersistedModelLocalServiceRegistry;
063    import com.liferay.portal.kernel.service.persistence.UserFinder;
064    import com.liferay.portal.kernel.service.persistence.UserPersistence;
065    import com.liferay.portal.kernel.util.OrderByComparator;
066    import com.liferay.portal.kernel.util.PortalUtil;
067    import com.liferay.portal.kernel.workflow.WorkflowConstants;
068    
069    import com.liferay.trash.kernel.service.persistence.TrashEntryPersistence;
070    import com.liferay.trash.kernel.service.persistence.TrashVersionPersistence;
071    
072    import java.io.Serializable;
073    
074    import java.util.List;
075    
076    import javax.sql.DataSource;
077    
078    /**
079     * Provides the base implementation for the document library file shortcut local service.
080     *
081     * <p>
082     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portlet.documentlibrary.service.impl.DLFileShortcutLocalServiceImpl}.
083     * </p>
084     *
085     * @author Brian Wing Shun Chan
086     * @see com.liferay.portlet.documentlibrary.service.impl.DLFileShortcutLocalServiceImpl
087     * @see com.liferay.document.library.kernel.service.DLFileShortcutLocalServiceUtil
088     * @generated
089     */
090    @ProviderType
091    public abstract class DLFileShortcutLocalServiceBaseImpl
092            extends BaseLocalServiceImpl implements DLFileShortcutLocalService,
093                    IdentifiableOSGiService {
094            /*
095             * NOTE FOR DEVELOPERS:
096             *
097             * Never modify or reference this class directly. Always use {@link com.liferay.document.library.kernel.service.DLFileShortcutLocalServiceUtil} to access the document library file shortcut local service.
098             */
099    
100            /**
101             * Adds the document library file shortcut to the database. Also notifies the appropriate model listeners.
102             *
103             * @param dlFileShortcut the document library file shortcut
104             * @return the document library file shortcut that was added
105             */
106            @Indexable(type = IndexableType.REINDEX)
107            @Override
108            public DLFileShortcut addDLFileShortcut(DLFileShortcut dlFileShortcut) {
109                    dlFileShortcut.setNew(true);
110    
111                    return dlFileShortcutPersistence.update(dlFileShortcut);
112            }
113    
114            /**
115             * Creates a new document library file shortcut with the primary key. Does not add the document library file shortcut to the database.
116             *
117             * @param fileShortcutId the primary key for the new document library file shortcut
118             * @return the new document library file shortcut
119             */
120            @Override
121            public DLFileShortcut createDLFileShortcut(long fileShortcutId) {
122                    return dlFileShortcutPersistence.create(fileShortcutId);
123            }
124    
125            /**
126             * Deletes the document library file shortcut with the primary key from the database. Also notifies the appropriate model listeners.
127             *
128             * @param fileShortcutId the primary key of the document library file shortcut
129             * @return the document library file shortcut that was removed
130             * @throws PortalException if a document library file shortcut with the primary key could not be found
131             */
132            @Indexable(type = IndexableType.DELETE)
133            @Override
134            public DLFileShortcut deleteDLFileShortcut(long fileShortcutId)
135                    throws PortalException {
136                    return dlFileShortcutPersistence.remove(fileShortcutId);
137            }
138    
139            /**
140             * Deletes the document library file shortcut from the database. Also notifies the appropriate model listeners.
141             *
142             * @param dlFileShortcut the document library file shortcut
143             * @return the document library file shortcut that was removed
144             */
145            @Indexable(type = IndexableType.DELETE)
146            @Override
147            public DLFileShortcut deleteDLFileShortcut(DLFileShortcut dlFileShortcut) {
148                    return dlFileShortcutPersistence.remove(dlFileShortcut);
149            }
150    
151            @Override
152            public DynamicQuery dynamicQuery() {
153                    Class<?> clazz = getClass();
154    
155                    return DynamicQueryFactoryUtil.forClass(DLFileShortcut.class,
156                            clazz.getClassLoader());
157            }
158    
159            /**
160             * Performs a dynamic query on the database and returns the matching rows.
161             *
162             * @param dynamicQuery the dynamic query
163             * @return the matching rows
164             */
165            @Override
166            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
167                    return dlFileShortcutPersistence.findWithDynamicQuery(dynamicQuery);
168            }
169    
170            /**
171             * Performs a dynamic query on the database and returns a range of the matching rows.
172             *
173             * <p>
174             * 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.documentlibrary.model.impl.DLFileShortcutModelImpl}. 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.
175             * </p>
176             *
177             * @param dynamicQuery the dynamic query
178             * @param start the lower bound of the range of model instances
179             * @param end the upper bound of the range of model instances (not inclusive)
180             * @return the range of matching rows
181             */
182            @Override
183            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
184                    int end) {
185                    return dlFileShortcutPersistence.findWithDynamicQuery(dynamicQuery,
186                            start, end);
187            }
188    
189            /**
190             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
191             *
192             * <p>
193             * 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.documentlibrary.model.impl.DLFileShortcutModelImpl}. 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.
194             * </p>
195             *
196             * @param dynamicQuery the dynamic query
197             * @param start the lower bound of the range of model instances
198             * @param end the upper bound of the range of model instances (not inclusive)
199             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
200             * @return the ordered range of matching rows
201             */
202            @Override
203            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
204                    int end, OrderByComparator<T> orderByComparator) {
205                    return dlFileShortcutPersistence.findWithDynamicQuery(dynamicQuery,
206                            start, end, orderByComparator);
207            }
208    
209            /**
210             * Returns the number of rows matching the dynamic query.
211             *
212             * @param dynamicQuery the dynamic query
213             * @return the number of rows matching the dynamic query
214             */
215            @Override
216            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
217                    return dlFileShortcutPersistence.countWithDynamicQuery(dynamicQuery);
218            }
219    
220            /**
221             * Returns the number of rows matching the dynamic query.
222             *
223             * @param dynamicQuery the dynamic query
224             * @param projection the projection to apply to the query
225             * @return the number of rows matching the dynamic query
226             */
227            @Override
228            public long dynamicQueryCount(DynamicQuery dynamicQuery,
229                    Projection projection) {
230                    return dlFileShortcutPersistence.countWithDynamicQuery(dynamicQuery,
231                            projection);
232            }
233    
234            @Override
235            public DLFileShortcut fetchDLFileShortcut(long fileShortcutId) {
236                    return dlFileShortcutPersistence.fetchByPrimaryKey(fileShortcutId);
237            }
238    
239            /**
240             * Returns the document library file shortcut matching the UUID and group.
241             *
242             * @param uuid the document library file shortcut's UUID
243             * @param groupId the primary key of the group
244             * @return the matching document library file shortcut, or <code>null</code> if a matching document library file shortcut could not be found
245             */
246            @Override
247            public DLFileShortcut fetchDLFileShortcutByUuidAndGroupId(String uuid,
248                    long groupId) {
249                    return dlFileShortcutPersistence.fetchByUUID_G(uuid, groupId);
250            }
251    
252            /**
253             * Returns the document library file shortcut with the primary key.
254             *
255             * @param fileShortcutId the primary key of the document library file shortcut
256             * @return the document library file shortcut
257             * @throws PortalException if a document library file shortcut with the primary key could not be found
258             */
259            @Override
260            public DLFileShortcut getDLFileShortcut(long fileShortcutId)
261                    throws PortalException {
262                    return dlFileShortcutPersistence.findByPrimaryKey(fileShortcutId);
263            }
264    
265            @Override
266            public ActionableDynamicQuery getActionableDynamicQuery() {
267                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
268    
269                    actionableDynamicQuery.setBaseLocalService(dlFileShortcutLocalService);
270                    actionableDynamicQuery.setClassLoader(getClassLoader());
271                    actionableDynamicQuery.setModelClass(DLFileShortcut.class);
272    
273                    actionableDynamicQuery.setPrimaryKeyPropertyName("fileShortcutId");
274    
275                    return actionableDynamicQuery;
276            }
277    
278            @Override
279            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
280                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
281    
282                    indexableActionableDynamicQuery.setBaseLocalService(dlFileShortcutLocalService);
283                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
284                    indexableActionableDynamicQuery.setModelClass(DLFileShortcut.class);
285    
286                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
287                            "fileShortcutId");
288    
289                    return indexableActionableDynamicQuery;
290            }
291    
292            protected void initActionableDynamicQuery(
293                    ActionableDynamicQuery actionableDynamicQuery) {
294                    actionableDynamicQuery.setBaseLocalService(dlFileShortcutLocalService);
295                    actionableDynamicQuery.setClassLoader(getClassLoader());
296                    actionableDynamicQuery.setModelClass(DLFileShortcut.class);
297    
298                    actionableDynamicQuery.setPrimaryKeyPropertyName("fileShortcutId");
299            }
300    
301            @Override
302            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
303                    final PortletDataContext portletDataContext) {
304                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
305                                    @Override
306                                    public long performCount() throws PortalException {
307                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
308    
309                                            StagedModelType stagedModelType = getStagedModelType();
310    
311                                            long modelAdditionCount = super.performCount();
312    
313                                            manifestSummary.addModelAdditionCount(stagedModelType,
314                                                    modelAdditionCount);
315    
316                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
317                                                            stagedModelType);
318    
319                                            manifestSummary.addModelDeletionCount(stagedModelType,
320                                                    modelDeletionCount);
321    
322                                            return modelAdditionCount;
323                                    }
324                            };
325    
326                    initActionableDynamicQuery(exportActionableDynamicQuery);
327    
328                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
329                                    @Override
330                                    public void addCriteria(DynamicQuery dynamicQuery) {
331                                            Criterion modifiedDateCriterion = portletDataContext.getDateRangeCriteria(
332                                                            "modifiedDate");
333                                            Criterion statusDateCriterion = portletDataContext.getDateRangeCriteria(
334                                                            "statusDate");
335    
336                                            if ((modifiedDateCriterion != null) &&
337                                                            (statusDateCriterion != null)) {
338                                                    Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
339    
340                                                    disjunction.add(modifiedDateCriterion);
341                                                    disjunction.add(statusDateCriterion);
342    
343                                                    dynamicQuery.add(disjunction);
344                                            }
345    
346                                            Property workflowStatusProperty = PropertyFactoryUtil.forName(
347                                                            "status");
348    
349                                            if (portletDataContext.isInitialPublication()) {
350                                                    dynamicQuery.add(workflowStatusProperty.ne(
351                                                                    WorkflowConstants.STATUS_IN_TRASH));
352                                            }
353                                            else {
354                                                    StagedModelDataHandler<?> stagedModelDataHandler = StagedModelDataHandlerRegistryUtil.getStagedModelDataHandler(DLFileShortcut.class.getName());
355    
356                                                    dynamicQuery.add(workflowStatusProperty.in(
357                                                                    stagedModelDataHandler.getExportableStatuses()));
358                                            }
359                                    }
360                            });
361    
362                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
363    
364                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
365    
366                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<DLFileShortcut>() {
367                                    @Override
368                                    public void performAction(DLFileShortcut dlFileShortcut)
369                                            throws PortalException {
370                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
371                                                    dlFileShortcut);
372                                    }
373                            });
374                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
375                                    PortalUtil.getClassNameId(DLFileShortcut.class.getName())));
376    
377                    return exportActionableDynamicQuery;
378            }
379    
380            /**
381             * @throws PortalException
382             */
383            @Override
384            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
385                    throws PortalException {
386                    return dlFileShortcutLocalService.deleteDLFileShortcut((DLFileShortcut)persistedModel);
387            }
388    
389            @Override
390            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
391                    throws PortalException {
392                    return dlFileShortcutPersistence.findByPrimaryKey(primaryKeyObj);
393            }
394    
395            /**
396             * Returns all the document library file shortcuts matching the UUID and company.
397             *
398             * @param uuid the UUID of the document library file shortcuts
399             * @param companyId the primary key of the company
400             * @return the matching document library file shortcuts, or an empty list if no matches were found
401             */
402            @Override
403            public List<DLFileShortcut> getDLFileShortcutsByUuidAndCompanyId(
404                    String uuid, long companyId) {
405                    return dlFileShortcutPersistence.findByUuid_C(uuid, companyId);
406            }
407    
408            /**
409             * Returns a range of document library file shortcuts matching the UUID and company.
410             *
411             * @param uuid the UUID of the document library file shortcuts
412             * @param companyId the primary key of the company
413             * @param start the lower bound of the range of document library file shortcuts
414             * @param end the upper bound of the range of document library file shortcuts (not inclusive)
415             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
416             * @return the range of matching document library file shortcuts, or an empty list if no matches were found
417             */
418            @Override
419            public List<DLFileShortcut> getDLFileShortcutsByUuidAndCompanyId(
420                    String uuid, long companyId, int start, int end,
421                    OrderByComparator<DLFileShortcut> orderByComparator) {
422                    return dlFileShortcutPersistence.findByUuid_C(uuid, companyId, start,
423                            end, orderByComparator);
424            }
425    
426            /**
427             * Returns the document library file shortcut matching the UUID and group.
428             *
429             * @param uuid the document library file shortcut's UUID
430             * @param groupId the primary key of the group
431             * @return the matching document library file shortcut
432             * @throws PortalException if a matching document library file shortcut could not be found
433             */
434            @Override
435            public DLFileShortcut getDLFileShortcutByUuidAndGroupId(String uuid,
436                    long groupId) throws PortalException {
437                    return dlFileShortcutPersistence.findByUUID_G(uuid, groupId);
438            }
439    
440            /**
441             * Returns a range of all the document library file shortcuts.
442             *
443             * <p>
444             * 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.documentlibrary.model.impl.DLFileShortcutModelImpl}. 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.
445             * </p>
446             *
447             * @param start the lower bound of the range of document library file shortcuts
448             * @param end the upper bound of the range of document library file shortcuts (not inclusive)
449             * @return the range of document library file shortcuts
450             */
451            @Override
452            public List<DLFileShortcut> getDLFileShortcuts(int start, int end) {
453                    return dlFileShortcutPersistence.findAll(start, end);
454            }
455    
456            /**
457             * Returns the number of document library file shortcuts.
458             *
459             * @return the number of document library file shortcuts
460             */
461            @Override
462            public int getDLFileShortcutsCount() {
463                    return dlFileShortcutPersistence.countAll();
464            }
465    
466            /**
467             * Updates the document library file shortcut in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
468             *
469             * @param dlFileShortcut the document library file shortcut
470             * @return the document library file shortcut that was updated
471             */
472            @Indexable(type = IndexableType.REINDEX)
473            @Override
474            public DLFileShortcut updateDLFileShortcut(DLFileShortcut dlFileShortcut) {
475                    return dlFileShortcutPersistence.update(dlFileShortcut);
476            }
477    
478            /**
479             * Returns the document library file shortcut local service.
480             *
481             * @return the document library file shortcut local service
482             */
483            public DLFileShortcutLocalService getDLFileShortcutLocalService() {
484                    return dlFileShortcutLocalService;
485            }
486    
487            /**
488             * Sets the document library file shortcut local service.
489             *
490             * @param dlFileShortcutLocalService the document library file shortcut local service
491             */
492            public void setDLFileShortcutLocalService(
493                    DLFileShortcutLocalService dlFileShortcutLocalService) {
494                    this.dlFileShortcutLocalService = dlFileShortcutLocalService;
495            }
496    
497            /**
498             * Returns the document library file shortcut persistence.
499             *
500             * @return the document library file shortcut persistence
501             */
502            public DLFileShortcutPersistence getDLFileShortcutPersistence() {
503                    return dlFileShortcutPersistence;
504            }
505    
506            /**
507             * Sets the document library file shortcut persistence.
508             *
509             * @param dlFileShortcutPersistence the document library file shortcut persistence
510             */
511            public void setDLFileShortcutPersistence(
512                    DLFileShortcutPersistence dlFileShortcutPersistence) {
513                    this.dlFileShortcutPersistence = dlFileShortcutPersistence;
514            }
515    
516            /**
517             * Returns the counter local service.
518             *
519             * @return the counter local service
520             */
521            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
522                    return counterLocalService;
523            }
524    
525            /**
526             * Sets the counter local service.
527             *
528             * @param counterLocalService the counter local service
529             */
530            public void setCounterLocalService(
531                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
532                    this.counterLocalService = counterLocalService;
533            }
534    
535            /**
536             * Returns the resource local service.
537             *
538             * @return the resource local service
539             */
540            public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
541                    return resourceLocalService;
542            }
543    
544            /**
545             * Sets the resource local service.
546             *
547             * @param resourceLocalService the resource local service
548             */
549            public void setResourceLocalService(
550                    com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
551                    this.resourceLocalService = resourceLocalService;
552            }
553    
554            /**
555             * Returns the user local service.
556             *
557             * @return the user local service
558             */
559            public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
560                    return userLocalService;
561            }
562    
563            /**
564             * Sets the user local service.
565             *
566             * @param userLocalService the user local service
567             */
568            public void setUserLocalService(
569                    com.liferay.portal.kernel.service.UserLocalService userLocalService) {
570                    this.userLocalService = userLocalService;
571            }
572    
573            /**
574             * Returns the user persistence.
575             *
576             * @return the user persistence
577             */
578            public UserPersistence getUserPersistence() {
579                    return userPersistence;
580            }
581    
582            /**
583             * Sets the user persistence.
584             *
585             * @param userPersistence the user persistence
586             */
587            public void setUserPersistence(UserPersistence userPersistence) {
588                    this.userPersistence = userPersistence;
589            }
590    
591            /**
592             * Returns the user finder.
593             *
594             * @return the user finder
595             */
596            public UserFinder getUserFinder() {
597                    return userFinder;
598            }
599    
600            /**
601             * Sets the user finder.
602             *
603             * @param userFinder the user finder
604             */
605            public void setUserFinder(UserFinder userFinder) {
606                    this.userFinder = userFinder;
607            }
608    
609            /**
610             * Returns the asset entry local service.
611             *
612             * @return the asset entry local service
613             */
614            public com.liferay.asset.kernel.service.AssetEntryLocalService getAssetEntryLocalService() {
615                    return assetEntryLocalService;
616            }
617    
618            /**
619             * Sets the asset entry local service.
620             *
621             * @param assetEntryLocalService the asset entry local service
622             */
623            public void setAssetEntryLocalService(
624                    com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService) {
625                    this.assetEntryLocalService = assetEntryLocalService;
626            }
627    
628            /**
629             * Returns the asset entry persistence.
630             *
631             * @return the asset entry persistence
632             */
633            public AssetEntryPersistence getAssetEntryPersistence() {
634                    return assetEntryPersistence;
635            }
636    
637            /**
638             * Sets the asset entry persistence.
639             *
640             * @param assetEntryPersistence the asset entry persistence
641             */
642            public void setAssetEntryPersistence(
643                    AssetEntryPersistence assetEntryPersistence) {
644                    this.assetEntryPersistence = assetEntryPersistence;
645            }
646    
647            /**
648             * Returns the asset entry finder.
649             *
650             * @return the asset entry finder
651             */
652            public AssetEntryFinder getAssetEntryFinder() {
653                    return assetEntryFinder;
654            }
655    
656            /**
657             * Sets the asset entry finder.
658             *
659             * @param assetEntryFinder the asset entry finder
660             */
661            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
662                    this.assetEntryFinder = assetEntryFinder;
663            }
664    
665            /**
666             * Returns the asset tag local service.
667             *
668             * @return the asset tag local service
669             */
670            public com.liferay.asset.kernel.service.AssetTagLocalService getAssetTagLocalService() {
671                    return assetTagLocalService;
672            }
673    
674            /**
675             * Sets the asset tag local service.
676             *
677             * @param assetTagLocalService the asset tag local service
678             */
679            public void setAssetTagLocalService(
680                    com.liferay.asset.kernel.service.AssetTagLocalService assetTagLocalService) {
681                    this.assetTagLocalService = assetTagLocalService;
682            }
683    
684            /**
685             * Returns the asset tag persistence.
686             *
687             * @return the asset tag persistence
688             */
689            public AssetTagPersistence getAssetTagPersistence() {
690                    return assetTagPersistence;
691            }
692    
693            /**
694             * Sets the asset tag persistence.
695             *
696             * @param assetTagPersistence the asset tag persistence
697             */
698            public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
699                    this.assetTagPersistence = assetTagPersistence;
700            }
701    
702            /**
703             * Returns the asset tag finder.
704             *
705             * @return the asset tag finder
706             */
707            public AssetTagFinder getAssetTagFinder() {
708                    return assetTagFinder;
709            }
710    
711            /**
712             * Sets the asset tag finder.
713             *
714             * @param assetTagFinder the asset tag finder
715             */
716            public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
717                    this.assetTagFinder = assetTagFinder;
718            }
719    
720            /**
721             * Returns the d l app local service.
722             *
723             * @return the d l app local service
724             */
725            public com.liferay.document.library.kernel.service.DLAppLocalService getDLAppLocalService() {
726                    return dlAppLocalService;
727            }
728    
729            /**
730             * Sets the d l app local service.
731             *
732             * @param dlAppLocalService the d l app local service
733             */
734            public void setDLAppLocalService(
735                    com.liferay.document.library.kernel.service.DLAppLocalService dlAppLocalService) {
736                    this.dlAppLocalService = dlAppLocalService;
737            }
738    
739            /**
740             * Returns the trash entry local service.
741             *
742             * @return the trash entry local service
743             */
744            public com.liferay.trash.kernel.service.TrashEntryLocalService getTrashEntryLocalService() {
745                    return trashEntryLocalService;
746            }
747    
748            /**
749             * Sets the trash entry local service.
750             *
751             * @param trashEntryLocalService the trash entry local service
752             */
753            public void setTrashEntryLocalService(
754                    com.liferay.trash.kernel.service.TrashEntryLocalService trashEntryLocalService) {
755                    this.trashEntryLocalService = trashEntryLocalService;
756            }
757    
758            /**
759             * Returns the trash entry persistence.
760             *
761             * @return the trash entry persistence
762             */
763            public TrashEntryPersistence getTrashEntryPersistence() {
764                    return trashEntryPersistence;
765            }
766    
767            /**
768             * Sets the trash entry persistence.
769             *
770             * @param trashEntryPersistence the trash entry persistence
771             */
772            public void setTrashEntryPersistence(
773                    TrashEntryPersistence trashEntryPersistence) {
774                    this.trashEntryPersistence = trashEntryPersistence;
775            }
776    
777            /**
778             * Returns the trash version local service.
779             *
780             * @return the trash version local service
781             */
782            public com.liferay.trash.kernel.service.TrashVersionLocalService getTrashVersionLocalService() {
783                    return trashVersionLocalService;
784            }
785    
786            /**
787             * Sets the trash version local service.
788             *
789             * @param trashVersionLocalService the trash version local service
790             */
791            public void setTrashVersionLocalService(
792                    com.liferay.trash.kernel.service.TrashVersionLocalService trashVersionLocalService) {
793                    this.trashVersionLocalService = trashVersionLocalService;
794            }
795    
796            /**
797             * Returns the trash version persistence.
798             *
799             * @return the trash version persistence
800             */
801            public TrashVersionPersistence getTrashVersionPersistence() {
802                    return trashVersionPersistence;
803            }
804    
805            /**
806             * Sets the trash version persistence.
807             *
808             * @param trashVersionPersistence the trash version persistence
809             */
810            public void setTrashVersionPersistence(
811                    TrashVersionPersistence trashVersionPersistence) {
812                    this.trashVersionPersistence = trashVersionPersistence;
813            }
814    
815            /**
816             * Returns the document library folder local service.
817             *
818             * @return the document library folder local service
819             */
820            public com.liferay.document.library.kernel.service.DLFolderLocalService getDLFolderLocalService() {
821                    return dlFolderLocalService;
822            }
823    
824            /**
825             * Sets the document library folder local service.
826             *
827             * @param dlFolderLocalService the document library folder local service
828             */
829            public void setDLFolderLocalService(
830                    com.liferay.document.library.kernel.service.DLFolderLocalService dlFolderLocalService) {
831                    this.dlFolderLocalService = dlFolderLocalService;
832            }
833    
834            /**
835             * Returns the document library folder persistence.
836             *
837             * @return the document library folder persistence
838             */
839            public DLFolderPersistence getDLFolderPersistence() {
840                    return dlFolderPersistence;
841            }
842    
843            /**
844             * Sets the document library folder persistence.
845             *
846             * @param dlFolderPersistence the document library folder persistence
847             */
848            public void setDLFolderPersistence(DLFolderPersistence dlFolderPersistence) {
849                    this.dlFolderPersistence = dlFolderPersistence;
850            }
851    
852            /**
853             * Returns the document library folder finder.
854             *
855             * @return the document library folder finder
856             */
857            public DLFolderFinder getDLFolderFinder() {
858                    return dlFolderFinder;
859            }
860    
861            /**
862             * Sets the document library folder finder.
863             *
864             * @param dlFolderFinder the document library folder finder
865             */
866            public void setDLFolderFinder(DLFolderFinder dlFolderFinder) {
867                    this.dlFolderFinder = dlFolderFinder;
868            }
869    
870            public void afterPropertiesSet() {
871                    persistedModelLocalServiceRegistry.register("com.liferay.document.library.kernel.model.DLFileShortcut",
872                            dlFileShortcutLocalService);
873            }
874    
875            public void destroy() {
876                    persistedModelLocalServiceRegistry.unregister(
877                            "com.liferay.document.library.kernel.model.DLFileShortcut");
878            }
879    
880            /**
881             * Returns the OSGi service identifier.
882             *
883             * @return the OSGi service identifier
884             */
885            @Override
886            public String getOSGiServiceIdentifier() {
887                    return DLFileShortcutLocalService.class.getName();
888            }
889    
890            protected Class<?> getModelClass() {
891                    return DLFileShortcut.class;
892            }
893    
894            protected String getModelClassName() {
895                    return DLFileShortcut.class.getName();
896            }
897    
898            /**
899             * Performs a SQL query.
900             *
901             * @param sql the sql query
902             */
903            protected void runSQL(String sql) {
904                    try {
905                            DataSource dataSource = dlFileShortcutPersistence.getDataSource();
906    
907                            DB db = DBManagerUtil.getDB();
908    
909                            sql = db.buildSQL(sql);
910                            sql = PortalUtil.transformSQL(sql);
911    
912                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
913                                            sql);
914    
915                            sqlUpdate.update();
916                    }
917                    catch (Exception e) {
918                            throw new SystemException(e);
919                    }
920            }
921    
922            @BeanReference(type = DLFileShortcutLocalService.class)
923            protected DLFileShortcutLocalService dlFileShortcutLocalService;
924            @BeanReference(type = DLFileShortcutPersistence.class)
925            protected DLFileShortcutPersistence dlFileShortcutPersistence;
926            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
927            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
928            @BeanReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
929            protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
930            @BeanReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
931            protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
932            @BeanReference(type = UserPersistence.class)
933            protected UserPersistence userPersistence;
934            @BeanReference(type = UserFinder.class)
935            protected UserFinder userFinder;
936            @BeanReference(type = com.liferay.asset.kernel.service.AssetEntryLocalService.class)
937            protected com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService;
938            @BeanReference(type = AssetEntryPersistence.class)
939            protected AssetEntryPersistence assetEntryPersistence;
940            @BeanReference(type = AssetEntryFinder.class)
941            protected AssetEntryFinder assetEntryFinder;
942            @BeanReference(type = com.liferay.asset.kernel.service.AssetTagLocalService.class)
943            protected com.liferay.asset.kernel.service.AssetTagLocalService assetTagLocalService;
944            @BeanReference(type = AssetTagPersistence.class)
945            protected AssetTagPersistence assetTagPersistence;
946            @BeanReference(type = AssetTagFinder.class)
947            protected AssetTagFinder assetTagFinder;
948            @BeanReference(type = com.liferay.document.library.kernel.service.DLAppLocalService.class)
949            protected com.liferay.document.library.kernel.service.DLAppLocalService dlAppLocalService;
950            @BeanReference(type = com.liferay.trash.kernel.service.TrashEntryLocalService.class)
951            protected com.liferay.trash.kernel.service.TrashEntryLocalService trashEntryLocalService;
952            @BeanReference(type = TrashEntryPersistence.class)
953            protected TrashEntryPersistence trashEntryPersistence;
954            @BeanReference(type = com.liferay.trash.kernel.service.TrashVersionLocalService.class)
955            protected com.liferay.trash.kernel.service.TrashVersionLocalService trashVersionLocalService;
956            @BeanReference(type = TrashVersionPersistence.class)
957            protected TrashVersionPersistence trashVersionPersistence;
958            @BeanReference(type = com.liferay.document.library.kernel.service.DLFolderLocalService.class)
959            protected com.liferay.document.library.kernel.service.DLFolderLocalService dlFolderLocalService;
960            @BeanReference(type = DLFolderPersistence.class)
961            protected DLFolderPersistence dlFolderPersistence;
962            @BeanReference(type = DLFolderFinder.class)
963            protected DLFolderFinder dlFolderFinder;
964            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
965            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
966    }