001 /** 002 * Copyright (c) 2000-2013 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.service; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * Provides the local service utility for LayoutPrototype. This utility wraps 022 * {@link com.liferay.portal.service.impl.LayoutPrototypeLocalServiceImpl} and is the 023 * primary access point for service operations in application layer code running 024 * on the local server. Methods of this service will not have security checks 025 * based on the propagated JAAS credentials because this service can only be 026 * accessed from within the same VM. 027 * 028 * @author Brian Wing Shun Chan 029 * @see LayoutPrototypeLocalService 030 * @see com.liferay.portal.service.base.LayoutPrototypeLocalServiceBaseImpl 031 * @see com.liferay.portal.service.impl.LayoutPrototypeLocalServiceImpl 032 * @generated 033 */ 034 public class LayoutPrototypeLocalServiceUtil { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutPrototypeLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 039 */ 040 041 /** 042 * Adds the layout prototype to the database. Also notifies the appropriate model listeners. 043 * 044 * @param layoutPrototype the layout prototype 045 * @return the layout prototype that was added 046 * @throws SystemException if a system exception occurred 047 */ 048 public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype( 049 com.liferay.portal.model.LayoutPrototype layoutPrototype) 050 throws com.liferay.portal.kernel.exception.SystemException { 051 return getService().addLayoutPrototype(layoutPrototype); 052 } 053 054 /** 055 * Creates a new layout prototype with the primary key. Does not add the layout prototype to the database. 056 * 057 * @param layoutPrototypeId the primary key for the new layout prototype 058 * @return the new layout prototype 059 */ 060 public static com.liferay.portal.model.LayoutPrototype createLayoutPrototype( 061 long layoutPrototypeId) { 062 return getService().createLayoutPrototype(layoutPrototypeId); 063 } 064 065 /** 066 * Deletes the layout prototype with the primary key from the database. Also notifies the appropriate model listeners. 067 * 068 * @param layoutPrototypeId the primary key of the layout prototype 069 * @return the layout prototype that was removed 070 * @throws PortalException if a layout prototype with the primary key could not be found 071 * @throws SystemException if a system exception occurred 072 */ 073 public static com.liferay.portal.model.LayoutPrototype deleteLayoutPrototype( 074 long layoutPrototypeId) 075 throws com.liferay.portal.kernel.exception.PortalException, 076 com.liferay.portal.kernel.exception.SystemException { 077 return getService().deleteLayoutPrototype(layoutPrototypeId); 078 } 079 080 /** 081 * Deletes the layout prototype from the database. Also notifies the appropriate model listeners. 082 * 083 * @param layoutPrototype the layout prototype 084 * @return the layout prototype that was removed 085 * @throws PortalException 086 * @throws SystemException if a system exception occurred 087 */ 088 public static com.liferay.portal.model.LayoutPrototype deleteLayoutPrototype( 089 com.liferay.portal.model.LayoutPrototype layoutPrototype) 090 throws com.liferay.portal.kernel.exception.PortalException, 091 com.liferay.portal.kernel.exception.SystemException { 092 return getService().deleteLayoutPrototype(layoutPrototype); 093 } 094 095 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 096 return getService().dynamicQuery(); 097 } 098 099 /** 100 * Performs a dynamic query on the database and returns the matching rows. 101 * 102 * @param dynamicQuery the dynamic query 103 * @return the matching rows 104 * @throws SystemException if a system exception occurred 105 */ 106 @SuppressWarnings("rawtypes") 107 public static java.util.List dynamicQuery( 108 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 109 throws com.liferay.portal.kernel.exception.SystemException { 110 return getService().dynamicQuery(dynamicQuery); 111 } 112 113 /** 114 * Performs a dynamic query on the database and returns a range of the matching rows. 115 * 116 * <p> 117 * 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.LayoutPrototypeModelImpl}. 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. 118 * </p> 119 * 120 * @param dynamicQuery the dynamic query 121 * @param start the lower bound of the range of model instances 122 * @param end the upper bound of the range of model instances (not inclusive) 123 * @return the range of matching rows 124 * @throws SystemException if a system exception occurred 125 */ 126 @SuppressWarnings("rawtypes") 127 public static java.util.List dynamicQuery( 128 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 129 int end) throws com.liferay.portal.kernel.exception.SystemException { 130 return getService().dynamicQuery(dynamicQuery, start, end); 131 } 132 133 /** 134 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 135 * 136 * <p> 137 * 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.LayoutPrototypeModelImpl}. 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. 138 * </p> 139 * 140 * @param dynamicQuery the dynamic query 141 * @param start the lower bound of the range of model instances 142 * @param end the upper bound of the range of model instances (not inclusive) 143 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 144 * @return the ordered range of matching rows 145 * @throws SystemException if a system exception occurred 146 */ 147 @SuppressWarnings("rawtypes") 148 public static java.util.List dynamicQuery( 149 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 150 int end, 151 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 152 throws com.liferay.portal.kernel.exception.SystemException { 153 return getService() 154 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 155 } 156 157 /** 158 * Returns the number of rows that match the dynamic query. 159 * 160 * @param dynamicQuery the dynamic query 161 * @return the number of rows that match the dynamic query 162 * @throws SystemException if a system exception occurred 163 */ 164 public static long dynamicQueryCount( 165 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 166 throws com.liferay.portal.kernel.exception.SystemException { 167 return getService().dynamicQueryCount(dynamicQuery); 168 } 169 170 /** 171 * Returns the number of rows that match 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 that match the dynamic query 176 * @throws SystemException if a system exception occurred 177 */ 178 public static long dynamicQueryCount( 179 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 180 com.liferay.portal.kernel.dao.orm.Projection projection) 181 throws com.liferay.portal.kernel.exception.SystemException { 182 return getService().dynamicQueryCount(dynamicQuery, projection); 183 } 184 185 public static com.liferay.portal.model.LayoutPrototype fetchLayoutPrototype( 186 long layoutPrototypeId) 187 throws com.liferay.portal.kernel.exception.SystemException { 188 return getService().fetchLayoutPrototype(layoutPrototypeId); 189 } 190 191 /** 192 * Returns the layout prototype with the matching UUID and company. 193 * 194 * @param uuid the layout prototype's UUID 195 * @param companyId the primary key of the company 196 * @return the matching layout prototype, or <code>null</code> if a matching layout prototype could not be found 197 * @throws SystemException if a system exception occurred 198 */ 199 public static com.liferay.portal.model.LayoutPrototype fetchLayoutPrototypeByUuidAndCompanyId( 200 java.lang.String uuid, long companyId) 201 throws com.liferay.portal.kernel.exception.SystemException { 202 return getService() 203 .fetchLayoutPrototypeByUuidAndCompanyId(uuid, companyId); 204 } 205 206 /** 207 * Returns the layout prototype with the primary key. 208 * 209 * @param layoutPrototypeId the primary key of the layout prototype 210 * @return the layout prototype 211 * @throws PortalException if a layout prototype with the primary key could not be found 212 * @throws SystemException if a system exception occurred 213 */ 214 public static com.liferay.portal.model.LayoutPrototype getLayoutPrototype( 215 long layoutPrototypeId) 216 throws com.liferay.portal.kernel.exception.PortalException, 217 com.liferay.portal.kernel.exception.SystemException { 218 return getService().getLayoutPrototype(layoutPrototypeId); 219 } 220 221 public static com.liferay.portal.model.PersistedModel getPersistedModel( 222 java.io.Serializable primaryKeyObj) 223 throws com.liferay.portal.kernel.exception.PortalException, 224 com.liferay.portal.kernel.exception.SystemException { 225 return getService().getPersistedModel(primaryKeyObj); 226 } 227 228 /** 229 * Returns the layout prototype with the matching UUID and company. 230 * 231 * @param uuid the layout prototype's UUID 232 * @param companyId the primary key of the company 233 * @return the matching layout prototype 234 * @throws PortalException if a matching layout prototype could not be found 235 * @throws SystemException if a system exception occurred 236 */ 237 public static com.liferay.portal.model.LayoutPrototype getLayoutPrototypeByUuidAndCompanyId( 238 java.lang.String uuid, long companyId) 239 throws com.liferay.portal.kernel.exception.PortalException, 240 com.liferay.portal.kernel.exception.SystemException { 241 return getService().getLayoutPrototypeByUuidAndCompanyId(uuid, companyId); 242 } 243 244 /** 245 * Returns a range of all the layout prototypes. 246 * 247 * <p> 248 * 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.LayoutPrototypeModelImpl}. 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. 249 * </p> 250 * 251 * @param start the lower bound of the range of layout prototypes 252 * @param end the upper bound of the range of layout prototypes (not inclusive) 253 * @return the range of layout prototypes 254 * @throws SystemException if a system exception occurred 255 */ 256 public static java.util.List<com.liferay.portal.model.LayoutPrototype> getLayoutPrototypes( 257 int start, int end) 258 throws com.liferay.portal.kernel.exception.SystemException { 259 return getService().getLayoutPrototypes(start, end); 260 } 261 262 /** 263 * Returns the number of layout prototypes. 264 * 265 * @return the number of layout prototypes 266 * @throws SystemException if a system exception occurred 267 */ 268 public static int getLayoutPrototypesCount() 269 throws com.liferay.portal.kernel.exception.SystemException { 270 return getService().getLayoutPrototypesCount(); 271 } 272 273 /** 274 * Updates the layout prototype in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 275 * 276 * @param layoutPrototype the layout prototype 277 * @return the layout prototype that was updated 278 * @throws SystemException if a system exception occurred 279 */ 280 public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype( 281 com.liferay.portal.model.LayoutPrototype layoutPrototype) 282 throws com.liferay.portal.kernel.exception.SystemException { 283 return getService().updateLayoutPrototype(layoutPrototype); 284 } 285 286 /** 287 * Returns the Spring bean ID for this bean. 288 * 289 * @return the Spring bean ID for this bean 290 */ 291 public static java.lang.String getBeanIdentifier() { 292 return getService().getBeanIdentifier(); 293 } 294 295 /** 296 * Sets the Spring bean ID for this bean. 297 * 298 * @param beanIdentifier the Spring bean ID for this bean 299 */ 300 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 301 getService().setBeanIdentifier(beanIdentifier); 302 } 303 304 /** 305 * @deprecated As of 6.2.0, replaced by {@link #addLayoutPrototype(long, 306 long, Map, String, boolean, ServiceContext)} 307 */ 308 public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype( 309 long userId, long companyId, 310 java.util.Map<java.util.Locale, java.lang.String> nameMap, 311 java.lang.String description, boolean active) 312 throws com.liferay.portal.kernel.exception.PortalException, 313 com.liferay.portal.kernel.exception.SystemException { 314 return getService() 315 .addLayoutPrototype(userId, companyId, nameMap, description, 316 active); 317 } 318 319 public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype( 320 long userId, long companyId, 321 java.util.Map<java.util.Locale, java.lang.String> nameMap, 322 java.lang.String description, boolean active, 323 com.liferay.portal.service.ServiceContext serviceContext) 324 throws com.liferay.portal.kernel.exception.PortalException, 325 com.liferay.portal.kernel.exception.SystemException { 326 return getService() 327 .addLayoutPrototype(userId, companyId, nameMap, description, 328 active, serviceContext); 329 } 330 331 public static void deleteNondefaultLayoutPrototypes(long companyId) 332 throws com.liferay.portal.kernel.exception.PortalException, 333 com.liferay.portal.kernel.exception.SystemException { 334 getService().deleteNondefaultLayoutPrototypes(companyId); 335 } 336 337 /** 338 * @deprecated As of 6.2.0, replaced by {@link 339 #getLayoutPrototypeByUuidAndCompanyId(String, long)} 340 */ 341 public static com.liferay.portal.model.LayoutPrototype getLayoutPrototypeByUuid( 342 java.lang.String uuid) 343 throws com.liferay.portal.kernel.exception.PortalException, 344 com.liferay.portal.kernel.exception.SystemException { 345 return getService().getLayoutPrototypeByUuid(uuid); 346 } 347 348 public static java.util.List<com.liferay.portal.model.LayoutPrototype> search( 349 long companyId, java.lang.Boolean active, int start, int end, 350 com.liferay.portal.kernel.util.OrderByComparator obc) 351 throws com.liferay.portal.kernel.exception.SystemException { 352 return getService().search(companyId, active, start, end, obc); 353 } 354 355 public static int searchCount(long companyId, java.lang.Boolean active) 356 throws com.liferay.portal.kernel.exception.SystemException { 357 return getService().searchCount(companyId, active); 358 } 359 360 /** 361 * @deprecated As of 6.2.0, replaced by {@link #updateLayoutPrototype(long, 362 Map, String, boolean, ServiceContext)} 363 */ 364 public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype( 365 long layoutPrototypeId, 366 java.util.Map<java.util.Locale, java.lang.String> nameMap, 367 java.lang.String description, boolean active) 368 throws com.liferay.portal.kernel.exception.PortalException, 369 com.liferay.portal.kernel.exception.SystemException { 370 return getService() 371 .updateLayoutPrototype(layoutPrototypeId, nameMap, 372 description, active); 373 } 374 375 public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype( 376 long layoutPrototypeId, 377 java.util.Map<java.util.Locale, java.lang.String> nameMap, 378 java.lang.String description, boolean active, 379 com.liferay.portal.service.ServiceContext serviceContext) 380 throws com.liferay.portal.kernel.exception.PortalException, 381 com.liferay.portal.kernel.exception.SystemException { 382 return getService() 383 .updateLayoutPrototype(layoutPrototypeId, nameMap, 384 description, active, serviceContext); 385 } 386 387 public static LayoutPrototypeLocalService getService() { 388 if (_service == null) { 389 _service = (LayoutPrototypeLocalService)PortalBeanLocatorUtil.locate(LayoutPrototypeLocalService.class.getName()); 390 391 ReferenceRegistry.registerReference(LayoutPrototypeLocalServiceUtil.class, 392 "_service"); 393 } 394 395 return _service; 396 } 397 398 /** 399 * @deprecated As of 6.2.0 400 */ 401 public void setService(LayoutPrototypeLocalService service) { 402 } 403 404 private static LayoutPrototypeLocalService _service; 405 }