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.document.library.kernel.model.DLFileEntryMetadata; 020 021 import com.liferay.dynamic.data.mapping.kernel.DDMFormValues; 022 import com.liferay.dynamic.data.mapping.kernel.DDMStructure; 023 024 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 025 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 026 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 027 import com.liferay.portal.kernel.dao.orm.Projection; 028 import com.liferay.portal.kernel.exception.PortalException; 029 import com.liferay.portal.kernel.exception.SystemException; 030 import com.liferay.portal.kernel.model.PersistedModel; 031 import com.liferay.portal.kernel.search.Indexable; 032 import com.liferay.portal.kernel.search.IndexableType; 033 import com.liferay.portal.kernel.service.BaseLocalService; 034 import com.liferay.portal.kernel.service.PersistedModelLocalService; 035 import com.liferay.portal.kernel.service.ServiceContext; 036 import com.liferay.portal.kernel.transaction.Isolation; 037 import com.liferay.portal.kernel.transaction.Propagation; 038 import com.liferay.portal.kernel.transaction.Transactional; 039 import com.liferay.portal.kernel.util.OrderByComparator; 040 041 import java.io.Serializable; 042 043 import java.util.List; 044 import java.util.Map; 045 046 /** 047 * Provides the local service interface for DLFileEntryMetadata. Methods of this 048 * service will not have security checks based on the propagated JAAS 049 * credentials because this service can only be accessed from within the same 050 * VM. 051 * 052 * @author Brian Wing Shun Chan 053 * @see DLFileEntryMetadataLocalServiceUtil 054 * @see com.liferay.portlet.documentlibrary.service.base.DLFileEntryMetadataLocalServiceBaseImpl 055 * @see com.liferay.portlet.documentlibrary.service.impl.DLFileEntryMetadataLocalServiceImpl 056 * @generated 057 */ 058 @ProviderType 059 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 060 PortalException.class, SystemException.class}) 061 public interface DLFileEntryMetadataLocalService extends BaseLocalService, 062 PersistedModelLocalService { 063 /* 064 * NOTE FOR DEVELOPERS: 065 * 066 * Never modify or reference this interface directly. Always use {@link DLFileEntryMetadataLocalServiceUtil} to access the document library file entry metadata local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileEntryMetadataLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 067 */ 068 069 /** 070 * Adds the document library file entry metadata to the database. Also notifies the appropriate model listeners. 071 * 072 * @param dlFileEntryMetadata the document library file entry metadata 073 * @return the document library file entry metadata that was added 074 */ 075 @Indexable(type = IndexableType.REINDEX) 076 public DLFileEntryMetadata addDLFileEntryMetadata( 077 DLFileEntryMetadata dlFileEntryMetadata); 078 079 /** 080 * Creates a new document library file entry metadata with the primary key. Does not add the document library file entry metadata to the database. 081 * 082 * @param fileEntryMetadataId the primary key for the new document library file entry metadata 083 * @return the new document library file entry metadata 084 */ 085 public DLFileEntryMetadata createDLFileEntryMetadata( 086 long fileEntryMetadataId); 087 088 /** 089 * Deletes the document library file entry metadata from the database. Also notifies the appropriate model listeners. 090 * 091 * @param dlFileEntryMetadata the document library file entry metadata 092 * @return the document library file entry metadata that was removed 093 */ 094 @Indexable(type = IndexableType.DELETE) 095 public DLFileEntryMetadata deleteDLFileEntryMetadata( 096 DLFileEntryMetadata dlFileEntryMetadata); 097 098 /** 099 * Deletes the document library file entry metadata with the primary key from the database. Also notifies the appropriate model listeners. 100 * 101 * @param fileEntryMetadataId the primary key of the document library file entry metadata 102 * @return the document library file entry metadata that was removed 103 * @throws PortalException if a document library file entry metadata with the primary key could not be found 104 */ 105 @Indexable(type = IndexableType.DELETE) 106 public DLFileEntryMetadata deleteDLFileEntryMetadata( 107 long fileEntryMetadataId) throws PortalException; 108 109 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 110 public DLFileEntryMetadata fetchDLFileEntryMetadata( 111 long fileEntryMetadataId); 112 113 /** 114 * Returns the document library file entry metadata with the matching UUID and company. 115 * 116 * @param uuid the document library file entry metadata's UUID 117 * @param companyId the primary key of the company 118 * @return the matching document library file entry metadata, or <code>null</code> if a matching document library file entry metadata could not be found 119 */ 120 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 121 public DLFileEntryMetadata fetchDLFileEntryMetadataByUuidAndCompanyId( 122 java.lang.String uuid, long companyId); 123 124 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 125 public DLFileEntryMetadata fetchFileEntryMetadata(long ddmStructureId, 126 long fileVersionId); 127 128 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 129 public DLFileEntryMetadata fetchFileEntryMetadata(long fileEntryMetadataId); 130 131 /** 132 * Returns the document library file entry metadata with the primary key. 133 * 134 * @param fileEntryMetadataId the primary key of the document library file entry metadata 135 * @return the document library file entry metadata 136 * @throws PortalException if a document library file entry metadata with the primary key could not be found 137 */ 138 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 139 public DLFileEntryMetadata getDLFileEntryMetadata(long fileEntryMetadataId) 140 throws PortalException; 141 142 /** 143 * Returns the document library file entry metadata with the matching UUID and company. 144 * 145 * @param uuid the document library file entry metadata's UUID 146 * @param companyId the primary key of the company 147 * @return the matching document library file entry metadata 148 * @throws PortalException if a matching document library file entry metadata could not be found 149 */ 150 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 151 public DLFileEntryMetadata getDLFileEntryMetadataByUuidAndCompanyId( 152 java.lang.String uuid, long companyId) throws PortalException; 153 154 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 155 public DLFileEntryMetadata getFileEntryMetadata(long ddmStructureId, 156 long fileVersionId) throws PortalException; 157 158 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 159 public DLFileEntryMetadata getFileEntryMetadata(long fileEntryMetadataId) 160 throws PortalException; 161 162 /** 163 * 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. 164 * 165 * @param dlFileEntryMetadata the document library file entry metadata 166 * @return the document library file entry metadata that was updated 167 */ 168 @Indexable(type = IndexableType.REINDEX) 169 public DLFileEntryMetadata updateDLFileEntryMetadata( 170 DLFileEntryMetadata dlFileEntryMetadata); 171 172 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 173 public ActionableDynamicQuery getActionableDynamicQuery(); 174 175 public DynamicQuery dynamicQuery(); 176 177 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 178 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 179 180 /** 181 * @throws PortalException 182 */ 183 @Override 184 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 185 throws PortalException; 186 187 @Override 188 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 189 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 190 throws PortalException; 191 192 /** 193 * Returns the number of document library file entry metadatas. 194 * 195 * @return the number of document library file entry metadatas 196 */ 197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 198 public int getDLFileEntryMetadatasCount(); 199 200 /** 201 * Returns the OSGi service identifier. 202 * 203 * @return the OSGi service identifier 204 */ 205 public java.lang.String getOSGiServiceIdentifier(); 206 207 /** 208 * Performs a dynamic query on the database and returns the matching rows. 209 * 210 * @param dynamicQuery the dynamic query 211 * @return the matching rows 212 */ 213 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 214 215 /** 216 * Performs a dynamic query on the database and returns a range of the matching rows. 217 * 218 * <p> 219 * 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. 220 * </p> 221 * 222 * @param dynamicQuery the dynamic query 223 * @param start the lower bound of the range of model instances 224 * @param end the upper bound of the range of model instances (not inclusive) 225 * @return the range of matching rows 226 */ 227 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 228 int end); 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.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. 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 <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 244 int end, OrderByComparator<T> orderByComparator); 245 246 /** 247 * Returns a range of all the document library file entry metadatas. 248 * 249 * <p> 250 * 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. 251 * </p> 252 * 253 * @param start the lower bound of the range of document library file entry metadatas 254 * @param end the upper bound of the range of document library file entry metadatas (not inclusive) 255 * @return the range of document library file entry metadatas 256 */ 257 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 258 public List<DLFileEntryMetadata> getDLFileEntryMetadatas(int start, int end); 259 260 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 261 public List<DLFileEntryMetadata> getFileVersionFileEntryMetadatas( 262 long fileVersionId); 263 264 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 265 public List<DLFileEntryMetadata> getMismatchedCompanyIdFileEntryMetadatas(); 266 267 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 268 public List<DLFileEntryMetadata> getNoStructuresFileEntryMetadatas(); 269 270 /** 271 * Returns the number of rows matching the dynamic query. 272 * 273 * @param dynamicQuery the dynamic query 274 * @return the number of rows matching the dynamic query 275 */ 276 public long dynamicQueryCount(DynamicQuery dynamicQuery); 277 278 /** 279 * Returns the number of rows matching the dynamic query. 280 * 281 * @param dynamicQuery the dynamic query 282 * @param projection the projection to apply to the query 283 * @return the number of rows matching the dynamic query 284 */ 285 public long dynamicQueryCount(DynamicQuery dynamicQuery, 286 Projection projection); 287 288 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 289 public long getFileVersionFileEntryMetadatasCount(long fileVersionId); 290 291 public void deleteFileEntryMetadata(DLFileEntryMetadata fileEntryMetadata) 292 throws PortalException; 293 294 public void deleteFileEntryMetadata(long fileEntryId) 295 throws PortalException; 296 297 public void deleteFileVersionFileEntryMetadata(long fileVersionId) 298 throws PortalException; 299 300 public void updateFileEntryMetadata(long companyId, 301 List<DDMStructure> ddmStructures, long fileEntryId, long fileVersionId, 302 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, 303 ServiceContext serviceContext) throws PortalException; 304 305 public void updateFileEntryMetadata(long fileEntryTypeId, long fileEntryId, 306 long fileVersionId, 307 Map<java.lang.String, DDMFormValues> ddmFormValuesMap, 308 ServiceContext serviceContext) throws PortalException; 309 }