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