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.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 boolean hasContent(long companyId, long repositoryId,
044                    java.lang.String path, java.lang.String version) {
045                    return getService().hasContent(companyId, repositoryId, path, version);
046            }
047    
048            public static com.liferay.document.library.kernel.model.DLContent addContent(
049                    long companyId, long repositoryId, java.lang.String path,
050                    java.lang.String version, byte[] bytes) {
051                    return getService()
052                                       .addContent(companyId, repositoryId, path, version, bytes);
053            }
054    
055            public static com.liferay.document.library.kernel.model.DLContent addContent(
056                    long companyId, long repositoryId, java.lang.String path,
057                    java.lang.String version, java.io.InputStream inputStream, long size) {
058                    return getService()
059                                       .addContent(companyId, repositoryId, path, version,
060                            inputStream, size);
061            }
062    
063            /**
064            * Adds the document library content to the database. Also notifies the appropriate model listeners.
065            *
066            * @param dlContent the document library content
067            * @return the document library content that was added
068            */
069            public static com.liferay.document.library.kernel.model.DLContent addDLContent(
070                    com.liferay.document.library.kernel.model.DLContent dlContent) {
071                    return getService().addDLContent(dlContent);
072            }
073    
074            /**
075            * Creates a new document library content with the primary key. Does not add the document library content to the database.
076            *
077            * @param contentId the primary key for the new document library content
078            * @return the new document library content
079            */
080            public static com.liferay.document.library.kernel.model.DLContent createDLContent(
081                    long contentId) {
082                    return getService().createDLContent(contentId);
083            }
084    
085            /**
086            * Deletes the document library content from the database. Also notifies the appropriate model listeners.
087            *
088            * @param dlContent the document library content
089            * @return the document library content that was removed
090            */
091            public static com.liferay.document.library.kernel.model.DLContent deleteDLContent(
092                    com.liferay.document.library.kernel.model.DLContent dlContent) {
093                    return getService().deleteDLContent(dlContent);
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.document.library.kernel.model.DLContent deleteDLContent(
104                    long contentId)
105                    throws com.liferay.portal.kernel.exception.PortalException {
106                    return getService().deleteDLContent(contentId);
107            }
108    
109            public static com.liferay.document.library.kernel.model.DLContent fetchDLContent(
110                    long contentId) {
111                    return getService().fetchDLContent(contentId);
112            }
113    
114            public static com.liferay.document.library.kernel.model.DLContent getContent(
115                    long companyId, long repositoryId, java.lang.String path)
116                    throws com.liferay.document.library.kernel.exception.NoSuchContentException {
117                    return getService().getContent(companyId, repositoryId, path);
118            }
119    
120            public static com.liferay.document.library.kernel.model.DLContent getContent(
121                    long companyId, long repositoryId, java.lang.String path,
122                    java.lang.String version)
123                    throws com.liferay.document.library.kernel.exception.NoSuchContentException {
124                    return getService().getContent(companyId, repositoryId, path, version);
125            }
126    
127            /**
128            * Returns the document library content with the primary key.
129            *
130            * @param contentId the primary key of the document library content
131            * @return the document library content
132            * @throws PortalException if a document library content with the primary key could not be found
133            */
134            public static com.liferay.document.library.kernel.model.DLContent getDLContent(
135                    long contentId)
136                    throws com.liferay.portal.kernel.exception.PortalException {
137                    return getService().getDLContent(contentId);
138            }
139    
140            /**
141            * Updates the document library content in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
142            *
143            * @param dlContent the document library content
144            * @return the document library content that was updated
145            */
146            public static com.liferay.document.library.kernel.model.DLContent updateDLContent(
147                    com.liferay.document.library.kernel.model.DLContent dlContent) {
148                    return getService().updateDLContent(dlContent);
149            }
150    
151            public static com.liferay.document.library.kernel.model.DLContentDataBlobModel getDataBlobModel(
152                    java.io.Serializable primaryKey) {
153                    return getService().getDataBlobModel(primaryKey);
154            }
155    
156            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
157                    return getService().getActionableDynamicQuery();
158            }
159    
160            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
161                    return getService().dynamicQuery();
162            }
163    
164            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
165                    return getService().getIndexableActionableDynamicQuery();
166            }
167    
168            /**
169            * @throws PortalException
170            */
171            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
172                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
173                    throws com.liferay.portal.kernel.exception.PortalException {
174                    return getService().deletePersistedModel(persistedModel);
175            }
176    
177            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
178                    java.io.Serializable primaryKeyObj)
179                    throws com.liferay.portal.kernel.exception.PortalException {
180                    return getService().getPersistedModel(primaryKeyObj);
181            }
182    
183            /**
184            * Returns the number of document library contents.
185            *
186            * @return the number of document library contents
187            */
188            public static int getDLContentsCount() {
189                    return getService().getDLContentsCount();
190            }
191    
192            /**
193            * Returns the OSGi service identifier.
194            *
195            * @return the OSGi service identifier
196            */
197            public static java.lang.String getOSGiServiceIdentifier() {
198                    return getService().getOSGiServiceIdentifier();
199            }
200    
201            /**
202            * Performs a dynamic query on the database and returns the matching rows.
203            *
204            * @param dynamicQuery the dynamic query
205            * @return the matching rows
206            */
207            public static <T> java.util.List<T> dynamicQuery(
208                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
209                    return getService().dynamicQuery(dynamicQuery);
210            }
211    
212            /**
213            * Performs a dynamic query on the database and returns a range of the matching rows.
214            *
215            * <p>
216            * 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.
217            * </p>
218            *
219            * @param dynamicQuery the dynamic query
220            * @param start the lower bound of the range of model instances
221            * @param end the upper bound of the range of model instances (not inclusive)
222            * @return the range of matching rows
223            */
224            public static <T> java.util.List<T> dynamicQuery(
225                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
226                    int end) {
227                    return getService().dynamicQuery(dynamicQuery, start, end);
228            }
229    
230            /**
231            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
232            *
233            * <p>
234            * 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.
235            * </p>
236            *
237            * @param dynamicQuery the dynamic query
238            * @param start the lower bound of the range of model instances
239            * @param end the upper bound of the range of model instances (not inclusive)
240            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
241            * @return the ordered range of matching rows
242            */
243            public static <T> java.util.List<T> dynamicQuery(
244                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
245                    int end,
246                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
247                    return getService()
248                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
249            }
250    
251            public static java.util.List<com.liferay.document.library.kernel.model.DLContent> getContents(
252                    long companyId, long repositoryId) {
253                    return getService().getContents(companyId, repositoryId);
254            }
255    
256            public static java.util.List<com.liferay.document.library.kernel.model.DLContent> getContents(
257                    long companyId, long repositoryId, java.lang.String path) {
258                    return getService().getContents(companyId, repositoryId, path);
259            }
260    
261            public static java.util.List<com.liferay.document.library.kernel.model.DLContent> getContentsByDirectory(
262                    long companyId, long repositoryId, java.lang.String dirName) {
263                    return getService()
264                                       .getContentsByDirectory(companyId, repositoryId, dirName);
265            }
266    
267            /**
268            * Returns a range of all the document library contents.
269            *
270            * <p>
271            * 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.
272            * </p>
273            *
274            * @param start the lower bound of the range of document library contents
275            * @param end the upper bound of the range of document library contents (not inclusive)
276            * @return the range of document library contents
277            */
278            public static java.util.List<com.liferay.document.library.kernel.model.DLContent> getDLContents(
279                    int start, int end) {
280                    return getService().getDLContents(start, end);
281            }
282    
283            /**
284            * Returns the number of rows matching the dynamic query.
285            *
286            * @param dynamicQuery the dynamic query
287            * @return the number of rows matching the dynamic query
288            */
289            public static long dynamicQueryCount(
290                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
291                    return getService().dynamicQueryCount(dynamicQuery);
292            }
293    
294            /**
295            * Returns the number of rows matching the dynamic query.
296            *
297            * @param dynamicQuery the dynamic query
298            * @param projection the projection to apply to the query
299            * @return the number of rows matching the dynamic query
300            */
301            public static long dynamicQueryCount(
302                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
303                    com.liferay.portal.kernel.dao.orm.Projection projection) {
304                    return getService().dynamicQueryCount(dynamicQuery, projection);
305            }
306    
307            public static void deleteContent(long companyId, long repositoryId,
308                    java.lang.String path, java.lang.String version)
309                    throws com.liferay.portal.kernel.exception.PortalException {
310                    getService().deleteContent(companyId, repositoryId, path, version);
311            }
312    
313            public static void deleteContents(long companyId, long repositoryId,
314                    java.lang.String path) {
315                    getService().deleteContents(companyId, repositoryId, path);
316            }
317    
318            public static void deleteContentsByDirectory(long companyId,
319                    long repositoryId, java.lang.String dirName) {
320                    getService().deleteContentsByDirectory(companyId, repositoryId, dirName);
321            }
322    
323            public static void updateDLContent(long companyId, long oldRepositoryId,
324                    long newRepositoryId, java.lang.String oldPath, java.lang.String newPath) {
325                    getService()
326                            .updateDLContent(companyId, oldRepositoryId, newRepositoryId,
327                            oldPath, newPath);
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    }