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.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for DLContent. This utility wraps
024     * {@link com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DLContentLocalService
032     * @see com.liferay.portlet.documentlibrary.service.base.DLContentLocalServiceBaseImpl
033     * @see com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class DLContentLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portlet.documentlibrary.model.DLContent addContent(
044                    long companyId, long repositoryId, java.lang.String path,
045                    java.lang.String version, byte[] bytes) {
046                    return getService()
047                                       .addContent(companyId, repositoryId, path, version, bytes);
048            }
049    
050            public static com.liferay.portlet.documentlibrary.model.DLContent addContent(
051                    long companyId, long repositoryId, java.lang.String path,
052                    java.lang.String version, java.io.InputStream inputStream, long size) {
053                    return getService()
054                                       .addContent(companyId, repositoryId, path, version,
055                            inputStream, size);
056            }
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            public static com.liferay.portlet.documentlibrary.model.DLContent addDLContent(
065                    com.liferay.portlet.documentlibrary.model.DLContent dlContent) {
066                    return getService().addDLContent(dlContent);
067            }
068    
069            /**
070            * Creates a new document library content with the primary key. Does not add the document library content to the database.
071            *
072            * @param contentId the primary key for the new document library content
073            * @return the new document library content
074            */
075            public static com.liferay.portlet.documentlibrary.model.DLContent createDLContent(
076                    long contentId) {
077                    return getService().createDLContent(contentId);
078            }
079    
080            public static void deleteContent(long companyId, long repositoryId,
081                    java.lang.String path, java.lang.String version)
082                    throws com.liferay.portal.kernel.exception.PortalException {
083                    getService().deleteContent(companyId, repositoryId, path, version);
084            }
085    
086            public static void deleteContents(long companyId, long repositoryId,
087                    java.lang.String path) {
088                    getService().deleteContents(companyId, repositoryId, path);
089            }
090    
091            public static void deleteContentsByDirectory(long companyId,
092                    long repositoryId, java.lang.String dirName) {
093                    getService().deleteContentsByDirectory(companyId, repositoryId, dirName);
094            }
095    
096            /**
097            * Deletes the document library content with the primary key from the database. Also notifies the appropriate model listeners.
098            *
099            * @param contentId the primary key of the document library content
100            * @return the document library content that was removed
101            * @throws PortalException if a document library content with the primary key could not be found
102            */
103            public static com.liferay.portlet.documentlibrary.model.DLContent deleteDLContent(
104                    long contentId)
105                    throws com.liferay.portal.kernel.exception.PortalException {
106                    return getService().deleteDLContent(contentId);
107            }
108    
109            /**
110            * Deletes the document library content from the database. Also notifies the appropriate model listeners.
111            *
112            * @param dlContent the document library content
113            * @return the document library content that was removed
114            */
115            public static com.liferay.portlet.documentlibrary.model.DLContent deleteDLContent(
116                    com.liferay.portlet.documentlibrary.model.DLContent dlContent) {
117                    return getService().deleteDLContent(dlContent);
118            }
119    
120            /**
121            * @throws PortalException
122            */
123            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
124                    com.liferay.portal.model.PersistedModel persistedModel)
125                    throws com.liferay.portal.kernel.exception.PortalException {
126                    return getService().deletePersistedModel(persistedModel);
127            }
128    
129            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
130                    return getService().dynamicQuery();
131            }
132    
133            /**
134            * Performs a dynamic query on the database and returns the matching rows.
135            *
136            * @param dynamicQuery the dynamic query
137            * @return the matching rows
138            */
139            public static <T> java.util.List<T> dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
141                    return getService().dynamicQuery(dynamicQuery);
142            }
143    
144            /**
145            * Performs a dynamic query on the database and returns a range of the matching rows.
146            *
147            * <p>
148            * 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.
149            * </p>
150            *
151            * @param dynamicQuery the dynamic query
152            * @param start the lower bound of the range of model instances
153            * @param end the upper bound of the range of model instances (not inclusive)
154            * @return the range of matching rows
155            */
156            public static <T> java.util.List<T> dynamicQuery(
157                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
158                    int end) {
159                    return getService().dynamicQuery(dynamicQuery, start, end);
160            }
161    
162            /**
163            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
164            *
165            * <p>
166            * 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.
167            * </p>
168            *
169            * @param dynamicQuery the dynamic query
170            * @param start the lower bound of the range of model instances
171            * @param end the upper bound of the range of model instances (not inclusive)
172            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
173            * @return the ordered range of matching rows
174            */
175            public static <T> java.util.List<T> dynamicQuery(
176                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
177                    int end,
178                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
179                    return getService()
180                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
181            }
182    
183            /**
184            * Returns the number of rows matching the dynamic query.
185            *
186            * @param dynamicQuery the dynamic query
187            * @return the number of rows matching the dynamic query
188            */
189            public static long dynamicQueryCount(
190                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
191                    return getService().dynamicQueryCount(dynamicQuery);
192            }
193    
194            /**
195            * Returns the number of rows matching the dynamic query.
196            *
197            * @param dynamicQuery the dynamic query
198            * @param projection the projection to apply to the query
199            * @return the number of rows matching the dynamic query
200            */
201            public static long dynamicQueryCount(
202                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
203                    com.liferay.portal.kernel.dao.orm.Projection projection) {
204                    return getService().dynamicQueryCount(dynamicQuery, projection);
205            }
206    
207            public static com.liferay.portlet.documentlibrary.model.DLContent fetchDLContent(
208                    long contentId) {
209                    return getService().fetchDLContent(contentId);
210            }
211    
212            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
213                    return getService().getActionableDynamicQuery();
214            }
215    
216            public static com.liferay.portlet.documentlibrary.model.DLContent getContent(
217                    long companyId, long repositoryId, java.lang.String path)
218                    throws com.liferay.portlet.documentlibrary.exception.NoSuchContentException {
219                    return getService().getContent(companyId, repositoryId, path);
220            }
221    
222            public static com.liferay.portlet.documentlibrary.model.DLContent getContent(
223                    long companyId, long repositoryId, java.lang.String path,
224                    java.lang.String version)
225                    throws com.liferay.portlet.documentlibrary.exception.NoSuchContentException {
226                    return getService().getContent(companyId, repositoryId, path, version);
227            }
228    
229            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents(
230                    long companyId, long repositoryId) {
231                    return getService().getContents(companyId, repositoryId);
232            }
233    
234            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents(
235                    long companyId, long repositoryId, java.lang.String path) {
236                    return getService().getContents(companyId, repositoryId, path);
237            }
238    
239            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContentsByDirectory(
240                    long companyId, long repositoryId, java.lang.String dirName) {
241                    return getService()
242                                       .getContentsByDirectory(companyId, repositoryId, dirName);
243            }
244    
245            /**
246            * Returns the document library content with the primary key.
247            *
248            * @param contentId the primary key of the document library content
249            * @return the document library content
250            * @throws PortalException if a document library content with the primary key could not be found
251            */
252            public static com.liferay.portlet.documentlibrary.model.DLContent getDLContent(
253                    long contentId)
254                    throws com.liferay.portal.kernel.exception.PortalException {
255                    return getService().getDLContent(contentId);
256            }
257    
258            /**
259            * Returns a range of all the document library contents.
260            *
261            * <p>
262            * 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.
263            * </p>
264            *
265            * @param start the lower bound of the range of document library contents
266            * @param end the upper bound of the range of document library contents (not inclusive)
267            * @return the range of document library contents
268            */
269            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getDLContents(
270                    int start, int end) {
271                    return getService().getDLContents(start, end);
272            }
273    
274            /**
275            * Returns the number of document library contents.
276            *
277            * @return the number of document library contents
278            */
279            public static int getDLContentsCount() {
280                    return getService().getDLContentsCount();
281            }
282    
283            public static com.liferay.portlet.documentlibrary.model.DLContentDataBlobModel getDataBlobModel(
284                    java.io.Serializable primaryKey) {
285                    return getService().getDataBlobModel(primaryKey);
286            }
287    
288            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
289                    return getService().getIndexableActionableDynamicQuery();
290            }
291    
292            /**
293            * Returns the OSGi service identifier.
294            *
295            * @return the OSGi service identifier
296            */
297            public static java.lang.String getOSGiServiceIdentifier() {
298                    return getService().getOSGiServiceIdentifier();
299            }
300    
301            public static com.liferay.portal.model.PersistedModel getPersistedModel(
302                    java.io.Serializable primaryKeyObj)
303                    throws com.liferay.portal.kernel.exception.PortalException {
304                    return getService().getPersistedModel(primaryKeyObj);
305            }
306    
307            public static boolean hasContent(long companyId, long repositoryId,
308                    java.lang.String path, java.lang.String version) {
309                    return getService().hasContent(companyId, repositoryId, path, version);
310            }
311    
312            public static void updateDLContent(long companyId, long oldRepositoryId,
313                    long newRepositoryId, java.lang.String oldPath, java.lang.String newPath) {
314                    getService()
315                            .updateDLContent(companyId, oldRepositoryId, newRepositoryId,
316                            oldPath, newPath);
317            }
318    
319            /**
320            * Updates the document library content in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
321            *
322            * @param dlContent the document library content
323            * @return the document library content that was updated
324            */
325            public static com.liferay.portlet.documentlibrary.model.DLContent updateDLContent(
326                    com.liferay.portlet.documentlibrary.model.DLContent dlContent) {
327                    return getService().updateDLContent(dlContent);
328            }
329    
330            public static DLContentLocalService getService() {
331                    if (_service == null) {
332                            _service = (DLContentLocalService)PortalBeanLocatorUtil.locate(DLContentLocalService.class.getName());
333    
334                            ReferenceRegistry.registerReference(DLContentLocalServiceUtil.class,
335                                    "_service");
336                    }
337    
338                    return _service;
339            }
340    
341            private static DLContentLocalService _service;
342    }