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.LayoutPrototype; 034 import com.liferay.portal.model.PersistedModel; 035 import com.liferay.portal.model.SystemEventConstants; 036 037 import com.liferay.portlet.exportimport.lar.PortletDataContext; 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, com.liferay.portal.service.ServiceContext serviceContext) 085 throws PortalException; 086 087 public LayoutPrototype addLayoutPrototype(long userId, long companyId, 088 Map<Locale, java.lang.String> nameMap, 089 Map<Locale, java.lang.String> descriptionMap, boolean active, 090 com.liferay.portal.service.ServiceContext serviceContext) 091 throws PortalException; 092 093 /** 094 * Creates a new layout prototype with the primary key. Does not add the layout prototype to the database. 095 * 096 * @param layoutPrototypeId the primary key for the new layout prototype 097 * @return the new layout prototype 098 */ 099 public LayoutPrototype createLayoutPrototype(long layoutPrototypeId); 100 101 /** 102 * Deletes the layout prototype from the database. Also notifies the appropriate model listeners. 103 * 104 * @param layoutPrototype the layout prototype 105 * @return the layout prototype that was removed 106 * @throws PortalException 107 */ 108 @Indexable(type = IndexableType.DELETE) 109 @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE) 110 public LayoutPrototype deleteLayoutPrototype( 111 LayoutPrototype layoutPrototype) throws PortalException; 112 113 /** 114 * Deletes the layout prototype with the primary key from the database. Also notifies the appropriate model listeners. 115 * 116 * @param layoutPrototypeId the primary key of the layout prototype 117 * @return the layout prototype that was removed 118 * @throws PortalException if a layout prototype with the primary key could not be found 119 */ 120 @Indexable(type = IndexableType.DELETE) 121 public LayoutPrototype deleteLayoutPrototype(long layoutPrototypeId) 122 throws PortalException; 123 124 public void deleteNondefaultLayoutPrototypes(long companyId) 125 throws PortalException; 126 127 /** 128 * @throws PortalException 129 */ 130 @Override 131 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 132 throws PortalException; 133 134 public DynamicQuery dynamicQuery(); 135 136 /** 137 * Performs a dynamic query on the database and returns the matching rows. 138 * 139 * @param dynamicQuery the dynamic query 140 * @return the matching rows 141 */ 142 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 143 144 /** 145 * Performs a dynamic query on the database and returns a 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.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. 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 * @return the range of matching rows 155 */ 156 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 157 int end); 158 159 /** 160 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 161 * 162 * <p> 163 * 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. 164 * </p> 165 * 166 * @param dynamicQuery the dynamic query 167 * @param start the lower bound of the range of model instances 168 * @param end the upper bound of the range of model instances (not inclusive) 169 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 170 * @return the ordered range of matching rows 171 */ 172 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 173 int end, OrderByComparator<T> orderByComparator); 174 175 /** 176 * Returns the number of rows matching the dynamic query. 177 * 178 * @param dynamicQuery the dynamic query 179 * @return the number of rows matching the dynamic query 180 */ 181 public long dynamicQueryCount(DynamicQuery dynamicQuery); 182 183 /** 184 * Returns the number of rows matching the dynamic query. 185 * 186 * @param dynamicQuery the dynamic query 187 * @param projection the projection to apply to the query 188 * @return the number of rows matching the dynamic query 189 */ 190 public long dynamicQueryCount(DynamicQuery dynamicQuery, 191 Projection projection); 192 193 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 194 public LayoutPrototype fetchLayoutPrototype(long layoutPrototypeId); 195 196 /** 197 * Returns the layout prototype with the matching UUID and company. 198 * 199 * @param uuid the layout prototype's UUID 200 * @param companyId the primary key of the company 201 * @return the matching layout prototype, or <code>null</code> if a matching layout prototype could not be found 202 */ 203 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 204 public LayoutPrototype fetchLayoutPrototypeByUuidAndCompanyId( 205 java.lang.String uuid, long companyId); 206 207 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 208 public ActionableDynamicQuery getActionableDynamicQuery(); 209 210 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 211 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 212 PortletDataContext portletDataContext); 213 214 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 215 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 216 217 /** 218 * Returns the layout prototype with the primary key. 219 * 220 * @param layoutPrototypeId the primary key of the layout prototype 221 * @return the layout prototype 222 * @throws PortalException if a layout prototype with the primary key could not be found 223 */ 224 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 225 public LayoutPrototype getLayoutPrototype(long layoutPrototypeId) 226 throws PortalException; 227 228 /** 229 * Returns the layout prototype with the matching UUID and company. 230 * 231 * @param uuid the layout prototype's UUID 232 * @param companyId the primary key of the company 233 * @return the matching layout prototype 234 * @throws PortalException if a matching layout prototype could not be found 235 */ 236 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 237 public LayoutPrototype getLayoutPrototypeByUuidAndCompanyId( 238 java.lang.String uuid, long companyId) throws PortalException; 239 240 /** 241 * Returns a range of all the layout prototypes. 242 * 243 * <p> 244 * 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. 245 * </p> 246 * 247 * @param start the lower bound of the range of layout prototypes 248 * @param end the upper bound of the range of layout prototypes (not inclusive) 249 * @return the range of layout prototypes 250 */ 251 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 252 public List<LayoutPrototype> getLayoutPrototypes(int start, int end); 253 254 /** 255 * Returns the number of layout prototypes. 256 * 257 * @return the number of layout prototypes 258 */ 259 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 260 public int getLayoutPrototypesCount(); 261 262 /** 263 * Returns the OSGi service identifier. 264 * 265 * @return the OSGi service identifier 266 */ 267 public java.lang.String getOSGiServiceIdentifier(); 268 269 @Override 270 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 271 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 272 throws PortalException; 273 274 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 275 public List<LayoutPrototype> search(long companyId, 276 java.lang.Boolean active, int start, int end, 277 OrderByComparator<LayoutPrototype> obc); 278 279 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 280 public int searchCount(long companyId, java.lang.Boolean active); 281 282 /** 283 * Updates the layout prototype in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 284 * 285 * @param layoutPrototype the layout prototype 286 * @return the layout prototype that was updated 287 */ 288 @Indexable(type = IndexableType.REINDEX) 289 public LayoutPrototype updateLayoutPrototype( 290 LayoutPrototype layoutPrototype); 291 292 /** 293 * @deprecated As of 7.0.0, replaced by {@link #updateLayoutPrototype(long, 294 Map, Map, boolean, ServiceContext)} 295 */ 296 @java.lang.Deprecated 297 public LayoutPrototype updateLayoutPrototype(long layoutPrototypeId, 298 Map<Locale, java.lang.String> nameMap, java.lang.String description, 299 boolean active, com.liferay.portal.service.ServiceContext serviceContext) 300 throws PortalException; 301 302 public LayoutPrototype updateLayoutPrototype(long layoutPrototypeId, 303 Map<Locale, java.lang.String> nameMap, 304 Map<Locale, java.lang.String> descriptionMap, boolean active, 305 com.liferay.portal.service.ServiceContext serviceContext) 306 throws PortalException; 307 }