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.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.search.IndexableType; 022 import com.liferay.portal.kernel.transaction.Isolation; 023 import com.liferay.portal.kernel.transaction.Propagation; 024 import com.liferay.portal.kernel.transaction.Transactional; 025 import com.liferay.portal.service.BaseLocalService; 026 import com.liferay.portal.service.PersistedModelLocalService; 027 028 /** 029 * Provides the local service interface for DLContent. Methods of this 030 * service will not have security checks based on the propagated JAAS 031 * credentials because this service can only be accessed from within the same 032 * VM. 033 * 034 * @author Brian Wing Shun Chan 035 * @see DLContentLocalServiceUtil 036 * @see com.liferay.portlet.documentlibrary.service.base.DLContentLocalServiceBaseImpl 037 * @see com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl 038 * @generated 039 */ 040 @ProviderType 041 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 042 PortalException.class, SystemException.class}) 043 public interface DLContentLocalService extends BaseLocalService, 044 PersistedModelLocalService { 045 /* 046 * NOTE FOR DEVELOPERS: 047 * 048 * Never modify or reference this interface directly. Always use {@link DLContentLocalServiceUtil} to access the document library content local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLContentLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 049 */ 050 public com.liferay.portlet.documentlibrary.model.DLContent addContent( 051 long companyId, long repositoryId, java.lang.String path, 052 java.lang.String version, byte[] bytes); 053 054 public com.liferay.portlet.documentlibrary.model.DLContent addContent( 055 long companyId, long repositoryId, java.lang.String path, 056 java.lang.String version, java.io.InputStream inputStream, long size); 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 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 065 public com.liferay.portlet.documentlibrary.model.DLContent addDLContent( 066 com.liferay.portlet.documentlibrary.model.DLContent dlContent); 067 068 /** 069 * Creates a new document library content with the primary key. Does not add the document library content to the database. 070 * 071 * @param contentId the primary key for the new document library content 072 * @return the new document library content 073 */ 074 public com.liferay.portlet.documentlibrary.model.DLContent createDLContent( 075 long contentId); 076 077 public void deleteContent(long companyId, long repositoryId, 078 java.lang.String path, java.lang.String version) 079 throws PortalException; 080 081 public void deleteContents(long companyId, long repositoryId, 082 java.lang.String path); 083 084 public void deleteContentsByDirectory(long companyId, long repositoryId, 085 java.lang.String dirName); 086 087 /** 088 * Deletes the document library content with the primary key from the database. Also notifies the appropriate model listeners. 089 * 090 * @param contentId the primary key of the document library content 091 * @return the document library content that was removed 092 * @throws PortalException if a document library content with the primary key could not be found 093 */ 094 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 095 public com.liferay.portlet.documentlibrary.model.DLContent deleteDLContent( 096 long contentId) throws PortalException; 097 098 /** 099 * Deletes the document library content from the database. Also notifies the appropriate model listeners. 100 * 101 * @param dlContent the document library content 102 * @return the document library content that was removed 103 */ 104 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 105 public com.liferay.portlet.documentlibrary.model.DLContent deleteDLContent( 106 com.liferay.portlet.documentlibrary.model.DLContent dlContent); 107 108 /** 109 * @throws PortalException 110 */ 111 @Override 112 public com.liferay.portal.model.PersistedModel deletePersistedModel( 113 com.liferay.portal.model.PersistedModel persistedModel) 114 throws PortalException; 115 116 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 117 118 /** 119 * Performs a dynamic query on the database and returns the matching rows. 120 * 121 * @param dynamicQuery the dynamic query 122 * @return the matching rows 123 */ 124 public <T> java.util.List<T> dynamicQuery( 125 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 126 127 /** 128 * Performs a dynamic query on the database and returns a range of the matching rows. 129 * 130 * <p> 131 * 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. 132 * </p> 133 * 134 * @param dynamicQuery the dynamic query 135 * @param start the lower bound of the range of model instances 136 * @param end the upper bound of the range of model instances (not inclusive) 137 * @return the range of matching rows 138 */ 139 public <T> java.util.List<T> dynamicQuery( 140 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 141 int end); 142 143 /** 144 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 145 * 146 * <p> 147 * 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. 148 * </p> 149 * 150 * @param dynamicQuery the dynamic query 151 * @param start the lower bound of the range of model instances 152 * @param end the upper bound of the range of model instances (not inclusive) 153 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 154 * @return the ordered range of matching rows 155 */ 156 public <T> java.util.List<T> dynamicQuery( 157 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 158 int end, 159 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator); 160 161 /** 162 * Returns the number of rows matching the dynamic query. 163 * 164 * @param dynamicQuery the dynamic query 165 * @return the number of rows matching the dynamic query 166 */ 167 public long dynamicQueryCount( 168 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 169 170 /** 171 * Returns the number of rows matching the dynamic query. 172 * 173 * @param dynamicQuery the dynamic query 174 * @param projection the projection to apply to the query 175 * @return the number of rows matching the dynamic query 176 */ 177 public long dynamicQueryCount( 178 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 179 com.liferay.portal.kernel.dao.orm.Projection projection); 180 181 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 182 public com.liferay.portlet.documentlibrary.model.DLContent fetchDLContent( 183 long contentId); 184 185 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 186 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(); 187 188 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 189 public com.liferay.portlet.documentlibrary.model.DLContent getContent( 190 long companyId, long repositoryId, java.lang.String path) 191 throws com.liferay.portlet.documentlibrary.exception.NoSuchContentException; 192 193 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 194 public com.liferay.portlet.documentlibrary.model.DLContent getContent( 195 long companyId, long repositoryId, java.lang.String path, 196 java.lang.String version) 197 throws com.liferay.portlet.documentlibrary.exception.NoSuchContentException; 198 199 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 200 public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents( 201 long companyId, long repositoryId); 202 203 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 204 public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContents( 205 long companyId, long repositoryId, java.lang.String path); 206 207 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 208 public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getContentsByDirectory( 209 long companyId, long repositoryId, java.lang.String dirName); 210 211 /** 212 * Returns the document library content with the primary key. 213 * 214 * @param contentId the primary key of the document library content 215 * @return the document library content 216 * @throws PortalException if a document library content with the primary key could not be found 217 */ 218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 219 public com.liferay.portlet.documentlibrary.model.DLContent getDLContent( 220 long contentId) throws PortalException; 221 222 /** 223 * Returns a range of all the document library contents. 224 * 225 * <p> 226 * 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. 227 * </p> 228 * 229 * @param start the lower bound of the range of document library contents 230 * @param end the upper bound of the range of document library contents (not inclusive) 231 * @return the range of document library contents 232 */ 233 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 234 public java.util.List<com.liferay.portlet.documentlibrary.model.DLContent> getDLContents( 235 int start, int end); 236 237 /** 238 * Returns the number of document library contents. 239 * 240 * @return the number of document library contents 241 */ 242 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 243 public int getDLContentsCount(); 244 245 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 246 public com.liferay.portlet.documentlibrary.model.DLContentDataBlobModel getDataBlobModel( 247 java.io.Serializable primaryKey); 248 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 251 252 /** 253 * Returns the OSGi service identifier. 254 * 255 * @return the OSGi service identifier 256 */ 257 public java.lang.String getOSGiServiceIdentifier(); 258 259 @Override 260 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 261 public com.liferay.portal.model.PersistedModel getPersistedModel( 262 java.io.Serializable primaryKeyObj) throws PortalException; 263 264 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 265 public boolean hasContent(long companyId, long repositoryId, 266 java.lang.String path, java.lang.String version); 267 268 public void updateDLContent(long companyId, long oldRepositoryId, 269 long newRepositoryId, java.lang.String oldPath, java.lang.String newPath); 270 271 /** 272 * Updates the document library content in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 273 * 274 * @param dlContent the document library content 275 * @return the document library content that was updated 276 */ 277 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 278 public com.liferay.portlet.documentlibrary.model.DLContent updateDLContent( 279 com.liferay.portlet.documentlibrary.model.DLContent dlContent); 280 }