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.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    import com.liferay.portal.service.BaseLocalService;
026    import com.liferay.portal.service.PersistedModelLocalService;
027    
028    /**
029     * Provides the local service interface for DLContent. Methods of this
030     * service will not have security checks based on the propagated JAAS
031     * credentials because this service can only be accessed from within the same
032     * VM.
033     *
034     * @author Brian Wing Shun Chan
035     * @see DLContentLocalServiceUtil
036     * @see com.liferay.portlet.documentlibrary.service.base.DLContentLocalServiceBaseImpl
037     * @see com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl
038     * @generated
039     */
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface DLContentLocalService extends BaseLocalService,
044            PersistedModelLocalService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link DLContentLocalServiceUtil} to access the document library content local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050            public com.liferay.portlet.documentlibrary.model.DLContent addContent(
051                    long companyId, long repositoryId, java.lang.String path,
052                    java.lang.String version, byte[] bytes);
053    
054            public com.liferay.portlet.documentlibrary.model.DLContent addContent(
055                    long companyId, long repositoryId, java.lang.String path,
056                    java.lang.String version, java.io.InputStream inputStream, long size);
057    
058            /**
059            * Adds the document library content to the database. Also notifies the appropriate model listeners.
060            *
061            * @param dlContent the document library content
062            * @return the document library content that was added
063            */
064            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
065            public com.liferay.portlet.documentlibrary.model.DLContent addDLContent(
066                    com.liferay.portlet.documentlibrary.model.DLContent dlContent);
067    
068            /**
069            * Creates a new document library content with the primary key. Does not add the document library content to the database.
070            *
071            * @param contentId the primary key for the new document library content
072            * @return the new document library content
073            */
074            public com.liferay.portlet.documentlibrary.model.DLContent createDLContent(
075                    long contentId);
076    
077            public void deleteContent(long companyId, long repositoryId,
078                    java.lang.String path, java.lang.String version)
079                    throws PortalException;
080    
081            public void deleteContents(long companyId, long repositoryId,
082                    java.lang.String path);
083    
084            public void deleteContentsByDirectory(long companyId, long repositoryId,
085                    java.lang.String dirName);
086    
087            /**
088            * Deletes the document library content with the primary key from the database. Also notifies the appropriate model listeners.
089            *
090            * @param contentId the primary key of the document library content
091            * @return the document library content that was removed
092            * @throws PortalException if a document library content with the primary key could not be found
093            */
094            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
095            public com.liferay.portlet.documentlibrary.model.DLContent deleteDLContent(
096                    long contentId) throws PortalException;
097    
098            /**
099            * Deletes the document library content from the database. Also notifies the appropriate model listeners.
100            *
101            * @param dlContent the document library content
102            * @return the document library content that was removed
103            */
104            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
105            public com.liferay.portlet.documentlibrary.model.DLContent deleteDLContent(
106                    com.liferay.portlet.documentlibrary.model.DLContent dlContent);
107    
108            /**
109            * @throws PortalException
110            */
111            @Override
112            public com.liferay.portal.model.PersistedModel deletePersistedModel(
113                    com.liferay.portal.model.PersistedModel persistedModel)
114                    throws PortalException;
115    
116            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
117    
118            /**
119            * Performs a dynamic query on the database and returns the matching rows.
120            *
121            * @param dynamicQuery the dynamic query
122            * @return the matching rows
123            */
124            public <T> java.util.List<T> dynamicQuery(
125                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
126    
127            /**
128            * Performs a dynamic query on the database and returns a range of the matching rows.
129            *
130            * <p>
131            * 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.DLContentModelImpl}. 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.
132            * </p>
133            *
134            * @param dynamicQuery the dynamic query
135            * @param start the lower bound of the range of model instances
136            * @param end the upper bound of the range of model instances (not inclusive)
137            * @return the range of matching rows
138            */
139            public <T> java.util.List<T> dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end);
142    
143            /**
144            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
145            *
146            * <p>
147            * 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.DLContentModelImpl}. 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.
148            * </p>
149            *
150            * @param dynamicQuery the dynamic query
151            * @param start the lower bound of the range of model instances
152            * @param end the upper bound of the range of model instances (not inclusive)
153            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
154            * @return the ordered range of matching rows
155            */
156            public <T> java.util.List<T> dynamicQuery(
157                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
158                    int end,
159                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
160    
161            /**
162            * Returns the number of rows matching the dynamic query.
163            *
164            * @param dynamicQuery the dynamic query
165            * @return the number of rows matching the dynamic query
166            */
167            public long dynamicQueryCount(
168                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
169    
170            /**
171            * Returns the number of rows matching the dynamic query.
172            *
173            * @param dynamicQuery the dynamic query
174            * @param projection the projection to apply to the query
175            * @return the number of rows matching the dynamic query
176            */
177            public long dynamicQueryCount(
178                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
179                    com.liferay.portal.kernel.dao.orm.Projection projection);
180    
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public com.liferay.portlet.documentlibrary.model.DLContent fetchDLContent(
183                    long contentId);
184    
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
187    
188            /**
189            * Returns the Spring bean ID for this bean.
190            *
191            * @return the Spring bean ID for this bean
192            */
193            public java.lang.String getBeanIdentifier();
194    
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public com.liferay.portlet.documentlibrary.model.DLContent getContent(
197                    long companyId, long repositoryId, java.lang.String path)
198                    throws com.liferay.portlet.documentlibrary.NoSuchContentException;
199    
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public com.liferay.portlet.documentlibrary.model.DLContent getContent(
202                    long companyId, long repositoryId, java.lang.String path,
203                    java.lang.String version)
204                    throws com.liferay.portlet.documentlibrary.NoSuchContentException;
205    
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents(
208                    long companyId, long repositoryId);
209    
210            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211            public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents(
212                    long companyId, long repositoryId, java.lang.String path);
213    
214            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
215            public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContentsByDirectory(
216                    long companyId, long repositoryId, java.lang.String dirName);
217    
218            /**
219            * Returns the document library content with the primary key.
220            *
221            * @param contentId the primary key of the document library content
222            * @return the document library content
223            * @throws PortalException if a document library content with the primary key could not be found
224            */
225            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
226            public com.liferay.portlet.documentlibrary.model.DLContent getDLContent(
227                    long contentId) throws PortalException;
228    
229            /**
230            * Returns a range of all the document library contents.
231            *
232            * <p>
233            * 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.DLContentModelImpl}. 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.
234            * </p>
235            *
236            * @param start the lower bound of the range of document library contents
237            * @param end the upper bound of the range of document library contents (not inclusive)
238            * @return the range of document library contents
239            */
240            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241            public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getDLContents(
242                    int start, int end);
243    
244            /**
245            * Returns the number of document library contents.
246            *
247            * @return the number of document library contents
248            */
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public int getDLContentsCount();
251    
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public com.liferay.portlet.documentlibrary.model.DLContentDataBlobModel getDataBlobModel(
254                    java.io.Serializable primaryKey);
255    
256            @Override
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public com.liferay.portal.model.PersistedModel getPersistedModel(
259                    java.io.Serializable primaryKeyObj) throws PortalException;
260    
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public boolean hasContent(long companyId, long repositoryId,
263                    java.lang.String path, java.lang.String version);
264    
265            /**
266            * Sets the Spring bean ID for this bean.
267            *
268            * @param beanIdentifier the Spring bean ID for this bean
269            */
270            public void setBeanIdentifier(java.lang.String beanIdentifier);
271    
272            public void updateDLContent(long companyId, long oldRepositoryId,
273                    long newRepositoryId, java.lang.String oldPath, java.lang.String newPath);
274    
275            /**
276            * Updates the document library content in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
277            *
278            * @param dlContent the document library content
279            * @return the document library content that was updated
280            */
281            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
282            public com.liferay.portlet.documentlibrary.model.DLContent updateDLContent(
283                    com.liferay.portlet.documentlibrary.model.DLContent dlContent);
284    }