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