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.portal.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.exportimport.kernel.lar.PortletDataContext; 020 021 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 023 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery; 024 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 025 import com.liferay.portal.kernel.dao.orm.Projection; 026 import com.liferay.portal.kernel.exception.PortalException; 027 import com.liferay.portal.kernel.exception.SystemException; 028 import com.liferay.portal.kernel.model.PersistedModel; 029 import com.liferay.portal.kernel.model.Repository; 030 import com.liferay.portal.kernel.model.SystemEventConstants; 031 import com.liferay.portal.kernel.search.Indexable; 032 import com.liferay.portal.kernel.search.IndexableType; 033 import com.liferay.portal.kernel.systemevent.SystemEvent; 034 import com.liferay.portal.kernel.transaction.Isolation; 035 import com.liferay.portal.kernel.transaction.Propagation; 036 import com.liferay.portal.kernel.transaction.Transactional; 037 import com.liferay.portal.kernel.util.OrderByComparator; 038 import com.liferay.portal.kernel.util.UnicodeProperties; 039 040 import java.io.Serializable; 041 042 import java.util.List; 043 044 /** 045 * Provides the local service interface for Repository. Methods of this 046 * service will not have security checks based on the propagated JAAS 047 * credentials because this service can only be accessed from within the same 048 * VM. 049 * 050 * @author Brian Wing Shun Chan 051 * @see RepositoryLocalServiceUtil 052 * @see com.liferay.portal.service.base.RepositoryLocalServiceBaseImpl 053 * @see com.liferay.portal.service.impl.RepositoryLocalServiceImpl 054 * @generated 055 */ 056 @ProviderType 057 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 058 PortalException.class, SystemException.class}) 059 public interface RepositoryLocalService extends BaseLocalService, 060 PersistedModelLocalService { 061 /* 062 * NOTE FOR DEVELOPERS: 063 * 064 * Never modify or reference this interface directly. Always use {@link RepositoryLocalServiceUtil} to access the repository local service. Add custom service methods to {@link com.liferay.portal.service.impl.RepositoryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 065 */ 066 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 067 public ActionableDynamicQuery getActionableDynamicQuery(); 068 069 public DynamicQuery dynamicQuery(); 070 071 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 072 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 073 PortletDataContext portletDataContext); 074 075 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 076 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 077 078 /** 079 * @throws PortalException 080 */ 081 @Override 082 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 083 throws PortalException; 084 085 @Override 086 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 087 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 088 throws PortalException; 089 090 /** 091 * Adds the repository to the database. Also notifies the appropriate model listeners. 092 * 093 * @param repository the repository 094 * @return the repository that was added 095 */ 096 @Indexable(type = IndexableType.REINDEX) 097 public Repository addRepository(Repository repository); 098 099 public Repository addRepository(long userId, long groupId, 100 long classNameId, long parentFolderId, java.lang.String name, 101 java.lang.String description, java.lang.String portletId, 102 UnicodeProperties typeSettingsProperties, boolean hidden, 103 ServiceContext serviceContext) throws PortalException; 104 105 /** 106 * Creates a new repository with the primary key. Does not add the repository to the database. 107 * 108 * @param repositoryId the primary key for the new repository 109 * @return the new repository 110 */ 111 public Repository createRepository(long repositoryId); 112 113 /** 114 * Deletes the repository from the database. Also notifies the appropriate model listeners. 115 * 116 * @param repository the repository 117 * @return the repository that was removed 118 */ 119 @Indexable(type = IndexableType.DELETE) 120 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE) 121 public Repository deleteRepository(Repository repository); 122 123 /** 124 * Deletes the repository with the primary key from the database. Also notifies the appropriate model listeners. 125 * 126 * @param repositoryId the primary key of the repository 127 * @return the repository that was removed 128 * @throws PortalException if a repository with the primary key could not be found 129 */ 130 @Indexable(type = IndexableType.DELETE) 131 public Repository deleteRepository(long repositoryId) 132 throws PortalException; 133 134 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 135 public Repository fetchRepository(long groupId, java.lang.String name, 136 java.lang.String portletId); 137 138 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 139 public Repository fetchRepository(long groupId, java.lang.String portletId); 140 141 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 142 public Repository fetchRepository(long repositoryId); 143 144 /** 145 * Returns the repository matching the UUID and group. 146 * 147 * @param uuid the repository's UUID 148 * @param groupId the primary key of the group 149 * @return the matching repository, or <code>null</code> if a matching repository could not be found 150 */ 151 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 152 public Repository fetchRepositoryByUuidAndGroupId(java.lang.String uuid, 153 long groupId); 154 155 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 156 public Repository getRepository(long groupId, java.lang.String name, 157 java.lang.String portletId) throws PortalException; 158 159 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 160 public Repository getRepository(long groupId, java.lang.String portletId) 161 throws PortalException; 162 163 /** 164 * Returns the repository with the primary key. 165 * 166 * @param repositoryId the primary key of the repository 167 * @return the repository 168 * @throws PortalException if a repository with the primary key could not be found 169 */ 170 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 171 public Repository getRepository(long repositoryId) 172 throws PortalException; 173 174 /** 175 * Returns the repository matching the UUID and group. 176 * 177 * @param uuid the repository's UUID 178 * @param groupId the primary key of the group 179 * @return the matching repository 180 * @throws PortalException if a matching repository could not be found 181 */ 182 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 183 public Repository getRepositoryByUuidAndGroupId(java.lang.String uuid, 184 long groupId) throws PortalException; 185 186 /** 187 * Updates the repository in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 188 * 189 * @param repository the repository 190 * @return the repository that was updated 191 */ 192 @Indexable(type = IndexableType.REINDEX) 193 public Repository updateRepository(Repository repository); 194 195 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 196 public UnicodeProperties getTypeSettingsProperties(long repositoryId) 197 throws PortalException; 198 199 /** 200 * Returns the number of repositories. 201 * 202 * @return the number of repositories 203 */ 204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 205 public int getRepositoriesCount(); 206 207 /** 208 * Returns the OSGi service identifier. 209 * 210 * @return the OSGi service identifier 211 */ 212 public java.lang.String getOSGiServiceIdentifier(); 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 <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 221 222 /** 223 * Performs a dynamic query on the database and returns a range of the matching rows. 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.portal.model.impl.RepositoryModelImpl}. 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 dynamicQuery the dynamic query 230 * @param start the lower bound of the range of model instances 231 * @param end the upper bound of the range of model instances (not inclusive) 232 * @return the range of matching rows 233 */ 234 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 235 int end); 236 237 /** 238 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 239 * 240 * <p> 241 * 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.portal.model.impl.RepositoryModelImpl}. 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. 242 * </p> 243 * 244 * @param dynamicQuery the dynamic query 245 * @param start the lower bound of the range of model instances 246 * @param end the upper bound of the range of model instances (not inclusive) 247 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 248 * @return the ordered range of matching rows 249 */ 250 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 251 int end, OrderByComparator<T> orderByComparator); 252 253 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 254 public List<Repository> getGroupRepositories(long groupId); 255 256 /** 257 * Returns a range of all the repositories. 258 * 259 * <p> 260 * 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.portal.model.impl.RepositoryModelImpl}. 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. 261 * </p> 262 * 263 * @param start the lower bound of the range of repositories 264 * @param end the upper bound of the range of repositories (not inclusive) 265 * @return the range of repositories 266 */ 267 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 268 public List<Repository> getRepositories(int start, int end); 269 270 /** 271 * Returns all the repositories matching the UUID and company. 272 * 273 * @param uuid the UUID of the repositories 274 * @param companyId the primary key of the company 275 * @return the matching repositories, or an empty list if no matches were found 276 */ 277 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 278 public List<Repository> getRepositoriesByUuidAndCompanyId( 279 java.lang.String uuid, long companyId); 280 281 /** 282 * Returns a range of repositories matching the UUID and company. 283 * 284 * @param uuid the UUID of the repositories 285 * @param companyId the primary key of the company 286 * @param start the lower bound of the range of repositories 287 * @param end the upper bound of the range of repositories (not inclusive) 288 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 289 * @return the range of matching repositories, or an empty list if no matches were found 290 */ 291 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 292 public List<Repository> getRepositoriesByUuidAndCompanyId( 293 java.lang.String uuid, long companyId, int start, int end, 294 OrderByComparator<Repository> orderByComparator); 295 296 /** 297 * Returns the number of rows matching the dynamic query. 298 * 299 * @param dynamicQuery the dynamic query 300 * @return the number of rows matching the dynamic query 301 */ 302 public long dynamicQueryCount(DynamicQuery dynamicQuery); 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 long dynamicQueryCount(DynamicQuery dynamicQuery, 312 Projection projection); 313 314 public void checkRepository(long repositoryId); 315 316 public void deleteRepositories(long groupId) throws PortalException; 317 318 public void updateRepository(long repositoryId, 319 UnicodeProperties typeSettingsProperties) throws PortalException; 320 321 public void updateRepository(long repositoryId, java.lang.String name, 322 java.lang.String description) throws PortalException; 323 }