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