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;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.systemevent.SystemEvent;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.OrderByComparator;
033    import com.liferay.portal.model.PersistedModel;
034    import com.liferay.portal.model.SystemEventConstants;
035    import com.liferay.portal.service.BaseLocalService;
036    import com.liferay.portal.service.PersistedModelLocalService;
037    import com.liferay.portal.service.ServiceContext;
038    import com.liferay.portal.service.permission.ModelPermissions;
039    
040    import com.liferay.portlet.documentlibrary.model.DLFileShortcut;
041    import com.liferay.portlet.exportimport.lar.PortletDataContext;
042    
043    import java.io.Serializable;
044    
045    import java.util.List;
046    
047    /**
048     * Provides the local service interface for DLFileShortcut. Methods of this
049     * service will not have security checks based on the propagated JAAS
050     * credentials because this service can only be accessed from within the same
051     * VM.
052     *
053     * @author Brian Wing Shun Chan
054     * @see DLFileShortcutLocalServiceUtil
055     * @see com.liferay.portlet.documentlibrary.service.base.DLFileShortcutLocalServiceBaseImpl
056     * @see com.liferay.portlet.documentlibrary.service.impl.DLFileShortcutLocalServiceImpl
057     * @generated
058     */
059    @ProviderType
060    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
061            PortalException.class, SystemException.class})
062    public interface DLFileShortcutLocalService extends BaseLocalService,
063            PersistedModelLocalService {
064            /*
065             * NOTE FOR DEVELOPERS:
066             *
067             * Never modify or reference this interface directly. Always use {@link DLFileShortcutLocalServiceUtil} to access the document library file shortcut local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileShortcutLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
068             */
069    
070            /**
071            * Adds the document library file shortcut to the database. Also notifies the appropriate model listeners.
072            *
073            * @param dlFileShortcut the document library file shortcut
074            * @return the document library file shortcut that was added
075            */
076            @Indexable(type = IndexableType.REINDEX)
077            public DLFileShortcut addDLFileShortcut(DLFileShortcut dlFileShortcut);
078    
079            public DLFileShortcut addFileShortcut(long userId, long groupId,
080                    long repositoryId, long folderId, long toFileEntryId,
081                    ServiceContext serviceContext) throws PortalException;
082    
083            public void addFileShortcutResources(DLFileShortcut fileShortcut,
084                    boolean addGroupPermissions, boolean addGuestPermissions)
085                    throws PortalException;
086    
087            public void addFileShortcutResources(DLFileShortcut fileShortcut,
088                    ModelPermissions modelPermissions) throws PortalException;
089    
090            public void addFileShortcutResources(long fileShortcutId,
091                    boolean addGroupPermissions, boolean addGuestPermissions)
092                    throws PortalException;
093    
094            public void addFileShortcutResources(long fileShortcutId,
095                    ModelPermissions modelPermissions) throws PortalException;
096    
097            /**
098            * Creates a new document library file shortcut with the primary key. Does not add the document library file shortcut to the database.
099            *
100            * @param fileShortcutId the primary key for the new document library file shortcut
101            * @return the new document library file shortcut
102            */
103            public DLFileShortcut createDLFileShortcut(long fileShortcutId);
104    
105            /**
106            * Deletes the document library file shortcut from the database. Also notifies the appropriate model listeners.
107            *
108            * @param dlFileShortcut the document library file shortcut
109            * @return the document library file shortcut that was removed
110            */
111            @Indexable(type = IndexableType.DELETE)
112            public DLFileShortcut deleteDLFileShortcut(DLFileShortcut dlFileShortcut);
113    
114            /**
115            * Deletes the document library file shortcut with the primary key from the database. Also notifies the appropriate model listeners.
116            *
117            * @param fileShortcutId the primary key of the document library file shortcut
118            * @return the document library file shortcut that was removed
119            * @throws PortalException if a document library file shortcut with the primary key could not be found
120            */
121            @Indexable(type = IndexableType.DELETE)
122            public DLFileShortcut deleteDLFileShortcut(long fileShortcutId)
123                    throws PortalException;
124    
125            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
126            public void deleteFileShortcut(DLFileShortcut fileShortcut)
127                    throws PortalException;
128    
129            public void deleteFileShortcut(long fileShortcutId)
130                    throws PortalException;
131    
132            public void deleteFileShortcuts(long groupId, long folderId)
133                    throws PortalException;
134    
135            public void deleteFileShortcuts(long groupId, long folderId,
136                    boolean includeTrashedEntries) throws PortalException;
137    
138            public void deleteFileShortcuts(long toFileEntryId)
139                    throws PortalException;
140    
141            /**
142            * @throws PortalException
143            */
144            @Override
145            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
146                    throws PortalException;
147    
148            public void disableFileShortcuts(long toFileEntryId);
149    
150            public DynamicQuery dynamicQuery();
151    
152            /**
153            * Performs a dynamic query on the database and returns the matching rows.
154            *
155            * @param dynamicQuery the dynamic query
156            * @return the matching rows
157            */
158            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
159    
160            /**
161            * Performs a dynamic query on the database and returns a range of the matching rows.
162            *
163            * <p>
164            * 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.
165            * </p>
166            *
167            * @param dynamicQuery the dynamic query
168            * @param start the lower bound of the range of model instances
169            * @param end the upper bound of the range of model instances (not inclusive)
170            * @return the range of matching rows
171            */
172            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
173                    int end);
174    
175            /**
176            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
177            *
178            * <p>
179            * 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.
180            * </p>
181            *
182            * @param dynamicQuery the dynamic query
183            * @param start the lower bound of the range of model instances
184            * @param end the upper bound of the range of model instances (not inclusive)
185            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
186            * @return the ordered range of matching rows
187            */
188            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
189                    int end, OrderByComparator<T> orderByComparator);
190    
191            /**
192            * Returns the number of rows matching the dynamic query.
193            *
194            * @param dynamicQuery the dynamic query
195            * @return the number of rows matching the dynamic query
196            */
197            public long dynamicQueryCount(DynamicQuery dynamicQuery);
198    
199            /**
200            * Returns the number of rows matching the dynamic query.
201            *
202            * @param dynamicQuery the dynamic query
203            * @param projection the projection to apply to the query
204            * @return the number of rows matching the dynamic query
205            */
206            public long dynamicQueryCount(DynamicQuery dynamicQuery,
207                    Projection projection);
208    
209            public void enableFileShortcuts(long toFileEntryId);
210    
211            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
212            public DLFileShortcut fetchDLFileShortcut(long fileShortcutId);
213    
214            /**
215            * Returns the document library file shortcut matching the UUID and group.
216            *
217            * @param uuid the document library file shortcut's UUID
218            * @param groupId the primary key of the group
219            * @return the matching document library file shortcut, or <code>null</code> if a matching document library file shortcut could not be found
220            */
221            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
222            public DLFileShortcut fetchDLFileShortcutByUuidAndGroupId(
223                    java.lang.String uuid, long groupId);
224    
225            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
226            public ActionableDynamicQuery getActionableDynamicQuery();
227    
228            /**
229            * Returns the document library file shortcut with the primary key.
230            *
231            * @param fileShortcutId the primary key of the document library file shortcut
232            * @return the document library file shortcut
233            * @throws PortalException if a document library file shortcut with the primary key could not be found
234            */
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public DLFileShortcut getDLFileShortcut(long fileShortcutId)
237                    throws PortalException;
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
245            * @throws PortalException if a matching document library file shortcut could not be found
246            */
247            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
248            public DLFileShortcut getDLFileShortcutByUuidAndGroupId(
249                    java.lang.String uuid, long groupId) throws PortalException;
250    
251            /**
252            * Returns a range of all the document library file shortcuts.
253            *
254            * <p>
255            * 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.
256            * </p>
257            *
258            * @param start the lower bound of the range of document library file shortcuts
259            * @param end the upper bound of the range of document library file shortcuts (not inclusive)
260            * @return the range of document library file shortcuts
261            */
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public List<DLFileShortcut> getDLFileShortcuts(int start, int end);
264    
265            /**
266            * Returns all the document library file shortcuts matching the UUID and company.
267            *
268            * @param uuid the UUID of the document library file shortcuts
269            * @param companyId the primary key of the company
270            * @return the matching document library file shortcuts, or an empty list if no matches were found
271            */
272            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
273            public List<DLFileShortcut> getDLFileShortcutsByUuidAndCompanyId(
274                    java.lang.String uuid, long companyId);
275    
276            /**
277            * Returns a range of document library file shortcuts matching the UUID and company.
278            *
279            * @param uuid the UUID of the document library file shortcuts
280            * @param companyId the primary key of the company
281            * @param start the lower bound of the range of document library file shortcuts
282            * @param end the upper bound of the range of document library file shortcuts (not inclusive)
283            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
284            * @return the range of matching document library file shortcuts, or an empty list if no matches were found
285            */
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public List<DLFileShortcut> getDLFileShortcutsByUuidAndCompanyId(
288                    java.lang.String uuid, long companyId, int start, int end,
289                    OrderByComparator<DLFileShortcut> orderByComparator);
290    
291            /**
292            * Returns the number of document library file shortcuts.
293            *
294            * @return the number of document library file shortcuts
295            */
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public int getDLFileShortcutsCount();
298    
299            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
300            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
301                    PortletDataContext portletDataContext);
302    
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public DLFileShortcut getFileShortcut(long fileShortcutId)
305                    throws PortalException;
306    
307            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
308            public List<DLFileShortcut> getFileShortcuts(long groupId, long folderId,
309                    boolean active, int status, int start, int end);
310    
311            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312            public List<DLFileShortcut> getFileShortcuts(long toFileEntryId);
313    
314            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
315            public int getFileShortcutsCount(long groupId, long folderId,
316                    boolean active, int status);
317    
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
320    
321            /**
322            * Returns the OSGi service identifier.
323            *
324            * @return the OSGi service identifier
325            */
326            public java.lang.String getOSGiServiceIdentifier();
327    
328            @Override
329            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
331                    throws PortalException;
332    
333            public void rebuildTree(long companyId) throws PortalException;
334    
335            public void setTreePaths(long folderId, java.lang.String treePath)
336                    throws PortalException;
337    
338            public void updateAsset(long userId, DLFileShortcut fileShortcut,
339                    long[] assetCategoryIds, java.lang.String[] assetTagNames)
340                    throws PortalException;
341    
342            /**
343            * Updates the document library file shortcut in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
344            *
345            * @param dlFileShortcut the document library file shortcut
346            * @return the document library file shortcut that was updated
347            */
348            @Indexable(type = IndexableType.REINDEX)
349            public DLFileShortcut updateDLFileShortcut(DLFileShortcut dlFileShortcut);
350    
351            public DLFileShortcut updateFileShortcut(long userId, long fileShortcutId,
352                    long repositoryId, long folderId, long toFileEntryId,
353                    ServiceContext serviceContext) throws PortalException;
354    
355            public void updateFileShortcuts(long oldToFileEntryId, long newToFileEntryId);
356    
357            public void updateFileShortcutsActive(long toFileEntryId, boolean active);
358    
359            public void updateStatus(long userId, long fileShortcutId, int status,
360                    ServiceContext serviceContext) throws PortalException;
361    }