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