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.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 023 import com.liferay.portal.kernel.dao.orm.Projection; 024 import com.liferay.portal.kernel.exception.PortalException; 025 import com.liferay.portal.kernel.exception.SystemException; 026 import com.liferay.portal.kernel.search.Indexable; 027 import com.liferay.portal.kernel.search.IndexableType; 028 import com.liferay.portal.kernel.systemevent.SystemEvent; 029 import com.liferay.portal.kernel.transaction.Isolation; 030 import com.liferay.portal.kernel.transaction.Propagation; 031 import com.liferay.portal.kernel.transaction.Transactional; 032 import com.liferay.portal.kernel.util.OrderByComparator; 033 import com.liferay.portal.model.PersistedModel; 034 import com.liferay.portal.model.SystemEventConstants; 035 import com.liferay.portal.model.Website; 036 037 import com.liferay.portlet.exportimport.lar.PortletDataContext; 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 public Website addWebsite(long userId, java.lang.String className, 066 long classPK, java.lang.String url, long typeId, boolean primary, 067 com.liferay.portal.service.ServiceContext serviceContext) 068 throws PortalException; 069 070 /** 071 * Adds the website to the database. Also notifies the appropriate model listeners. 072 * 073 * @param website the website 074 * @return the website that was added 075 */ 076 @Indexable(type = IndexableType.REINDEX) 077 public Website addWebsite(Website website); 078 079 /** 080 * Creates a new website with the primary key. Does not add the website to the database. 081 * 082 * @param websiteId the primary key for the new website 083 * @return the new website 084 */ 085 public Website createWebsite(long websiteId); 086 087 /** 088 * @throws PortalException 089 */ 090 @Override 091 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 092 throws PortalException; 093 094 /** 095 * Deletes the website from the database. Also notifies the appropriate model listeners. 096 * 097 * @param website the website 098 * @return the website that was removed 099 */ 100 @Indexable(type = IndexableType.DELETE) 101 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE) 102 public Website deleteWebsite(Website website); 103 104 /** 105 * Deletes the website with the primary key from the database. Also notifies the appropriate model listeners. 106 * 107 * @param websiteId the primary key of the website 108 * @return the website that was removed 109 * @throws PortalException if a website with the primary key could not be found 110 */ 111 @Indexable(type = IndexableType.DELETE) 112 public Website deleteWebsite(long websiteId) throws PortalException; 113 114 public void deleteWebsites(long companyId, java.lang.String className, 115 long classPK); 116 117 public DynamicQuery dynamicQuery(); 118 119 /** 120 * Performs a dynamic query on the database and returns the matching rows. 121 * 122 * @param dynamicQuery the dynamic query 123 * @return the matching rows 124 */ 125 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 126 127 /** 128 * Performs a dynamic query on the database and returns a range of the matching rows. 129 * 130 * <p> 131 * 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. 132 * </p> 133 * 134 * @param dynamicQuery the dynamic query 135 * @param start the lower bound of the range of model instances 136 * @param end the upper bound of the range of model instances (not inclusive) 137 * @return the range of matching rows 138 */ 139 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 140 int end); 141 142 /** 143 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 144 * 145 * <p> 146 * 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. 147 * </p> 148 * 149 * @param dynamicQuery the dynamic query 150 * @param start the lower bound of the range of model instances 151 * @param end the upper bound of the range of model instances (not inclusive) 152 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 153 * @return the ordered range of matching rows 154 */ 155 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 156 int end, OrderByComparator<T> orderByComparator); 157 158 /** 159 * Returns the number of rows matching the dynamic query. 160 * 161 * @param dynamicQuery the dynamic query 162 * @return the number of rows matching the dynamic query 163 */ 164 public long dynamicQueryCount(DynamicQuery dynamicQuery); 165 166 /** 167 * Returns the number of rows matching the dynamic query. 168 * 169 * @param dynamicQuery the dynamic query 170 * @param projection the projection to apply to the query 171 * @return the number of rows matching the dynamic query 172 */ 173 public long dynamicQueryCount(DynamicQuery dynamicQuery, 174 Projection projection); 175 176 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 177 public Website fetchWebsite(long websiteId); 178 179 /** 180 * Returns the website with the matching UUID and company. 181 * 182 * @param uuid the website's UUID 183 * @param companyId the primary key of the company 184 * @return the matching website, or <code>null</code> if a matching website could not be found 185 */ 186 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 187 public Website fetchWebsiteByUuidAndCompanyId(java.lang.String uuid, 188 long companyId); 189 190 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 191 public ActionableDynamicQuery getActionableDynamicQuery(); 192 193 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 194 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 195 PortletDataContext portletDataContext); 196 197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 198 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 199 200 /** 201 * Returns the OSGi service identifier. 202 * 203 * @return the OSGi service identifier 204 */ 205 public java.lang.String getOSGiServiceIdentifier(); 206 207 @Override 208 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 209 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 210 throws PortalException; 211 212 /** 213 * Returns the website with the primary key. 214 * 215 * @param websiteId the primary key of the website 216 * @return the website 217 * @throws PortalException if a website with the primary key could not be found 218 */ 219 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 220 public Website getWebsite(long websiteId) throws PortalException; 221 222 /** 223 * Returns the website with the matching UUID and company. 224 * 225 * @param uuid the website's UUID 226 * @param companyId the primary key of the company 227 * @return the matching website 228 * @throws PortalException if a matching website could not be found 229 */ 230 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 231 public Website getWebsiteByUuidAndCompanyId(java.lang.String uuid, 232 long companyId) throws PortalException; 233 234 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 235 public List<Website> getWebsites(); 236 237 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 238 public List<Website> getWebsites(long companyId, 239 java.lang.String className, long classPK); 240 241 /** 242 * Returns a range of all the websites. 243 * 244 * <p> 245 * 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. 246 * </p> 247 * 248 * @param start the lower bound of the range of websites 249 * @param end the upper bound of the range of websites (not inclusive) 250 * @return the range of websites 251 */ 252 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 253 public List<Website> getWebsites(int start, int end); 254 255 /** 256 * Returns the number of websites. 257 * 258 * @return the number of websites 259 */ 260 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 261 public int getWebsitesCount(); 262 263 /** 264 * Updates the website in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 265 * 266 * @param website the website 267 * @return the website that was updated 268 */ 269 @Indexable(type = IndexableType.REINDEX) 270 public Website updateWebsite(Website website); 271 272 public Website updateWebsite(long websiteId, java.lang.String url, 273 long typeId, boolean primary) throws PortalException; 274 }