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 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.document.library.kernel.model.DLFileEntryMetadata addDLFileEntryMetadata( 051 com.liferay.document.library.kernel.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.document.library.kernel.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.document.library.kernel.model.DLFileEntryMetadata deleteDLFileEntryMetadata( 073 com.liferay.document.library.kernel.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.document.library.kernel.model.DLFileEntryMetadata deleteDLFileEntryMetadata( 085 long fileEntryMetadataId) 086 throws com.liferay.portal.kernel.exception.PortalException { 087 return getService().deleteDLFileEntryMetadata(fileEntryMetadataId); 088 } 089 090 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata fetchDLFileEntryMetadata( 091 long fileEntryMetadataId) { 092 return getService().fetchDLFileEntryMetadata(fileEntryMetadataId); 093 } 094 095 /** 096 * Returns the document library file entry metadata with the matching UUID and company. 097 * 098 * @param uuid the document library file entry metadata's UUID 099 * @param companyId the primary key of the company 100 * @return the matching document library file entry metadata, or <code>null</code> if a matching document library file entry metadata could not be found 101 */ 102 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata fetchDLFileEntryMetadataByUuidAndCompanyId( 103 java.lang.String uuid, long companyId) { 104 return getService() 105 .fetchDLFileEntryMetadataByUuidAndCompanyId(uuid, companyId); 106 } 107 108 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata fetchFileEntryMetadata( 109 long ddmStructureId, long fileVersionId) { 110 return getService().fetchFileEntryMetadata(ddmStructureId, fileVersionId); 111 } 112 113 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata fetchFileEntryMetadata( 114 long fileEntryMetadataId) { 115 return getService().fetchFileEntryMetadata(fileEntryMetadataId); 116 } 117 118 /** 119 * Returns the document library file entry metadata with the primary key. 120 * 121 * @param fileEntryMetadataId the primary key of the document library file entry metadata 122 * @return the document library file entry metadata 123 * @throws PortalException if a document library file entry metadata with the primary key could not be found 124 */ 125 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata getDLFileEntryMetadata( 126 long fileEntryMetadataId) 127 throws com.liferay.portal.kernel.exception.PortalException { 128 return getService().getDLFileEntryMetadata(fileEntryMetadataId); 129 } 130 131 /** 132 * Returns the document library file entry metadata with the matching UUID and company. 133 * 134 * @param uuid the document library file entry metadata's UUID 135 * @param companyId the primary key of the company 136 * @return the matching document library file entry metadata 137 * @throws PortalException if a matching document library file entry metadata could not be found 138 */ 139 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata getDLFileEntryMetadataByUuidAndCompanyId( 140 java.lang.String uuid, long companyId) 141 throws com.liferay.portal.kernel.exception.PortalException { 142 return getService() 143 .getDLFileEntryMetadataByUuidAndCompanyId(uuid, companyId); 144 } 145 146 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata getFileEntryMetadata( 147 long ddmStructureId, long fileVersionId) 148 throws com.liferay.portal.kernel.exception.PortalException { 149 return getService().getFileEntryMetadata(ddmStructureId, fileVersionId); 150 } 151 152 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata getFileEntryMetadata( 153 long fileEntryMetadataId) 154 throws com.liferay.portal.kernel.exception.PortalException { 155 return getService().getFileEntryMetadata(fileEntryMetadataId); 156 } 157 158 /** 159 * 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. 160 * 161 * @param dlFileEntryMetadata the document library file entry metadata 162 * @return the document library file entry metadata that was updated 163 */ 164 public static com.liferay.document.library.kernel.model.DLFileEntryMetadata updateDLFileEntryMetadata( 165 com.liferay.document.library.kernel.model.DLFileEntryMetadata dlFileEntryMetadata) { 166 return getService().updateDLFileEntryMetadata(dlFileEntryMetadata); 167 } 168 169 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 170 return getService().getActionableDynamicQuery(); 171 } 172 173 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 174 return getService().dynamicQuery(); 175 } 176 177 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 178 return getService().getIndexableActionableDynamicQuery(); 179 } 180 181 /** 182 * @throws PortalException 183 */ 184 public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( 185 com.liferay.portal.kernel.model.PersistedModel persistedModel) 186 throws com.liferay.portal.kernel.exception.PortalException { 187 return getService().deletePersistedModel(persistedModel); 188 } 189 190 public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel( 191 java.io.Serializable primaryKeyObj) 192 throws com.liferay.portal.kernel.exception.PortalException { 193 return getService().getPersistedModel(primaryKeyObj); 194 } 195 196 /** 197 * Returns the number of document library file entry metadatas. 198 * 199 * @return the number of document library file entry metadatas 200 */ 201 public static int getDLFileEntryMetadatasCount() { 202 return getService().getDLFileEntryMetadatasCount(); 203 } 204 205 /** 206 * Returns the OSGi service identifier. 207 * 208 * @return the OSGi service identifier 209 */ 210 public static java.lang.String getOSGiServiceIdentifier() { 211 return getService().getOSGiServiceIdentifier(); 212 } 213 214 /** 215 * Performs a dynamic query on the database and returns the matching rows. 216 * 217 * @param dynamicQuery the dynamic query 218 * @return the matching rows 219 */ 220 public static <T> java.util.List<T> dynamicQuery( 221 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 222 return getService().dynamicQuery(dynamicQuery); 223 } 224 225 /** 226 * Performs a dynamic query on the database and returns a range of the matching rows. 227 * 228 * <p> 229 * 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. 230 * </p> 231 * 232 * @param dynamicQuery the dynamic query 233 * @param start the lower bound of the range of model instances 234 * @param end the upper bound of the range of model instances (not inclusive) 235 * @return the range of matching rows 236 */ 237 public static <T> java.util.List<T> dynamicQuery( 238 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 239 int end) { 240 return getService().dynamicQuery(dynamicQuery, start, end); 241 } 242 243 /** 244 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 245 * 246 * <p> 247 * 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. 248 * </p> 249 * 250 * @param dynamicQuery the dynamic query 251 * @param start the lower bound of the range of model instances 252 * @param end the upper bound of the range of model instances (not inclusive) 253 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 254 * @return the ordered range of matching rows 255 */ 256 public static <T> java.util.List<T> dynamicQuery( 257 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 258 int end, 259 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 260 return getService() 261 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 262 } 263 264 /** 265 * Returns a range of all the document library file entry metadatas. 266 * 267 * <p> 268 * 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. 269 * </p> 270 * 271 * @param start the lower bound of the range of document library file entry metadatas 272 * @param end the upper bound of the range of document library file entry metadatas (not inclusive) 273 * @return the range of document library file entry metadatas 274 */ 275 public static java.util.List<com.liferay.document.library.kernel.model.DLFileEntryMetadata> getDLFileEntryMetadatas( 276 int start, int end) { 277 return getService().getDLFileEntryMetadatas(start, end); 278 } 279 280 public static java.util.List<com.liferay.document.library.kernel.model.DLFileEntryMetadata> getFileVersionFileEntryMetadatas( 281 long fileVersionId) { 282 return getService().getFileVersionFileEntryMetadatas(fileVersionId); 283 } 284 285 public static java.util.List<com.liferay.document.library.kernel.model.DLFileEntryMetadata> getMismatchedCompanyIdFileEntryMetadatas() { 286 return getService().getMismatchedCompanyIdFileEntryMetadatas(); 287 } 288 289 public static java.util.List<com.liferay.document.library.kernel.model.DLFileEntryMetadata> getNoStructuresFileEntryMetadatas() { 290 return getService().getNoStructuresFileEntryMetadatas(); 291 } 292 293 /** 294 * Returns the number of rows matching the dynamic query. 295 * 296 * @param dynamicQuery the dynamic query 297 * @return the number of rows matching the dynamic query 298 */ 299 public static long dynamicQueryCount( 300 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 301 return getService().dynamicQueryCount(dynamicQuery); 302 } 303 304 /** 305 * Returns the number of rows matching the dynamic query. 306 * 307 * @param dynamicQuery the dynamic query 308 * @param projection the projection to apply to the query 309 * @return the number of rows matching the dynamic query 310 */ 311 public static long dynamicQueryCount( 312 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 313 com.liferay.portal.kernel.dao.orm.Projection projection) { 314 return getService().dynamicQueryCount(dynamicQuery, projection); 315 } 316 317 public static long getFileVersionFileEntryMetadatasCount(long fileVersionId) { 318 return getService().getFileVersionFileEntryMetadatasCount(fileVersionId); 319 } 320 321 public static void deleteFileEntryMetadata( 322 com.liferay.document.library.kernel.model.DLFileEntryMetadata fileEntryMetadata) 323 throws com.liferay.portal.kernel.exception.PortalException { 324 getService().deleteFileEntryMetadata(fileEntryMetadata); 325 } 326 327 public static void deleteFileEntryMetadata(long fileEntryId) 328 throws com.liferay.portal.kernel.exception.PortalException { 329 getService().deleteFileEntryMetadata(fileEntryId); 330 } 331 332 public static void deleteFileVersionFileEntryMetadata(long fileVersionId) 333 throws com.liferay.portal.kernel.exception.PortalException { 334 getService().deleteFileVersionFileEntryMetadata(fileVersionId); 335 } 336 337 public static void updateFileEntryMetadata(long companyId, 338 java.util.List<com.liferay.dynamic.data.mapping.kernel.DDMStructure> ddmStructures, 339 long fileEntryId, long fileVersionId, 340 java.util.Map<java.lang.String, com.liferay.dynamic.data.mapping.kernel.DDMFormValues> ddmFormValuesMap, 341 com.liferay.portal.kernel.service.ServiceContext serviceContext) 342 throws com.liferay.portal.kernel.exception.PortalException { 343 getService() 344 .updateFileEntryMetadata(companyId, ddmStructures, fileEntryId, 345 fileVersionId, ddmFormValuesMap, serviceContext); 346 } 347 348 public static void updateFileEntryMetadata(long fileEntryTypeId, 349 long fileEntryId, long fileVersionId, 350 java.util.Map<java.lang.String, com.liferay.dynamic.data.mapping.kernel.DDMFormValues> ddmFormValuesMap, 351 com.liferay.portal.kernel.service.ServiceContext serviceContext) 352 throws com.liferay.portal.kernel.exception.PortalException { 353 getService() 354 .updateFileEntryMetadata(fileEntryTypeId, fileEntryId, 355 fileVersionId, ddmFormValuesMap, serviceContext); 356 } 357 358 public static DLFileEntryMetadataLocalService getService() { 359 if (_service == null) { 360 _service = (DLFileEntryMetadataLocalService)PortalBeanLocatorUtil.locate(DLFileEntryMetadataLocalService.class.getName()); 361 362 ReferenceRegistry.registerReference(DLFileEntryMetadataLocalServiceUtil.class, 363 "_service"); 364 } 365 366 return _service; 367 } 368 369 private static DLFileEntryMetadataLocalService _service; 370 }