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 /** 217 * Returns the Spring bean ID for this bean. 218 * 219 * @return the Spring bean ID for this bean 220 */ 221 public static java.lang.String getBeanIdentifier() { 222 return getService().getBeanIdentifier(); 223 } 224 225 public static com.liferay.portlet.documentlibrary.model.DLContent getContent( 226 long companyId, long repositoryId, java.lang.String path) 227 throws com.liferay.portlet.documentlibrary.NoSuchContentException { 228 return getService().getContent(companyId, repositoryId, path); 229 } 230 231 public static com.liferay.portlet.documentlibrary.model.DLContent getContent( 232 long companyId, long repositoryId, java.lang.String path, 233 java.lang.String version) 234 throws com.liferay.portlet.documentlibrary.NoSuchContentException { 235 return getService().getContent(companyId, repositoryId, path, version); 236 } 237 238 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents( 239 long companyId, long repositoryId) { 240 return getService().getContents(companyId, repositoryId); 241 } 242 243 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents( 244 long companyId, long repositoryId, java.lang.String path) { 245 return getService().getContents(companyId, repositoryId, path); 246 } 247 248 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContentsByDirectory( 249 long companyId, long repositoryId, java.lang.String dirName) { 250 return getService() 251 .getContentsByDirectory(companyId, repositoryId, dirName); 252 } 253 254 /** 255 * Returns the document library content with the primary key. 256 * 257 * @param contentId the primary key of the document library content 258 * @return the document library content 259 * @throws PortalException if a document library content with the primary key could not be found 260 */ 261 public static com.liferay.portlet.documentlibrary.model.DLContent getDLContent( 262 long contentId) 263 throws com.liferay.portal.kernel.exception.PortalException { 264 return getService().getDLContent(contentId); 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.portlet.documentlibrary.model.DLContent> getDLContents( 279 int start, int end) { 280 return getService().getDLContents(start, end); 281 } 282 283 /** 284 * Returns the number of document library contents. 285 * 286 * @return the number of document library contents 287 */ 288 public static int getDLContentsCount() { 289 return getService().getDLContentsCount(); 290 } 291 292 public static com.liferay.portlet.documentlibrary.model.DLContentDataBlobModel getDataBlobModel( 293 java.io.Serializable primaryKey) { 294 return getService().getDataBlobModel(primaryKey); 295 } 296 297 public static com.liferay.portal.model.PersistedModel getPersistedModel( 298 java.io.Serializable primaryKeyObj) 299 throws com.liferay.portal.kernel.exception.PortalException { 300 return getService().getPersistedModel(primaryKeyObj); 301 } 302 303 public static boolean hasContent(long companyId, long repositoryId, 304 java.lang.String path, java.lang.String version) { 305 return getService().hasContent(companyId, repositoryId, path, version); 306 } 307 308 /** 309 * Sets the Spring bean ID for this bean. 310 * 311 * @param beanIdentifier the Spring bean ID for this bean 312 */ 313 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 314 getService().setBeanIdentifier(beanIdentifier); 315 } 316 317 public static void updateDLContent(long companyId, long oldRepositoryId, 318 long newRepositoryId, java.lang.String oldPath, java.lang.String newPath) { 319 getService() 320 .updateDLContent(companyId, oldRepositoryId, newRepositoryId, 321 oldPath, newPath); 322 } 323 324 /** 325 * Updates the document library content in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 326 * 327 * @param dlContent the document library content 328 * @return the document library content that was updated 329 */ 330 public static com.liferay.portlet.documentlibrary.model.DLContent updateDLContent( 331 com.liferay.portlet.documentlibrary.model.DLContent dlContent) { 332 return getService().updateDLContent(dlContent); 333 } 334 335 public static DLContentLocalService getService() { 336 if (_service == null) { 337 _service = (DLContentLocalService)PortalBeanLocatorUtil.locate(DLContentLocalService.class.getName()); 338 339 ReferenceRegistry.registerReference(DLContentLocalServiceUtil.class, 340 "_service"); 341 } 342 343 return _service; 344 } 345 346 /** 347 * @deprecated As of 6.2.0 348 */ 349 @Deprecated 350 public void setService(DLContentLocalService service) { 351 } 352 353 private static DLContentLocalService _service; 354 }