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.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for Repository. This utility wraps 024 * {@link com.liferay.portal.service.impl.RepositoryLocalServiceImpl} 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 RepositoryLocalService 032 * @see com.liferay.portal.service.base.RepositoryLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.RepositoryLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class RepositoryLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.RepositoryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the repository to the database. Also notifies the appropriate model listeners. 046 * 047 * @param repository the repository 048 * @return the repository that was added 049 */ 050 public static com.liferay.portal.kernel.model.Repository addRepository( 051 com.liferay.portal.kernel.model.Repository repository) { 052 return getService().addRepository(repository); 053 } 054 055 public static com.liferay.portal.kernel.model.Repository addRepository( 056 long userId, long groupId, long classNameId, long parentFolderId, 057 java.lang.String name, java.lang.String description, 058 java.lang.String portletId, 059 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties, 060 boolean hidden, 061 com.liferay.portal.kernel.service.ServiceContext serviceContext) 062 throws com.liferay.portal.kernel.exception.PortalException { 063 return getService() 064 .addRepository(userId, groupId, classNameId, parentFolderId, 065 name, description, portletId, typeSettingsProperties, hidden, 066 serviceContext); 067 } 068 069 public static void checkRepository(long repositoryId) { 070 getService().checkRepository(repositoryId); 071 } 072 073 /** 074 * Creates a new repository with the primary key. Does not add the repository to the database. 075 * 076 * @param repositoryId the primary key for the new repository 077 * @return the new repository 078 */ 079 public static com.liferay.portal.kernel.model.Repository createRepository( 080 long repositoryId) { 081 return getService().createRepository(repositoryId); 082 } 083 084 /** 085 * @throws PortalException 086 */ 087 public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( 088 com.liferay.portal.kernel.model.PersistedModel persistedModel) 089 throws com.liferay.portal.kernel.exception.PortalException { 090 return getService().deletePersistedModel(persistedModel); 091 } 092 093 public static void deleteRepositories(long groupId) 094 throws com.liferay.portal.kernel.exception.PortalException { 095 getService().deleteRepositories(groupId); 096 } 097 098 /** 099 * Deletes the repository from the database. Also notifies the appropriate model listeners. 100 * 101 * @param repository the repository 102 * @return the repository that was removed 103 */ 104 public static com.liferay.portal.kernel.model.Repository deleteRepository( 105 com.liferay.portal.kernel.model.Repository repository) { 106 return getService().deleteRepository(repository); 107 } 108 109 /** 110 * Deletes the repository with the primary key from the database. Also notifies the appropriate model listeners. 111 * 112 * @param repositoryId the primary key of the repository 113 * @return the repository that was removed 114 * @throws PortalException if a repository with the primary key could not be found 115 */ 116 public static com.liferay.portal.kernel.model.Repository deleteRepository( 117 long repositoryId) 118 throws com.liferay.portal.kernel.exception.PortalException { 119 return getService().deleteRepository(repositoryId); 120 } 121 122 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 123 return getService().dynamicQuery(); 124 } 125 126 /** 127 * Performs a dynamic query on the database and returns the matching rows. 128 * 129 * @param dynamicQuery the dynamic query 130 * @return the matching rows 131 */ 132 public static <T> java.util.List<T> dynamicQuery( 133 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 134 return getService().dynamicQuery(dynamicQuery); 135 } 136 137 /** 138 * Performs a dynamic query on the database and returns a range of the matching rows. 139 * 140 * <p> 141 * 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. 142 * </p> 143 * 144 * @param dynamicQuery the dynamic query 145 * @param start the lower bound of the range of model instances 146 * @param end the upper bound of the range of model instances (not inclusive) 147 * @return the range of matching rows 148 */ 149 public static <T> java.util.List<T> dynamicQuery( 150 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 151 int end) { 152 return getService().dynamicQuery(dynamicQuery, start, end); 153 } 154 155 /** 156 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 157 * 158 * <p> 159 * 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. 160 * </p> 161 * 162 * @param dynamicQuery the dynamic query 163 * @param start the lower bound of the range of model instances 164 * @param end the upper bound of the range of model instances (not inclusive) 165 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 166 * @return the ordered range of matching rows 167 */ 168 public static <T> java.util.List<T> dynamicQuery( 169 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 170 int end, 171 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 172 return getService() 173 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 174 } 175 176 /** 177 * Returns the number of rows matching the dynamic query. 178 * 179 * @param dynamicQuery the dynamic query 180 * @return the number of rows matching the dynamic query 181 */ 182 public static long dynamicQueryCount( 183 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 184 return getService().dynamicQueryCount(dynamicQuery); 185 } 186 187 /** 188 * Returns the number of rows matching the dynamic query. 189 * 190 * @param dynamicQuery the dynamic query 191 * @param projection the projection to apply to the query 192 * @return the number of rows matching the dynamic query 193 */ 194 public static long dynamicQueryCount( 195 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 196 com.liferay.portal.kernel.dao.orm.Projection projection) { 197 return getService().dynamicQueryCount(dynamicQuery, projection); 198 } 199 200 public static com.liferay.portal.kernel.model.Repository fetchRepository( 201 long groupId, java.lang.String name, java.lang.String portletId) { 202 return getService().fetchRepository(groupId, name, portletId); 203 } 204 205 public static com.liferay.portal.kernel.model.Repository fetchRepository( 206 long groupId, java.lang.String portletId) { 207 return getService().fetchRepository(groupId, portletId); 208 } 209 210 public static com.liferay.portal.kernel.model.Repository fetchRepository( 211 long repositoryId) { 212 return getService().fetchRepository(repositoryId); 213 } 214 215 /** 216 * Returns the repository matching the UUID and group. 217 * 218 * @param uuid the repository's UUID 219 * @param groupId the primary key of the group 220 * @return the matching repository, or <code>null</code> if a matching repository could not be found 221 */ 222 public static com.liferay.portal.kernel.model.Repository fetchRepositoryByUuidAndGroupId( 223 java.lang.String uuid, long groupId) { 224 return getService().fetchRepositoryByUuidAndGroupId(uuid, groupId); 225 } 226 227 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 228 return getService().getActionableDynamicQuery(); 229 } 230 231 public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 232 com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) { 233 return getService().getExportActionableDynamicQuery(portletDataContext); 234 } 235 236 public static java.util.List<com.liferay.portal.kernel.model.Repository> getGroupRepositories( 237 long groupId) { 238 return getService().getGroupRepositories(groupId); 239 } 240 241 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 242 return getService().getIndexableActionableDynamicQuery(); 243 } 244 245 /** 246 * Returns the OSGi service identifier. 247 * 248 * @return the OSGi service identifier 249 */ 250 public static java.lang.String getOSGiServiceIdentifier() { 251 return getService().getOSGiServiceIdentifier(); 252 } 253 254 public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel( 255 java.io.Serializable primaryKeyObj) 256 throws com.liferay.portal.kernel.exception.PortalException { 257 return getService().getPersistedModel(primaryKeyObj); 258 } 259 260 /** 261 * Returns a range of all the repositories. 262 * 263 * <p> 264 * 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. 265 * </p> 266 * 267 * @param start the lower bound of the range of repositories 268 * @param end the upper bound of the range of repositories (not inclusive) 269 * @return the range of repositories 270 */ 271 public static java.util.List<com.liferay.portal.kernel.model.Repository> getRepositories( 272 int start, int end) { 273 return getService().getRepositories(start, end); 274 } 275 276 /** 277 * Returns all the repositories matching the UUID and company. 278 * 279 * @param uuid the UUID of the repositories 280 * @param companyId the primary key of the company 281 * @return the matching repositories, or an empty list if no matches were found 282 */ 283 public static java.util.List<com.liferay.portal.kernel.model.Repository> getRepositoriesByUuidAndCompanyId( 284 java.lang.String uuid, long companyId) { 285 return getService().getRepositoriesByUuidAndCompanyId(uuid, companyId); 286 } 287 288 /** 289 * Returns a range of repositories matching the UUID and company. 290 * 291 * @param uuid the UUID of the repositories 292 * @param companyId the primary key of the company 293 * @param start the lower bound of the range of repositories 294 * @param end the upper bound of the range of repositories (not inclusive) 295 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 296 * @return the range of matching repositories, or an empty list if no matches were found 297 */ 298 public static java.util.List<com.liferay.portal.kernel.model.Repository> getRepositoriesByUuidAndCompanyId( 299 java.lang.String uuid, long companyId, int start, int end, 300 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Repository> orderByComparator) { 301 return getService() 302 .getRepositoriesByUuidAndCompanyId(uuid, companyId, start, 303 end, orderByComparator); 304 } 305 306 /** 307 * Returns the number of repositories. 308 * 309 * @return the number of repositories 310 */ 311 public static int getRepositoriesCount() { 312 return getService().getRepositoriesCount(); 313 } 314 315 public static com.liferay.portal.kernel.model.Repository getRepository( 316 long groupId, java.lang.String name, java.lang.String portletId) 317 throws com.liferay.portal.kernel.exception.PortalException { 318 return getService().getRepository(groupId, name, portletId); 319 } 320 321 public static com.liferay.portal.kernel.model.Repository getRepository( 322 long groupId, java.lang.String portletId) 323 throws com.liferay.portal.kernel.exception.PortalException { 324 return getService().getRepository(groupId, portletId); 325 } 326 327 /** 328 * Returns the repository with the primary key. 329 * 330 * @param repositoryId the primary key of the repository 331 * @return the repository 332 * @throws PortalException if a repository with the primary key could not be found 333 */ 334 public static com.liferay.portal.kernel.model.Repository getRepository( 335 long repositoryId) 336 throws com.liferay.portal.kernel.exception.PortalException { 337 return getService().getRepository(repositoryId); 338 } 339 340 /** 341 * Returns the repository matching the UUID and group. 342 * 343 * @param uuid the repository's UUID 344 * @param groupId the primary key of the group 345 * @return the matching repository 346 * @throws PortalException if a matching repository could not be found 347 */ 348 public static com.liferay.portal.kernel.model.Repository getRepositoryByUuidAndGroupId( 349 java.lang.String uuid, long groupId) 350 throws com.liferay.portal.kernel.exception.PortalException { 351 return getService().getRepositoryByUuidAndGroupId(uuid, groupId); 352 } 353 354 public static com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties( 355 long repositoryId) 356 throws com.liferay.portal.kernel.exception.PortalException { 357 return getService().getTypeSettingsProperties(repositoryId); 358 } 359 360 /** 361 * Updates the repository in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 362 * 363 * @param repository the repository 364 * @return the repository that was updated 365 */ 366 public static com.liferay.portal.kernel.model.Repository updateRepository( 367 com.liferay.portal.kernel.model.Repository repository) { 368 return getService().updateRepository(repository); 369 } 370 371 public static void updateRepository(long repositoryId, 372 java.lang.String name, java.lang.String description) 373 throws com.liferay.portal.kernel.exception.PortalException { 374 getService().updateRepository(repositoryId, name, description); 375 } 376 377 public static void updateRepository(long repositoryId, 378 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) 379 throws com.liferay.portal.kernel.exception.PortalException { 380 getService().updateRepository(repositoryId, typeSettingsProperties); 381 } 382 383 public static RepositoryLocalService getService() { 384 if (_service == null) { 385 _service = (RepositoryLocalService)PortalBeanLocatorUtil.locate(RepositoryLocalService.class.getName()); 386 387 ReferenceRegistry.registerReference(RepositoryLocalServiceUtil.class, 388 "_service"); 389 } 390 391 return _service; 392 } 393 394 private static RepositoryLocalService _service; 395 }