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.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.model.LayoutSet; 026 import com.liferay.portal.kernel.model.PersistedModel; 027 import com.liferay.portal.kernel.search.Indexable; 028 import com.liferay.portal.kernel.search.IndexableType; 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 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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 063 public ActionableDynamicQuery getActionableDynamicQuery(); 064 065 public DynamicQuery dynamicQuery(); 066 067 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 068 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 069 070 /** 071 * Adds the layout set to the database. Also notifies the appropriate model listeners. 072 * 073 * @param layoutSet the layout set 074 * @return the layout set that was added 075 */ 076 @Indexable(type = IndexableType.REINDEX) 077 public LayoutSet addLayoutSet(LayoutSet layoutSet); 078 079 public LayoutSet addLayoutSet(long groupId, boolean privateLayout) 080 throws PortalException; 081 082 /** 083 * Creates a new layout set with the primary key. Does not add the layout set to the database. 084 * 085 * @param layoutSetId the primary key for the new layout set 086 * @return the new layout set 087 */ 088 public LayoutSet createLayoutSet(long layoutSetId); 089 090 /** 091 * Deletes the layout set from the database. Also notifies the appropriate model listeners. 092 * 093 * @param layoutSet the layout set 094 * @return the layout set that was removed 095 */ 096 @Indexable(type = IndexableType.DELETE) 097 public LayoutSet deleteLayoutSet(LayoutSet layoutSet); 098 099 /** 100 * Deletes the layout set with the primary key from the database. Also notifies the appropriate model listeners. 101 * 102 * @param layoutSetId the primary key of the layout set 103 * @return the layout set that was removed 104 * @throws PortalException if a layout set with the primary key could not be found 105 */ 106 @Indexable(type = IndexableType.DELETE) 107 public LayoutSet deleteLayoutSet(long layoutSetId) 108 throws PortalException; 109 110 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 111 public LayoutSet fetchLayoutSet(java.lang.String virtualHostname); 112 113 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 114 public LayoutSet fetchLayoutSet(long layoutSetId); 115 116 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 117 public LayoutSet getLayoutSet(java.lang.String virtualHostname) 118 throws PortalException; 119 120 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 121 public LayoutSet getLayoutSet(long groupId, boolean privateLayout) 122 throws PortalException; 123 124 /** 125 * Returns the layout set with the primary key. 126 * 127 * @param layoutSetId the primary key of the layout set 128 * @return the layout set 129 * @throws PortalException if a layout set with the primary key could not be found 130 */ 131 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 132 public LayoutSet getLayoutSet(long layoutSetId) throws PortalException; 133 134 /** 135 * Updates the layout set in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 136 * 137 * @param layoutSet the layout set 138 * @return the layout set that was updated 139 */ 140 @Indexable(type = IndexableType.REINDEX) 141 public LayoutSet updateLayoutSet(LayoutSet layoutSet); 142 143 public LayoutSet updateLogo(long groupId, boolean privateLayout, 144 boolean logo, byte[] bytes) throws PortalException; 145 146 public LayoutSet updateLogo(long groupId, boolean privateLayout, 147 boolean logo, File file) throws PortalException; 148 149 public LayoutSet updateLogo(long groupId, boolean privateLayout, 150 boolean logo, InputStream is) throws PortalException; 151 152 public LayoutSet updateLogo(long groupId, boolean privateLayout, 153 boolean logo, InputStream is, boolean cleanUpStream) 154 throws PortalException; 155 156 public LayoutSet updateLookAndFeel(long groupId, boolean privateLayout, 157 java.lang.String themeId, java.lang.String colorSchemeId, 158 java.lang.String css) throws PortalException; 159 160 public LayoutSet updatePageCount(long groupId, boolean privateLayout) 161 throws PortalException; 162 163 public LayoutSet updateSettings(long groupId, boolean privateLayout, 164 java.lang.String settings) throws PortalException; 165 166 public LayoutSet updateVirtualHost(long groupId, boolean privateLayout, 167 java.lang.String virtualHostname) throws PortalException; 168 169 /** 170 * @throws PortalException 171 */ 172 @Override 173 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 174 throws PortalException; 175 176 @Override 177 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 178 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 179 throws PortalException; 180 181 /** 182 * Returns the number of layout sets. 183 * 184 * @return the number of layout sets 185 */ 186 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 187 public int getLayoutSetsCount(); 188 189 /** 190 * Returns the OSGi service identifier. 191 * 192 * @return the OSGi service identifier 193 */ 194 public java.lang.String getOSGiServiceIdentifier(); 195 196 /** 197 * Performs a dynamic query on the database and returns the matching rows. 198 * 199 * @param dynamicQuery the dynamic query 200 * @return the matching rows 201 */ 202 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 203 204 /** 205 * Performs a dynamic query on the database and returns a range of the matching rows. 206 * 207 * <p> 208 * 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. 209 * </p> 210 * 211 * @param dynamicQuery the dynamic query 212 * @param start the lower bound of the range of model instances 213 * @param end the upper bound of the range of model instances (not inclusive) 214 * @return the range of matching rows 215 */ 216 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 217 int end); 218 219 /** 220 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 221 * 222 * <p> 223 * 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. 224 * </p> 225 * 226 * @param dynamicQuery the dynamic query 227 * @param start the lower bound of the range of model instances 228 * @param end the upper bound of the range of model instances (not inclusive) 229 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 230 * @return the ordered range of matching rows 231 */ 232 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 233 int end, OrderByComparator<T> orderByComparator); 234 235 /** 236 * Returns a range of all the layout sets. 237 * 238 * <p> 239 * 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. 240 * </p> 241 * 242 * @param start the lower bound of the range of layout sets 243 * @param end the upper bound of the range of layout sets (not inclusive) 244 * @return the range of layout sets 245 */ 246 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 247 public List<LayoutSet> getLayoutSets(int start, int end); 248 249 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 250 public List<LayoutSet> getLayoutSetsByLayoutSetPrototypeUuid( 251 java.lang.String layoutSetPrototypeUuid); 252 253 /** 254 * Returns the number of rows matching the dynamic query. 255 * 256 * @param dynamicQuery the dynamic query 257 * @return the number of rows matching the dynamic query 258 */ 259 public long dynamicQueryCount(DynamicQuery dynamicQuery); 260 261 /** 262 * Returns the number of rows matching the dynamic query. 263 * 264 * @param dynamicQuery the dynamic query 265 * @param projection the projection to apply to the query 266 * @return the number of rows matching the dynamic query 267 */ 268 public long dynamicQueryCount(DynamicQuery dynamicQuery, 269 Projection projection); 270 271 public void deleteLayoutSet(long groupId, boolean privateLayout, 272 ServiceContext serviceContext) throws PortalException; 273 274 /** 275 * Updates the state of the layout set prototype link. 276 * 277 * @param groupId the primary key of the group 278 * @param privateLayout whether the layout set is private to the group 279 * @param layoutSetPrototypeLinkEnabled whether the layout set prototype is 280 link enabled 281 * @param layoutSetPrototypeUuid the uuid of the layout set prototype to 282 link with 283 */ 284 public void updateLayoutSetPrototypeLinkEnabled(long groupId, 285 boolean privateLayout, boolean layoutSetPrototypeLinkEnabled, 286 java.lang.String layoutSetPrototypeUuid) throws PortalException; 287 288 public void updateLookAndFeel(long groupId, java.lang.String themeId, 289 java.lang.String colorSchemeId, java.lang.String css) 290 throws PortalException; 291 }