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