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.SystemEventConstants; 030 import com.liferay.portal.kernel.model.Website; 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 039 import java.io.Serializable; 040 041 import java.util.List; 042 043 /** 044 * Provides the local service interface for Website. Methods of this 045 * service will not have security checks based on the propagated JAAS 046 * credentials because this service can only be accessed from within the same 047 * VM. 048 * 049 * @author Brian Wing Shun Chan 050 * @see WebsiteLocalServiceUtil 051 * @see com.liferay.portal.service.base.WebsiteLocalServiceBaseImpl 052 * @see com.liferay.portal.service.impl.WebsiteLocalServiceImpl 053 * @generated 054 */ 055 @ProviderType 056 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 057 PortalException.class, SystemException.class}) 058 public interface WebsiteLocalService extends BaseLocalService, 059 PersistedModelLocalService { 060 /* 061 * NOTE FOR DEVELOPERS: 062 * 063 * Never modify or reference this interface directly. Always use {@link WebsiteLocalServiceUtil} to access the website local service. Add custom service methods to {@link com.liferay.portal.service.impl.WebsiteLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 064 */ 065 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 066 public ActionableDynamicQuery getActionableDynamicQuery(); 067 068 public DynamicQuery dynamicQuery(); 069 070 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 071 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 072 PortletDataContext portletDataContext); 073 074 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 075 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 076 077 /** 078 * @throws PortalException 079 */ 080 @Override 081 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 082 throws PortalException; 083 084 @Override 085 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 086 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 087 throws PortalException; 088 089 /** 090 * Adds the website to the database. Also notifies the appropriate model listeners. 091 * 092 * @param website the website 093 * @return the website that was added 094 */ 095 @Indexable(type = IndexableType.REINDEX) 096 public Website addWebsite(Website website); 097 098 public Website addWebsite(long userId, java.lang.String className, 099 long classPK, java.lang.String url, long typeId, boolean primary, 100 ServiceContext serviceContext) throws PortalException; 101 102 /** 103 * Creates a new website with the primary key. Does not add the website to the database. 104 * 105 * @param websiteId the primary key for the new website 106 * @return the new website 107 */ 108 public Website createWebsite(long websiteId); 109 110 /** 111 * Deletes the website from the database. Also notifies the appropriate model listeners. 112 * 113 * @param website the website 114 * @return the website that was removed 115 */ 116 @Indexable(type = IndexableType.DELETE) 117 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE) 118 public Website deleteWebsite(Website website); 119 120 /** 121 * Deletes the website with the primary key from the database. Also notifies the appropriate model listeners. 122 * 123 * @param websiteId the primary key of the website 124 * @return the website that was removed 125 * @throws PortalException if a website with the primary key could not be found 126 */ 127 @Indexable(type = IndexableType.DELETE) 128 public Website deleteWebsite(long websiteId) throws PortalException; 129 130 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 131 public Website fetchWebsite(long websiteId); 132 133 /** 134 * Returns the website with the matching UUID and company. 135 * 136 * @param uuid the website's UUID 137 * @param companyId the primary key of the company 138 * @return the matching website, or <code>null</code> if a matching website could not be found 139 */ 140 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 141 public Website fetchWebsiteByUuidAndCompanyId(java.lang.String uuid, 142 long companyId); 143 144 /** 145 * Returns the website with the primary key. 146 * 147 * @param websiteId the primary key of the website 148 * @return the website 149 * @throws PortalException if a website with the primary key could not be found 150 */ 151 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 152 public Website getWebsite(long websiteId) throws PortalException; 153 154 /** 155 * Returns the website with the matching UUID and company. 156 * 157 * @param uuid the website's UUID 158 * @param companyId the primary key of the company 159 * @return the matching website 160 * @throws PortalException if a matching website could not be found 161 */ 162 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 163 public Website getWebsiteByUuidAndCompanyId(java.lang.String uuid, 164 long companyId) throws PortalException; 165 166 /** 167 * Updates the website in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 168 * 169 * @param website the website 170 * @return the website that was updated 171 */ 172 @Indexable(type = IndexableType.REINDEX) 173 public Website updateWebsite(Website website); 174 175 public Website updateWebsite(long websiteId, java.lang.String url, 176 long typeId, boolean primary) throws PortalException; 177 178 /** 179 * Returns the number of websites. 180 * 181 * @return the number of websites 182 */ 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public int getWebsitesCount(); 185 186 /** 187 * Returns the OSGi service identifier. 188 * 189 * @return the OSGi service identifier 190 */ 191 public java.lang.String getOSGiServiceIdentifier(); 192 193 /** 194 * Performs a dynamic query on the database and returns the matching rows. 195 * 196 * @param dynamicQuery the dynamic query 197 * @return the matching rows 198 */ 199 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 200 201 /** 202 * Performs a dynamic query on the database and returns a range of the matching rows. 203 * 204 * <p> 205 * 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. 206 * </p> 207 * 208 * @param dynamicQuery the dynamic query 209 * @param start the lower bound of the range of model instances 210 * @param end the upper bound of the range of model instances (not inclusive) 211 * @return the range of matching rows 212 */ 213 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 214 int end); 215 216 /** 217 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 218 * 219 * <p> 220 * 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. 221 * </p> 222 * 223 * @param dynamicQuery the dynamic query 224 * @param start the lower bound of the range of model instances 225 * @param end the upper bound of the range of model instances (not inclusive) 226 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 227 * @return the ordered range of matching rows 228 */ 229 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 230 int end, OrderByComparator<T> orderByComparator); 231 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public List<Website> getWebsites(); 234 235 /** 236 * Returns a range of all the websites. 237 * 238 * <p> 239 * 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. 240 * </p> 241 * 242 * @param start the lower bound of the range of websites 243 * @param end the upper bound of the range of websites (not inclusive) 244 * @return the range of websites 245 */ 246 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 247 public List<Website> getWebsites(int start, int end); 248 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public List<Website> getWebsites(long companyId, 251 java.lang.String className, long classPK); 252 253 /** 254 * Returns the number of rows matching the dynamic query. 255 * 256 * @param dynamicQuery the dynamic query 257 * @return the number of rows matching the dynamic query 258 */ 259 public long dynamicQueryCount(DynamicQuery dynamicQuery); 260 261 /** 262 * Returns the number of rows matching the dynamic query. 263 * 264 * @param dynamicQuery the dynamic query 265 * @param projection the projection to apply to the query 266 * @return the number of rows matching the dynamic query 267 */ 268 public long dynamicQueryCount(DynamicQuery dynamicQuery, 269 Projection projection); 270 271 public void deleteWebsites(long companyId, java.lang.String className, 272 long classPK); 273 }