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