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.PersistedModel;
026    import com.liferay.portal.kernel.model.Portlet;
027    import com.liferay.portal.kernel.model.PortletPreferences;
028    import com.liferay.portal.kernel.model.PortletPreferencesIds;
029    import com.liferay.portal.kernel.search.Indexable;
030    import com.liferay.portal.kernel.search.IndexableType;
031    import com.liferay.portal.kernel.spring.aop.Property;
032    import com.liferay.portal.kernel.spring.aop.Retry;
033    import com.liferay.portal.kernel.spring.aop.Skip;
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    
043    /**
044     * Provides the local service interface for PortletPreferences. Methods of this
045     * service will not have security checks based on the propagated JAAS
046     * credentials because this service can only be accessed from within the same
047     * VM.
048     *
049     * @author Brian Wing Shun Chan
050     * @see PortletPreferencesLocalServiceUtil
051     * @see com.liferay.portal.service.base.PortletPreferencesLocalServiceBaseImpl
052     * @see com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl
053     * @generated
054     */
055    @ProviderType
056    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
057            PortalException.class, SystemException.class})
058    public interface PortletPreferencesLocalService extends BaseLocalService,
059            PersistedModelLocalService {
060            /*
061             * NOTE FOR DEVELOPERS:
062             *
063             * Never modify or reference this interface directly. Always use {@link PortletPreferencesLocalServiceUtil} to access the portlet preferences local service. Add custom service methods to {@link com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
064             */
065            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
066            public ActionableDynamicQuery getActionableDynamicQuery();
067    
068            public DynamicQuery dynamicQuery();
069    
070            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
071            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
072    
073            /**
074            * @throws PortalException
075            */
076            @Override
077            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
078                    throws PortalException;
079    
080            @Override
081            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
082            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
083                    throws PortalException;
084    
085            /**
086            * Adds the portlet preferences to the database. Also notifies the appropriate model listeners.
087            *
088            * @param portletPreferences the portlet preferences
089            * @return the portlet preferences that was added
090            */
091            @Indexable(type = IndexableType.REINDEX)
092            public PortletPreferences addPortletPreferences(
093                    PortletPreferences portletPreferences);
094    
095            public PortletPreferences addPortletPreferences(long companyId,
096                    long ownerId, int ownerType, long plid, java.lang.String portletId,
097                    Portlet portlet, java.lang.String defaultPreferences);
098    
099            /**
100            * Creates a new portlet preferences with the primary key. Does not add the portlet preferences to the database.
101            *
102            * @param portletPreferencesId the primary key for the new portlet preferences
103            * @return the new portlet preferences
104            */
105            public PortletPreferences createPortletPreferences(
106                    long portletPreferencesId);
107    
108            /**
109            * Deletes the portlet preferences from the database. Also notifies the appropriate model listeners.
110            *
111            * @param portletPreferences the portlet preferences
112            * @return the portlet preferences that was removed
113            */
114            @Indexable(type = IndexableType.DELETE)
115            public PortletPreferences deletePortletPreferences(
116                    PortletPreferences portletPreferences);
117    
118            /**
119            * Deletes the portlet preferences with the primary key from the database. Also notifies the appropriate model listeners.
120            *
121            * @param portletPreferencesId the primary key of the portlet preferences
122            * @return the portlet preferences that was removed
123            * @throws PortalException if a portlet preferences with the primary key could not be found
124            */
125            @Indexable(type = IndexableType.DELETE)
126            public PortletPreferences deletePortletPreferences(
127                    long portletPreferencesId) throws PortalException;
128    
129            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
130            public PortletPreferences fetchPortletPreferences(long portletPreferencesId);
131    
132            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
133            public PortletPreferences getPortletPreferences(long ownerId,
134                    int ownerType, long plid, java.lang.String portletId)
135                    throws PortalException;
136    
137            /**
138            * Returns the portlet preferences with the primary key.
139            *
140            * @param portletPreferencesId the primary key of the portlet preferences
141            * @return the portlet preferences
142            * @throws PortalException if a portlet preferences with the primary key could not be found
143            */
144            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
145            public PortletPreferences getPortletPreferences(long portletPreferencesId)
146                    throws PortalException;
147    
148            /**
149            * Updates the portlet preferences in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
150            *
151            * @param portletPreferences the portlet preferences
152            * @return the portlet preferences that was updated
153            */
154            @Indexable(type = IndexableType.REINDEX)
155            public PortletPreferences updatePortletPreferences(
156                    PortletPreferences portletPreferences);
157    
158            public PortletPreferences updatePreferences(long ownerId, int ownerType,
159                    long plid, java.lang.String portletId, java.lang.String xml);
160    
161            public PortletPreferences updatePreferences(long ownerId, int ownerType,
162                    long plid, java.lang.String portletId,
163                    javax.portlet.PortletPreferences portletPreferences);
164    
165            /**
166            * Returns the number of portlet preferenceses.
167            *
168            * @return the number of portlet preferenceses
169            */
170            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171            public int getPortletPreferencesesCount();
172    
173            /**
174            * Returns the OSGi service identifier.
175            *
176            * @return the OSGi service identifier
177            */
178            public java.lang.String getOSGiServiceIdentifier();
179    
180            /**
181            * Performs a dynamic query on the database and returns the matching rows.
182            *
183            * @param dynamicQuery the dynamic query
184            * @return the matching rows
185            */
186            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
187    
188            /**
189            * Performs a dynamic query on the database and returns a range of the matching rows.
190            *
191            * <p>
192            * 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.PortletPreferencesModelImpl}. 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.
193            * </p>
194            *
195            * @param dynamicQuery the dynamic query
196            * @param start the lower bound of the range of model instances
197            * @param end the upper bound of the range of model instances (not inclusive)
198            * @return the range of matching rows
199            */
200            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
201                    int end);
202    
203            /**
204            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
205            *
206            * <p>
207            * 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.PortletPreferencesModelImpl}. 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.
208            * </p>
209            *
210            * @param dynamicQuery the dynamic query
211            * @param start the lower bound of the range of model instances
212            * @param end the upper bound of the range of model instances (not inclusive)
213            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
214            * @return the ordered range of matching rows
215            */
216            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
217                    int end, OrderByComparator<T> orderByComparator);
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public List<PortletPreferences> getPortletPreferences();
221    
222            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
223            public List<PortletPreferences> getPortletPreferences(int ownerType,
224                    long plid, java.lang.String portletId);
225    
226            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227            public List<PortletPreferences> getPortletPreferences(long companyId,
228                    long groupId, long ownerId, int ownerType, java.lang.String portletId,
229                    boolean privateLayout);
230    
231            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232            public List<PortletPreferences> getPortletPreferences(long ownerId,
233                    int ownerType, long plid);
234    
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public List<PortletPreferences> getPortletPreferences(long plid,
237                    java.lang.String portletId);
238    
239            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240            public List<PortletPreferences> getPortletPreferencesByPlid(long plid);
241    
242            /**
243            * Returns a range of all the portlet preferenceses.
244            *
245            * <p>
246            * 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.PortletPreferencesModelImpl}. 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.
247            * </p>
248            *
249            * @param start the lower bound of the range of portlet preferenceses
250            * @param end the upper bound of the range of portlet preferenceses (not inclusive)
251            * @return the range of portlet preferenceses
252            */
253            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254            public List<PortletPreferences> getPortletPreferenceses(int start, int end);
255    
256            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
257            public javax.portlet.PortletPreferences fetchPreferences(
258                    PortletPreferencesIds portletPreferencesIds);
259    
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public javax.portlet.PortletPreferences fetchPreferences(long companyId,
262                    long ownerId, int ownerType, long plid, java.lang.String portletId);
263    
264            @Skip
265            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266            public javax.portlet.PortletPreferences getDefaultPreferences(
267                    long companyId, java.lang.String portletId);
268    
269            @Retry(acceptor = ExceptionRetryAcceptor.class, properties =  {
270                    @Property(name = ExceptionRetryAcceptor.EXCEPTION_NAME, value = "org.springframework.dao.DataIntegrityViolationException")
271            }
272            )
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public javax.portlet.PortletPreferences getPreferences(
275                    PortletPreferencesIds portletPreferencesIds);
276    
277            @Retry(acceptor = ExceptionRetryAcceptor.class, properties =  {
278                    @Property(name = ExceptionRetryAcceptor.EXCEPTION_NAME, value = "org.springframework.dao.DataIntegrityViolationException")
279            }
280            )
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public javax.portlet.PortletPreferences getPreferences(long companyId,
283                    long ownerId, int ownerType, long plid, java.lang.String portletId);
284    
285            @Retry(acceptor = ExceptionRetryAcceptor.class, properties =  {
286                    @Property(name = ExceptionRetryAcceptor.EXCEPTION_NAME, value = "org.springframework.dao.DataIntegrityViolationException")
287            }
288            )
289            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
290            public javax.portlet.PortletPreferences getPreferences(long companyId,
291                    long ownerId, int ownerType, long plid, java.lang.String portletId,
292                    java.lang.String defaultPreferences);
293    
294            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
295            public javax.portlet.PortletPreferences getStrictPreferences(
296                    PortletPreferencesIds portletPreferencesIds);
297    
298            @Retry(acceptor = ExceptionRetryAcceptor.class, properties =  {
299                    @Property(name = ExceptionRetryAcceptor.EXCEPTION_NAME, value = "org.springframework.dao.DataIntegrityViolationException")
300            }
301            )
302            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
303            public javax.portlet.PortletPreferences getStrictPreferences(
304                    long companyId, long ownerId, int ownerType, long plid,
305                    java.lang.String portletId);
306    
307            /**
308            * Returns the number of rows matching the dynamic query.
309            *
310            * @param dynamicQuery the dynamic query
311            * @return the number of rows matching the dynamic query
312            */
313            public long dynamicQueryCount(DynamicQuery dynamicQuery);
314    
315            /**
316            * Returns the number of rows matching the dynamic query.
317            *
318            * @param dynamicQuery the dynamic query
319            * @param projection the projection to apply to the query
320            * @return the number of rows matching the dynamic query
321            */
322            public long dynamicQueryCount(DynamicQuery dynamicQuery,
323                    Projection projection);
324    
325            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326            public long getPortletPreferencesCount(int ownerType,
327                    java.lang.String portletId);
328    
329            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330            public long getPortletPreferencesCount(int ownerType, long plid,
331                    java.lang.String portletId);
332    
333            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
334            public long getPortletPreferencesCount(long ownerId, int ownerType,
335                    java.lang.String portletId, boolean excludeDefaultPreferences);
336    
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public long getPortletPreferencesCount(long ownerId, int ownerType,
339                    long plid, Portlet portlet, boolean excludeDefaultPreferences);
340    
341            public void deletePortletPreferences(long ownerId, int ownerType, long plid);
342    
343            public void deletePortletPreferences(long ownerId, int ownerType,
344                    long plid, java.lang.String portletId) throws PortalException;
345    
346            public void deletePortletPreferencesByPlid(long plid);
347    }