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.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.search.Indexable; 026 import com.liferay.portal.kernel.search.IndexableType; 027 import com.liferay.portal.kernel.transaction.Isolation; 028 import com.liferay.portal.kernel.transaction.Propagation; 029 import com.liferay.portal.kernel.transaction.Transactional; 030 import com.liferay.portal.kernel.util.OrderByComparator; 031 import com.liferay.portal.model.LayoutSet; 032 import com.liferay.portal.model.PersistedModel; 033 034 import java.io.File; 035 import java.io.InputStream; 036 import java.io.Serializable; 037 038 import java.util.List; 039 040 /** 041 * Provides the local service interface for LayoutSet. Methods of this 042 * service will not have security checks based on the propagated JAAS 043 * credentials because this service can only be accessed from within the same 044 * VM. 045 * 046 * @author Brian Wing Shun Chan 047 * @see LayoutSetLocalServiceUtil 048 * @see com.liferay.portal.service.base.LayoutSetLocalServiceBaseImpl 049 * @see com.liferay.portal.service.impl.LayoutSetLocalServiceImpl 050 * @generated 051 */ 052 @ProviderType 053 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 054 PortalException.class, SystemException.class}) 055 public interface LayoutSetLocalService extends BaseLocalService, 056 PersistedModelLocalService { 057 /* 058 * NOTE FOR DEVELOPERS: 059 * 060 * Never modify or reference this interface directly. Always use {@link LayoutSetLocalServiceUtil} to access the layout set local service. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutSetLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 061 */ 062 public LayoutSet addLayoutSet(long groupId, boolean privateLayout) 063 throws PortalException; 064 065 /** 066 * Adds the layout set to the database. Also notifies the appropriate model listeners. 067 * 068 * @param layoutSet the layout set 069 * @return the layout set that was added 070 */ 071 @Indexable(type = IndexableType.REINDEX) 072 public LayoutSet addLayoutSet(LayoutSet layoutSet); 073 074 /** 075 * Creates a new layout set with the primary key. Does not add the layout set to the database. 076 * 077 * @param layoutSetId the primary key for the new layout set 078 * @return the new layout set 079 */ 080 public LayoutSet createLayoutSet(long layoutSetId); 081 082 public void deleteLayoutSet(long groupId, boolean privateLayout, 083 com.liferay.portal.service.ServiceContext serviceContext) 084 throws PortalException; 085 086 /** 087 * Deletes the layout set from the database. Also notifies the appropriate model listeners. 088 * 089 * @param layoutSet the layout set 090 * @return the layout set that was removed 091 */ 092 @Indexable(type = IndexableType.DELETE) 093 public LayoutSet deleteLayoutSet(LayoutSet layoutSet); 094 095 /** 096 * Deletes the layout set with the primary key from the database. Also notifies the appropriate model listeners. 097 * 098 * @param layoutSetId the primary key of the layout set 099 * @return the layout set that was removed 100 * @throws PortalException if a layout set with the primary key could not be found 101 */ 102 @Indexable(type = IndexableType.DELETE) 103 public LayoutSet deleteLayoutSet(long layoutSetId) 104 throws PortalException; 105 106 /** 107 * @throws PortalException 108 */ 109 @Override 110 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 111 throws PortalException; 112 113 public DynamicQuery dynamicQuery(); 114 115 /** 116 * Performs a dynamic query on the database and returns the matching rows. 117 * 118 * @param dynamicQuery the dynamic query 119 * @return the matching rows 120 */ 121 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 122 123 /** 124 * Performs a dynamic query on the database and returns a range of the matching rows. 125 * 126 * <p> 127 * 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.LayoutSetModelImpl}. 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. 128 * </p> 129 * 130 * @param dynamicQuery the dynamic query 131 * @param start the lower bound of the range of model instances 132 * @param end the upper bound of the range of model instances (not inclusive) 133 * @return the range of matching rows 134 */ 135 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 136 int end); 137 138 /** 139 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 140 * 141 * <p> 142 * 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.LayoutSetModelImpl}. 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. 143 * </p> 144 * 145 * @param dynamicQuery the dynamic query 146 * @param start the lower bound of the range of model instances 147 * @param end the upper bound of the range of model instances (not inclusive) 148 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 149 * @return the ordered range of matching rows 150 */ 151 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 152 int end, OrderByComparator<T> orderByComparator); 153 154 /** 155 * Returns the number of rows matching the dynamic query. 156 * 157 * @param dynamicQuery the dynamic query 158 * @return the number of rows matching the dynamic query 159 */ 160 public long dynamicQueryCount(DynamicQuery dynamicQuery); 161 162 /** 163 * Returns the number of rows matching the dynamic query. 164 * 165 * @param dynamicQuery the dynamic query 166 * @param projection the projection to apply to the query 167 * @return the number of rows matching the dynamic query 168 */ 169 public long dynamicQueryCount(DynamicQuery dynamicQuery, 170 Projection projection); 171 172 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 173 public LayoutSet fetchLayoutSet(long layoutSetId); 174 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public LayoutSet fetchLayoutSet(java.lang.String virtualHostname); 177 178 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 179 public ActionableDynamicQuery getActionableDynamicQuery(); 180 181 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 182 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 183 184 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 185 public LayoutSet getLayoutSet(long groupId, boolean privateLayout) 186 throws PortalException; 187 188 /** 189 * Returns the layout set with the primary key. 190 * 191 * @param layoutSetId the primary key of the layout set 192 * @return the layout set 193 * @throws PortalException if a layout set with the primary key could not be found 194 */ 195 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 196 public LayoutSet getLayoutSet(long layoutSetId) throws PortalException; 197 198 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 199 public LayoutSet getLayoutSet(java.lang.String virtualHostname) 200 throws PortalException; 201 202 /** 203 * Returns a range of all the layout sets. 204 * 205 * <p> 206 * 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.LayoutSetModelImpl}. 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. 207 * </p> 208 * 209 * @param start the lower bound of the range of layout sets 210 * @param end the upper bound of the range of layout sets (not inclusive) 211 * @return the range of layout sets 212 */ 213 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 214 public List<LayoutSet> getLayoutSets(int start, int end); 215 216 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 217 public List<LayoutSet> getLayoutSetsByLayoutSetPrototypeUuid( 218 java.lang.String layoutSetPrototypeUuid); 219 220 /** 221 * Returns the number of layout sets. 222 * 223 * @return the number of layout sets 224 */ 225 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 226 public int getLayoutSetsCount(); 227 228 /** 229 * Returns the OSGi service identifier. 230 * 231 * @return the OSGi service identifier 232 */ 233 public java.lang.String getOSGiServiceIdentifier(); 234 235 @Override 236 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 237 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 238 throws PortalException; 239 240 /** 241 * Updates the layout set in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 242 * 243 * @param layoutSet the layout set 244 * @return the layout set that was updated 245 */ 246 @Indexable(type = IndexableType.REINDEX) 247 public LayoutSet updateLayoutSet(LayoutSet layoutSet); 248 249 /** 250 * Updates the state of the layout set prototype link. 251 * 252 * @param groupId the primary key of the group 253 * @param privateLayout whether the layout set is private to the group 254 * @param layoutSetPrototypeLinkEnabled whether the layout set prototype is 255 link enabled 256 * @param layoutSetPrototypeUuid the uuid of the layout set prototype to 257 link with 258 */ 259 public void updateLayoutSetPrototypeLinkEnabled(long groupId, 260 boolean privateLayout, boolean layoutSetPrototypeLinkEnabled, 261 java.lang.String layoutSetPrototypeUuid) throws PortalException; 262 263 public LayoutSet updateLogo(long groupId, boolean privateLayout, 264 boolean logo, byte[] bytes) throws PortalException; 265 266 public LayoutSet updateLogo(long groupId, boolean privateLayout, 267 boolean logo, File file) throws PortalException; 268 269 public LayoutSet updateLogo(long groupId, boolean privateLayout, 270 boolean logo, InputStream is) throws PortalException; 271 272 public LayoutSet updateLogo(long groupId, boolean privateLayout, 273 boolean logo, InputStream is, boolean cleanUpStream) 274 throws PortalException; 275 276 public LayoutSet updateLookAndFeel(long groupId, boolean privateLayout, 277 java.lang.String themeId, java.lang.String colorSchemeId, 278 java.lang.String css, boolean wapTheme) throws PortalException; 279 280 public void updateLookAndFeel(long groupId, java.lang.String themeId, 281 java.lang.String colorSchemeId, java.lang.String css, boolean wapTheme) 282 throws PortalException; 283 284 public LayoutSet updatePageCount(long groupId, boolean privateLayout) 285 throws PortalException; 286 287 public LayoutSet updateSettings(long groupId, boolean privateLayout, 288 java.lang.String settings) throws PortalException; 289 290 public LayoutSet updateVirtualHost(long groupId, boolean privateLayout, 291 java.lang.String virtualHostname) throws PortalException; 292 }