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 DLFileEntryMetadata. This utility wraps 024 * {@link com.liferay.portlet.documentlibrary.service.impl.DLFileEntryMetadataLocalServiceImpl} 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 DLFileEntryMetadataLocalService 032 * @see com.liferay.portlet.documentlibrary.service.base.DLFileEntryMetadataLocalServiceBaseImpl 033 * @see com.liferay.portlet.documentlibrary.service.impl.DLFileEntryMetadataLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class DLFileEntryMetadataLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileEntryMetadataLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the document library file entry metadata to the database. Also notifies the appropriate model listeners. 046 * 047 * @param dlFileEntryMetadata the document library file entry metadata 048 * @return the document library file entry metadata that was added 049 */ 050 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata addDLFileEntryMetadata( 051 com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata dlFileEntryMetadata) { 052 return getService().addDLFileEntryMetadata(dlFileEntryMetadata); 053 } 054 055 /** 056 * Creates a new document library file entry metadata with the primary key. Does not add the document library file entry metadata to the database. 057 * 058 * @param fileEntryMetadataId the primary key for the new document library file entry metadata 059 * @return the new document library file entry metadata 060 */ 061 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata createDLFileEntryMetadata( 062 long fileEntryMetadataId) { 063 return getService().createDLFileEntryMetadata(fileEntryMetadataId); 064 } 065 066 /** 067 * Deletes the document library file entry metadata from the database. Also notifies the appropriate model listeners. 068 * 069 * @param dlFileEntryMetadata the document library file entry metadata 070 * @return the document library file entry metadata that was removed 071 */ 072 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata deleteDLFileEntryMetadata( 073 com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata dlFileEntryMetadata) { 074 return getService().deleteDLFileEntryMetadata(dlFileEntryMetadata); 075 } 076 077 /** 078 * Deletes the document library file entry metadata with the primary key from the database. Also notifies the appropriate model listeners. 079 * 080 * @param fileEntryMetadataId the primary key of the document library file entry metadata 081 * @return the document library file entry metadata that was removed 082 * @throws PortalException if a document library file entry metadata with the primary key could not be found 083 */ 084 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata deleteDLFileEntryMetadata( 085 long fileEntryMetadataId) 086 throws com.liferay.portal.kernel.exception.PortalException { 087 return getService().deleteDLFileEntryMetadata(fileEntryMetadataId); 088 } 089 090 public static void deleteFileEntryMetadata(long fileEntryId) 091 throws com.liferay.portal.kernel.exception.PortalException { 092 getService().deleteFileEntryMetadata(fileEntryId); 093 } 094 095 public static void deleteFileVersionFileEntryMetadata(long fileVersionId) 096 throws com.liferay.portal.kernel.exception.PortalException { 097 getService().deleteFileVersionFileEntryMetadata(fileVersionId); 098 } 099 100 /** 101 * @throws PortalException 102 */ 103 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 104 com.liferay.portal.model.PersistedModel persistedModel) 105 throws com.liferay.portal.kernel.exception.PortalException { 106 return getService().deletePersistedModel(persistedModel); 107 } 108 109 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 110 return getService().dynamicQuery(); 111 } 112 113 /** 114 * Performs a dynamic query on the database and returns the matching rows. 115 * 116 * @param dynamicQuery the dynamic query 117 * @return the matching rows 118 */ 119 public static <T> java.util.List<T> dynamicQuery( 120 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 121 return getService().dynamicQuery(dynamicQuery); 122 } 123 124 /** 125 * Performs a dynamic query on the database and returns a range of the matching rows. 126 * 127 * <p> 128 * 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.DLFileEntryMetadataModelImpl}. 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. 129 * </p> 130 * 131 * @param dynamicQuery the dynamic query 132 * @param start the lower bound of the range of model instances 133 * @param end the upper bound of the range of model instances (not inclusive) 134 * @return the range of matching rows 135 */ 136 public static <T> java.util.List<T> dynamicQuery( 137 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 138 int end) { 139 return getService().dynamicQuery(dynamicQuery, start, end); 140 } 141 142 /** 143 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 144 * 145 * <p> 146 * 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.DLFileEntryMetadataModelImpl}. 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. 147 * </p> 148 * 149 * @param dynamicQuery the dynamic query 150 * @param start the lower bound of the range of model instances 151 * @param end the upper bound of the range of model instances (not inclusive) 152 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 153 * @return the ordered range of matching rows 154 */ 155 public static <T> java.util.List<T> dynamicQuery( 156 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 157 int end, 158 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 159 return getService() 160 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 161 } 162 163 /** 164 * Returns the number of rows matching the dynamic query. 165 * 166 * @param dynamicQuery the dynamic query 167 * @return the number of rows matching the dynamic query 168 */ 169 public static long dynamicQueryCount( 170 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 171 return getService().dynamicQueryCount(dynamicQuery); 172 } 173 174 /** 175 * Returns the number of rows matching the dynamic query. 176 * 177 * @param dynamicQuery the dynamic query 178 * @param projection the projection to apply to the query 179 * @return the number of rows matching the dynamic query 180 */ 181 public static long dynamicQueryCount( 182 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 183 com.liferay.portal.kernel.dao.orm.Projection projection) { 184 return getService().dynamicQueryCount(dynamicQuery, projection); 185 } 186 187 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata fetchDLFileEntryMetadata( 188 long fileEntryMetadataId) { 189 return getService().fetchDLFileEntryMetadata(fileEntryMetadataId); 190 } 191 192 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata fetchFileEntryMetadata( 193 long ddmStructureId, long fileVersionId) { 194 return getService().fetchFileEntryMetadata(ddmStructureId, fileVersionId); 195 } 196 197 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata fetchFileEntryMetadata( 198 long fileEntryMetadataId) { 199 return getService().fetchFileEntryMetadata(fileEntryMetadataId); 200 } 201 202 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 203 return getService().getActionableDynamicQuery(); 204 } 205 206 /** 207 * Returns the Spring bean ID for this bean. 208 * 209 * @return the Spring bean ID for this bean 210 */ 211 public static java.lang.String getBeanIdentifier() { 212 return getService().getBeanIdentifier(); 213 } 214 215 /** 216 * Returns the document library file entry metadata with the primary key. 217 * 218 * @param fileEntryMetadataId the primary key of the document library file entry metadata 219 * @return the document library file entry metadata 220 * @throws PortalException if a document library file entry metadata with the primary key could not be found 221 */ 222 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata getDLFileEntryMetadata( 223 long fileEntryMetadataId) 224 throws com.liferay.portal.kernel.exception.PortalException { 225 return getService().getDLFileEntryMetadata(fileEntryMetadataId); 226 } 227 228 /** 229 * Returns a range of all the document library file entry metadatas. 230 * 231 * <p> 232 * 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.DLFileEntryMetadataModelImpl}. 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. 233 * </p> 234 * 235 * @param start the lower bound of the range of document library file entry metadatas 236 * @param end the upper bound of the range of document library file entry metadatas (not inclusive) 237 * @return the range of document library file entry metadatas 238 */ 239 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata> getDLFileEntryMetadatas( 240 int start, int end) { 241 return getService().getDLFileEntryMetadatas(start, end); 242 } 243 244 /** 245 * Returns the number of document library file entry metadatas. 246 * 247 * @return the number of document library file entry metadatas 248 */ 249 public static int getDLFileEntryMetadatasCount() { 250 return getService().getDLFileEntryMetadatasCount(); 251 } 252 253 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata getFileEntryMetadata( 254 long ddmStructureId, long fileVersionId) 255 throws com.liferay.portal.kernel.exception.PortalException { 256 return getService().getFileEntryMetadata(ddmStructureId, fileVersionId); 257 } 258 259 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata getFileEntryMetadata( 260 long fileEntryMetadataId) 261 throws com.liferay.portal.kernel.exception.PortalException { 262 return getService().getFileEntryMetadata(fileEntryMetadataId); 263 } 264 265 /** 266 * @deprecated As of 6.2.0, replaced by {@link 267 #getFileVersionFileEntryMetadatasCount(long)} 268 */ 269 @Deprecated 270 public static long getFileEntryMetadataCount(long fileEntryId, 271 long fileVersionId) { 272 return getService().getFileEntryMetadataCount(fileEntryId, fileVersionId); 273 } 274 275 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata> getFileVersionFileEntryMetadatas( 276 long fileVersionId) { 277 return getService().getFileVersionFileEntryMetadatas(fileVersionId); 278 } 279 280 public static long getFileVersionFileEntryMetadatasCount(long fileVersionId) { 281 return getService().getFileVersionFileEntryMetadatasCount(fileVersionId); 282 } 283 284 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata> getMismatchedCompanyIdFileEntryMetadatas() { 285 return getService().getMismatchedCompanyIdFileEntryMetadatas(); 286 } 287 288 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata> getNoStructuresFileEntryMetadatas() { 289 return getService().getNoStructuresFileEntryMetadatas(); 290 } 291 292 public static com.liferay.portal.model.PersistedModel getPersistedModel( 293 java.io.Serializable primaryKeyObj) 294 throws com.liferay.portal.kernel.exception.PortalException { 295 return getService().getPersistedModel(primaryKeyObj); 296 } 297 298 /** 299 * Sets the Spring bean ID for this bean. 300 * 301 * @param beanIdentifier the Spring bean ID for this bean 302 */ 303 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 304 getService().setBeanIdentifier(beanIdentifier); 305 } 306 307 /** 308 * Updates the document library file entry metadata in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 309 * 310 * @param dlFileEntryMetadata the document library file entry metadata 311 * @return the document library file entry metadata that was updated 312 */ 313 public static com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata updateDLFileEntryMetadata( 314 com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata dlFileEntryMetadata) { 315 return getService().updateDLFileEntryMetadata(dlFileEntryMetadata); 316 } 317 318 public static void updateFileEntryMetadata(long companyId, 319 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> ddmStructures, 320 long fileEntryTypeId, long fileEntryId, long fileVersionId, 321 java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap, 322 com.liferay.portal.service.ServiceContext serviceContext) 323 throws com.liferay.portal.kernel.exception.PortalException { 324 getService() 325 .updateFileEntryMetadata(companyId, ddmStructures, fileEntryTypeId, 326 fileEntryId, fileVersionId, fieldsMap, serviceContext); 327 } 328 329 public static void updateFileEntryMetadata(long fileEntryTypeId, 330 long fileEntryId, long fileVersionId, 331 java.util.Map<java.lang.String, com.liferay.portlet.dynamicdatamapping.storage.Fields> fieldsMap, 332 com.liferay.portal.service.ServiceContext serviceContext) 333 throws com.liferay.portal.kernel.exception.PortalException { 334 getService() 335 .updateFileEntryMetadata(fileEntryTypeId, fileEntryId, 336 fileVersionId, fieldsMap, serviceContext); 337 } 338 339 public static DLFileEntryMetadataLocalService getService() { 340 if (_service == null) { 341 _service = (DLFileEntryMetadataLocalService)PortalBeanLocatorUtil.locate(DLFileEntryMetadataLocalService.class.getName()); 342 343 ReferenceRegistry.registerReference(DLFileEntryMetadataLocalServiceUtil.class, 344 "_service"); 345 } 346 347 return _service; 348 } 349 350 /** 351 * @deprecated As of 6.2.0 352 */ 353 @Deprecated 354 public void setService(DLFileEntryMetadataLocalService service) { 355 } 356 357 private static DLFileEntryMetadataLocalService _service; 358 }