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.LayoutRevision;
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.Serializable;
035    
036    import java.util.List;
037    
038    /**
039     * Provides the local service interface for LayoutRevision. Methods of this
040     * service will not have security checks based on the propagated JAAS
041     * credentials because this service can only be accessed from within the same
042     * VM.
043     *
044     * @author Brian Wing Shun Chan
045     * @see LayoutRevisionLocalServiceUtil
046     * @see com.liferay.portal.service.base.LayoutRevisionLocalServiceBaseImpl
047     * @see com.liferay.portal.service.impl.LayoutRevisionLocalServiceImpl
048     * @generated
049     */
050    @ProviderType
051    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
052            PortalException.class, SystemException.class})
053    public interface LayoutRevisionLocalService extends BaseLocalService,
054            PersistedModelLocalService {
055            /*
056             * NOTE FOR DEVELOPERS:
057             *
058             * Never modify or reference this interface directly. Always use {@link LayoutRevisionLocalServiceUtil} to access the layout revision local service. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutRevisionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
059             */
060            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
061            public ActionableDynamicQuery getActionableDynamicQuery();
062    
063            public DynamicQuery dynamicQuery();
064    
065            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
066            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
067    
068            /**
069            * Adds the layout revision to the database. Also notifies the appropriate model listeners.
070            *
071            * @param layoutRevision the layout revision
072            * @return the layout revision that was added
073            */
074            @Indexable(type = IndexableType.REINDEX)
075            public LayoutRevision addLayoutRevision(LayoutRevision layoutRevision);
076    
077            public LayoutRevision addLayoutRevision(long userId,
078                    long layoutSetBranchId, long layoutBranchId,
079                    long parentLayoutRevisionId, boolean head, long plid,
080                    long portletPreferencesPlid, boolean privateLayout,
081                    java.lang.String name, java.lang.String title,
082                    java.lang.String description, java.lang.String keywords,
083                    java.lang.String robots, java.lang.String typeSettings,
084                    boolean iconImage, long iconImageId, java.lang.String themeId,
085                    java.lang.String colorSchemeId, java.lang.String css,
086                    ServiceContext serviceContext) throws PortalException;
087    
088            /**
089            * Creates a new layout revision with the primary key. Does not add the layout revision to the database.
090            *
091            * @param layoutRevisionId the primary key for the new layout revision
092            * @return the new layout revision
093            */
094            public LayoutRevision createLayoutRevision(long layoutRevisionId);
095    
096            /**
097            * Deletes the layout revision from the database. Also notifies the appropriate model listeners.
098            *
099            * @param layoutRevision the layout revision
100            * @return the layout revision that was removed
101            * @throws PortalException
102            */
103            @Indexable(type = IndexableType.DELETE)
104            public LayoutRevision deleteLayoutRevision(LayoutRevision layoutRevision)
105                    throws PortalException;
106    
107            /**
108            * Deletes the layout revision with the primary key from the database. Also notifies the appropriate model listeners.
109            *
110            * @param layoutRevisionId the primary key of the layout revision
111            * @return the layout revision that was removed
112            * @throws PortalException if a layout revision with the primary key could not be found
113            */
114            @Indexable(type = IndexableType.DELETE)
115            public LayoutRevision deleteLayoutRevision(long layoutRevisionId)
116                    throws PortalException;
117    
118            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
119            public LayoutRevision fetchLastLayoutRevision(long plid, boolean head);
120    
121            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
122            public LayoutRevision fetchLatestLayoutRevision(long layoutSetBranchId,
123                    long plid);
124    
125            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
126            public LayoutRevision fetchLayoutRevision(long layoutRevisionId);
127    
128            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
129            public LayoutRevision fetchLayoutRevision(long layoutSetBranchId,
130                    boolean head, long plid);
131    
132            /**
133            * Returns the layout revision with the primary key.
134            *
135            * @param layoutRevisionId the primary key of the layout revision
136            * @return the layout revision
137            * @throws PortalException if a layout revision with the primary key could not be found
138            */
139            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
140            public LayoutRevision getLayoutRevision(long layoutRevisionId)
141                    throws PortalException;
142    
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public LayoutRevision getLayoutRevision(long layoutSetBranchId,
145                    long layoutBranchId, long plid) throws PortalException;
146    
147            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148            public LayoutRevision getLayoutRevision(long layoutSetBranchId, long plid,
149                    boolean head) throws PortalException;
150    
151            /**
152            * Updates the layout revision in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
153            *
154            * @param layoutRevision the layout revision
155            * @return the layout revision that was updated
156            */
157            @Indexable(type = IndexableType.REINDEX)
158            public LayoutRevision updateLayoutRevision(LayoutRevision layoutRevision);
159    
160            public LayoutRevision updateLayoutRevision(long userId,
161                    long layoutRevisionId, long layoutBranchId, java.lang.String name,
162                    java.lang.String title, java.lang.String description,
163                    java.lang.String keywords, java.lang.String robots,
164                    java.lang.String typeSettings, boolean iconImage, long iconImageId,
165                    java.lang.String themeId, java.lang.String colorSchemeId,
166                    java.lang.String css, ServiceContext serviceContext)
167                    throws PortalException;
168    
169            public LayoutRevision updateStatus(long userId, long layoutRevisionId,
170                    int status, ServiceContext serviceContext) throws PortalException;
171    
172            /**
173            * @throws PortalException
174            */
175            @Override
176            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
177                    throws PortalException;
178    
179            @Override
180            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
182                    throws PortalException;
183    
184            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
185            public int getChildLayoutRevisionsCount(long layoutSetBranchId,
186                    long parentLayoutRevision, long plid);
187    
188            /**
189            * Returns the number of layout revisions.
190            *
191            * @return the number of layout revisions
192            */
193            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
194            public int getLayoutRevisionsCount();
195    
196            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
197            public int getLayoutRevisionsCount(long layoutSetBranchId,
198                    long layoutBranchId, long plid);
199    
200            /**
201            * Returns the OSGi service identifier.
202            *
203            * @return the OSGi service identifier
204            */
205            public java.lang.String getOSGiServiceIdentifier();
206    
207            /**
208            * Performs a dynamic query on the database and returns the matching rows.
209            *
210            * @param dynamicQuery the dynamic query
211            * @return the matching rows
212            */
213            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
214    
215            /**
216            * Performs a dynamic query on the database and returns a range of the matching rows.
217            *
218            * <p>
219            * 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.LayoutRevisionModelImpl}. 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.
220            * </p>
221            *
222            * @param dynamicQuery the dynamic query
223            * @param start the lower bound of the range of model instances
224            * @param end the upper bound of the range of model instances (not inclusive)
225            * @return the range of matching rows
226            */
227            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
228                    int end);
229    
230            /**
231            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
232            *
233            * <p>
234            * 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.LayoutRevisionModelImpl}. 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.
235            * </p>
236            *
237            * @param dynamicQuery the dynamic query
238            * @param start the lower bound of the range of model instances
239            * @param end the upper bound of the range of model instances (not inclusive)
240            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
241            * @return the ordered range of matching rows
242            */
243            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
244                    int end, OrderByComparator<T> orderByComparator);
245    
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public List<LayoutRevision> getChildLayoutRevisions(
248                    long layoutSetBranchId, long parentLayoutRevision, long plid,
249                    int start, int end, OrderByComparator<LayoutRevision> orderByComparator);
250    
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public List<LayoutRevision> getChildLayoutRevisions(
253                    long layoutSetBranchId, long parentLayoutRevisionId, long plid);
254    
255            /**
256            * Returns a range of all the layout revisions.
257            *
258            * <p>
259            * 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.LayoutRevisionModelImpl}. 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.
260            * </p>
261            *
262            * @param start the lower bound of the range of layout revisions
263            * @param end the upper bound of the range of layout revisions (not inclusive)
264            * @return the range of layout revisions
265            */
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public List<LayoutRevision> getLayoutRevisions(int start, int end);
268    
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public List<LayoutRevision> getLayoutRevisions(long layoutSetBranchId,
271                    boolean head);
272    
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public List<LayoutRevision> getLayoutRevisions(long layoutSetBranchId,
275                    int status);
276    
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public List<LayoutRevision> getLayoutRevisions(long layoutSetBranchId,
279                    long layoutBranchId, long plid, int start, int end,
280                    OrderByComparator<LayoutRevision> orderByComparator);
281    
282            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
283            public List<LayoutRevision> getLayoutRevisions(long layoutSetBranchId,
284                    long plid);
285    
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public List<LayoutRevision> getLayoutRevisions(long layoutSetBranchId,
288                    long plid, int start, int end,
289                    OrderByComparator<LayoutRevision> orderByComparator);
290    
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public List<LayoutRevision> getLayoutRevisions(long layoutSetBranchId,
293                    long plid, int status);
294    
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public List<LayoutRevision> getLayoutRevisions(long plid);
297    
298            /**
299            * Returns the number of rows matching the dynamic query.
300            *
301            * @param dynamicQuery the dynamic query
302            * @return the number of rows matching the dynamic query
303            */
304            public long dynamicQueryCount(DynamicQuery dynamicQuery);
305    
306            /**
307            * Returns the number of rows matching the dynamic query.
308            *
309            * @param dynamicQuery the dynamic query
310            * @param projection the projection to apply to the query
311            * @return the number of rows matching the dynamic query
312            */
313            public long dynamicQueryCount(DynamicQuery dynamicQuery,
314                    Projection projection);
315    
316            public void deleteLayoutLayoutRevisions(long plid)
317                    throws PortalException;
318    
319            public void deleteLayoutRevisions(long layoutSetBranchId,
320                    long layoutBranchId, long plid) throws PortalException;
321    
322            public void deleteLayoutRevisions(long layoutSetBranchId, long plid)
323                    throws PortalException;
324    
325            public void deleteLayoutSetBranchLayoutRevisions(long layoutSetBranchId)
326                    throws PortalException;
327    }