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