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.DLFileEntry;
020    import com.liferay.document.library.kernel.model.DLFileEntryType;
021    import com.liferay.document.library.kernel.model.DLFolder;
022    
023    import com.liferay.exportimport.kernel.lar.PortletDataContext;
024    
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.model.PersistedModel;
033    import com.liferay.portal.kernel.model.SystemEventConstants;
034    import com.liferay.portal.kernel.search.Indexable;
035    import com.liferay.portal.kernel.search.IndexableType;
036    import com.liferay.portal.kernel.service.BaseLocalService;
037    import com.liferay.portal.kernel.service.PersistedModelLocalService;
038    import com.liferay.portal.kernel.service.ServiceContext;
039    import com.liferay.portal.kernel.systemevent.SystemEvent;
040    import com.liferay.portal.kernel.transaction.Isolation;
041    import com.liferay.portal.kernel.transaction.Propagation;
042    import com.liferay.portal.kernel.transaction.Transactional;
043    import com.liferay.portal.kernel.util.OrderByComparator;
044    
045    import java.io.Serializable;
046    
047    import java.util.List;
048    import java.util.Locale;
049    import java.util.Map;
050    import java.util.Set;
051    
052    /**
053     * Provides the local service interface for DLFileEntryType. Methods of this
054     * service will not have security checks based on the propagated JAAS
055     * credentials because this service can only be accessed from within the same
056     * VM.
057     *
058     * @author Brian Wing Shun Chan
059     * @see DLFileEntryTypeLocalServiceUtil
060     * @see com.liferay.portlet.documentlibrary.service.base.DLFileEntryTypeLocalServiceBaseImpl
061     * @see com.liferay.portlet.documentlibrary.service.impl.DLFileEntryTypeLocalServiceImpl
062     * @generated
063     */
064    @ProviderType
065    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
066            PortalException.class, SystemException.class})
067    public interface DLFileEntryTypeLocalService extends BaseLocalService,
068            PersistedModelLocalService {
069            /*
070             * NOTE FOR DEVELOPERS:
071             *
072             * Never modify or reference this interface directly. Always use {@link DLFileEntryTypeLocalServiceUtil} to access the document library file entry type local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileEntryTypeLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
073             */
074            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
075            public boolean hasDLFolderDLFileEntryType(long folderId,
076                    long fileEntryTypeId);
077    
078            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
079            public boolean hasDLFolderDLFileEntryTypes(long folderId);
080    
081            public DLFileEntry updateFileEntryFileEntryType(DLFileEntry dlFileEntry,
082                    ServiceContext serviceContext) throws PortalException;
083    
084            /**
085            * Adds the document library file entry type to the database. Also notifies the appropriate model listeners.
086            *
087            * @param dlFileEntryType the document library file entry type
088            * @return the document library file entry type that was added
089            */
090            @Indexable(type = IndexableType.REINDEX)
091            public DLFileEntryType addDLFileEntryType(DLFileEntryType dlFileEntryType);
092    
093            public DLFileEntryType addFileEntryType(long userId, long groupId,
094                    java.lang.String fileEntryTypeKey,
095                    Map<Locale, java.lang.String> nameMap,
096                    Map<Locale, java.lang.String> descriptionMap, long[] ddmStructureIds,
097                    ServiceContext serviceContext) throws PortalException;
098    
099            public DLFileEntryType addFileEntryType(long userId, long groupId,
100                    java.lang.String name, java.lang.String description,
101                    long[] ddmStructureIds, ServiceContext serviceContext)
102                    throws PortalException;
103    
104            /**
105            * Creates a new document library file entry type with the primary key. Does not add the document library file entry type to the database.
106            *
107            * @param fileEntryTypeId the primary key for the new document library file entry type
108            * @return the new document library file entry type
109            */
110            public DLFileEntryType createDLFileEntryType(long fileEntryTypeId);
111    
112            /**
113            * Deletes the document library file entry type from the database. Also notifies the appropriate model listeners.
114            *
115            * @param dlFileEntryType the document library file entry type
116            * @return the document library file entry type that was removed
117            */
118            @Indexable(type = IndexableType.DELETE)
119            public DLFileEntryType deleteDLFileEntryType(
120                    DLFileEntryType dlFileEntryType);
121    
122            /**
123            * Deletes the document library file entry type with the primary key from the database. Also notifies the appropriate model listeners.
124            *
125            * @param fileEntryTypeId the primary key of the document library file entry type
126            * @return the document library file entry type that was removed
127            * @throws PortalException if a document library file entry type with the primary key could not be found
128            */
129            @Indexable(type = IndexableType.DELETE)
130            public DLFileEntryType deleteDLFileEntryType(long fileEntryTypeId)
131                    throws PortalException;
132    
133            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134            public DLFileEntryType fetchDLFileEntryType(long fileEntryTypeId);
135    
136            /**
137            * Returns the document library file entry type matching the UUID and group.
138            *
139            * @param uuid the document library file entry type's UUID
140            * @param groupId the primary key of the group
141            * @return the matching document library file entry type, or <code>null</code> if a matching document library file entry type could not be found
142            */
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public DLFileEntryType fetchDLFileEntryTypeByUuidAndGroupId(
145                    java.lang.String uuid, long groupId);
146    
147            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148            public DLFileEntryType fetchFileEntryType(long fileEntryTypeId);
149    
150            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
151            public DLFileEntryType fetchFileEntryType(long groupId,
152                    java.lang.String fileEntryTypeKey);
153    
154            /**
155            * Returns the document library file entry type with the primary key.
156            *
157            * @param fileEntryTypeId the primary key of the document library file entry type
158            * @return the document library file entry type
159            * @throws PortalException if a document library file entry type with the primary key could not be found
160            */
161            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162            public DLFileEntryType getDLFileEntryType(long fileEntryTypeId)
163                    throws PortalException;
164    
165            /**
166            * Returns the document library file entry type matching the UUID and group.
167            *
168            * @param uuid the document library file entry type's UUID
169            * @param groupId the primary key of the group
170            * @return the matching document library file entry type
171            * @throws PortalException if a matching document library file entry type could not be found
172            */
173            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174            public DLFileEntryType getDLFileEntryTypeByUuidAndGroupId(
175                    java.lang.String uuid, long groupId) throws PortalException;
176    
177            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178            public DLFileEntryType getFileEntryType(long fileEntryTypeId)
179                    throws PortalException;
180    
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public DLFileEntryType getFileEntryType(long groupId,
183                    java.lang.String fileEntryTypeKey) throws PortalException;
184    
185            /**
186            * Updates the document library file entry type in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
187            *
188            * @param dlFileEntryType the document library file entry type
189            * @return the document library file entry type that was updated
190            */
191            @Indexable(type = IndexableType.REINDEX)
192            public DLFileEntryType updateDLFileEntryType(
193                    DLFileEntryType dlFileEntryType);
194    
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public ActionableDynamicQuery getActionableDynamicQuery();
197    
198            public DynamicQuery dynamicQuery();
199    
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
202                    PortletDataContext portletDataContext);
203    
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
206    
207            /**
208            * @throws PortalException
209            */
210            @Override
211            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
212                    throws PortalException;
213    
214            @Override
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
217                    throws PortalException;
218    
219            /**
220            * Returns the number of document library file entry types.
221            *
222            * @return the number of document library file entry types
223            */
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public int getDLFileEntryTypesCount();
226    
227            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
228            public int getDLFolderDLFileEntryTypesCount(long folderId);
229    
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public int searchCount(long companyId, long[] groupIds,
232                    java.lang.String keywords, boolean includeBasicFileEntryType);
233    
234            /**
235            * Returns the OSGi service identifier.
236            *
237            * @return the OSGi service identifier
238            */
239            public java.lang.String getOSGiServiceIdentifier();
240    
241            /**
242            * Performs a dynamic query on the database and returns the matching rows.
243            *
244            * @param dynamicQuery the dynamic query
245            * @return the matching rows
246            */
247            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
248    
249            /**
250            * Performs a dynamic query on the database and returns a range of the matching rows.
251            *
252            * <p>
253            * 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.DLFileEntryTypeModelImpl}. 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.
254            * </p>
255            *
256            * @param dynamicQuery the dynamic query
257            * @param start the lower bound of the range of model instances
258            * @param end the upper bound of the range of model instances (not inclusive)
259            * @return the range of matching rows
260            */
261            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
262                    int end);
263    
264            /**
265            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
266            *
267            * <p>
268            * 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.DLFileEntryTypeModelImpl}. 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.
269            * </p>
270            *
271            * @param dynamicQuery the dynamic query
272            * @param start the lower bound of the range of model instances
273            * @param end the upper bound of the range of model instances (not inclusive)
274            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
275            * @return the ordered range of matching rows
276            */
277            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
278                    int end, OrderByComparator<T> orderByComparator);
279    
280            /**
281            * Returns a range of all the document library file entry types.
282            *
283            * <p>
284            * 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.DLFileEntryTypeModelImpl}. 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.
285            * </p>
286            *
287            * @param start the lower bound of the range of document library file entry types
288            * @param end the upper bound of the range of document library file entry types (not inclusive)
289            * @return the range of document library file entry types
290            */
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public List<DLFileEntryType> getDLFileEntryTypes(int start, int end);
293    
294            /**
295            * Returns all the document library file entry types matching the UUID and company.
296            *
297            * @param uuid the UUID of the document library file entry types
298            * @param companyId the primary key of the company
299            * @return the matching document library file entry types, or an empty list if no matches were found
300            */
301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302            public List<DLFileEntryType> getDLFileEntryTypesByUuidAndCompanyId(
303                    java.lang.String uuid, long companyId);
304    
305            /**
306            * Returns a range of document library file entry types matching the UUID and company.
307            *
308            * @param uuid the UUID of the document library file entry types
309            * @param companyId the primary key of the company
310            * @param start the lower bound of the range of document library file entry types
311            * @param end the upper bound of the range of document library file entry types (not inclusive)
312            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
313            * @return the range of matching document library file entry types, or an empty list if no matches were found
314            */
315            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
316            public List<DLFileEntryType> getDLFileEntryTypesByUuidAndCompanyId(
317                    java.lang.String uuid, long companyId, int start, int end,
318                    OrderByComparator<DLFileEntryType> orderByComparator);
319    
320            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
321            public List<DLFileEntryType> getDLFolderDLFileEntryTypes(long folderId);
322    
323            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
324            public List<DLFileEntryType> getDLFolderDLFileEntryTypes(long folderId,
325                    int start, int end);
326    
327            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
328            public List<DLFileEntryType> getDLFolderDLFileEntryTypes(long folderId,
329                    int start, int end, OrderByComparator<DLFileEntryType> orderByComparator);
330    
331            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
332            public List<DLFileEntryType> getFileEntryTypes(long ddmStructureId)
333                    throws PortalException;
334    
335            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336            public List<DLFileEntryType> getFileEntryTypes(long[] groupIds);
337    
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public List<DLFileEntryType> getFolderFileEntryTypes(long[] groupIds,
340                    long folderId, boolean inherited) throws PortalException;
341    
342            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
343            public List<DLFileEntryType> search(long companyId, long[] groupIds,
344                    java.lang.String keywords, boolean includeBasicFileEntryType,
345                    int start, int end, OrderByComparator<DLFileEntryType> orderByComparator);
346    
347            /**
348            * Returns the number of rows matching the dynamic query.
349            *
350            * @param dynamicQuery the dynamic query
351            * @return the number of rows matching the dynamic query
352            */
353            public long dynamicQueryCount(DynamicQuery dynamicQuery);
354    
355            /**
356            * Returns the number of rows matching the dynamic query.
357            *
358            * @param dynamicQuery the dynamic query
359            * @param projection the projection to apply to the query
360            * @return the number of rows matching the dynamic query
361            */
362            public long dynamicQueryCount(DynamicQuery dynamicQuery,
363                    Projection projection);
364    
365            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
366            public long getDefaultFileEntryTypeId(long folderId)
367                    throws PortalException;
368    
369            /**
370            * Returns the folderIds of the document library folders associated with the document library file entry type.
371            *
372            * @param fileEntryTypeId the fileEntryTypeId of the document library file entry type
373            * @return long[] the folderIds of document library folders associated with the document library file entry type
374            */
375            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
376            public long[] getDLFolderPrimaryKeys(long fileEntryTypeId);
377    
378            public void addDDMStructureLinks(long fileEntryTypeId,
379                    Set<java.lang.Long> ddmStructureIds);
380    
381            public void addDLFolderDLFileEntryType(long folderId,
382                    DLFileEntryType dlFileEntryType);
383    
384            public void addDLFolderDLFileEntryType(long folderId, long fileEntryTypeId);
385    
386            public void addDLFolderDLFileEntryTypes(long folderId,
387                    List<DLFileEntryType> dlFileEntryTypes);
388    
389            public void addDLFolderDLFileEntryTypes(long folderId,
390                    long[] fileEntryTypeIds);
391    
392            public void cascadeFileEntryTypes(long userId, DLFolder dlFolder)
393                    throws PortalException;
394    
395            public void clearDLFolderDLFileEntryTypes(long folderId);
396    
397            public void deleteDLFolderDLFileEntryType(long folderId,
398                    DLFileEntryType dlFileEntryType);
399    
400            public void deleteDLFolderDLFileEntryType(long folderId,
401                    long fileEntryTypeId);
402    
403            public void deleteDLFolderDLFileEntryTypes(long folderId,
404                    List<DLFileEntryType> dlFileEntryTypes);
405    
406            public void deleteDLFolderDLFileEntryTypes(long folderId,
407                    long[] fileEntryTypeIds);
408    
409            @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
410            public void deleteFileEntryType(DLFileEntryType dlFileEntryType)
411                    throws PortalException;
412    
413            public void deleteFileEntryType(long fileEntryTypeId)
414                    throws PortalException;
415    
416            public void deleteFileEntryTypes(long groupId) throws PortalException;
417    
418            public void setDLFolderDLFileEntryTypes(long folderId,
419                    long[] fileEntryTypeIds);
420    
421            public void unsetFolderFileEntryTypes(long folderId);
422    
423            public void updateDDMStructureLinks(long fileEntryTypeId,
424                    Set<java.lang.Long> ddmStructureIds) throws PortalException;
425    
426            public void updateFileEntryType(long userId, long fileEntryTypeId,
427                    java.lang.String name, java.lang.String description,
428                    long[] ddmStructureIds, ServiceContext serviceContext)
429                    throws PortalException;
430    
431            public void updateFileEntryType(long userId, long fileEntryTypeId,
432                    Map<Locale, java.lang.String> nameMap,
433                    Map<Locale, java.lang.String> descriptionMap, long[] ddmStructureIds,
434                    ServiceContext serviceContext) throws PortalException;
435    
436            public void updateFolderFileEntryTypes(DLFolder dlFolder,
437                    List<java.lang.Long> fileEntryTypeIds, long defaultFileEntryTypeId,
438                    ServiceContext serviceContext);
439    }