001    /**
002     * Copyright (c) 2000-2012 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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the layout revision local service. This utility wraps {@link com.liferay.portal.service.impl.LayoutRevisionLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see LayoutRevisionLocalService
030     * @see com.liferay.portal.service.base.LayoutRevisionLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.LayoutRevisionLocalServiceImpl
032     * @generated
033     */
034    public class LayoutRevisionLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutRevisionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the layout revision to the database. Also notifies the appropriate model listeners.
043            *
044            * @param layoutRevision the layout revision
045            * @return the layout revision that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.LayoutRevision addLayoutRevision(
049                    com.liferay.portal.model.LayoutRevision layoutRevision)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addLayoutRevision(layoutRevision);
052            }
053    
054            /**
055            * Creates a new layout revision with the primary key. Does not add the layout revision to the database.
056            *
057            * @param layoutRevisionId the primary key for the new layout revision
058            * @return the new layout revision
059            */
060            public static com.liferay.portal.model.LayoutRevision createLayoutRevision(
061                    long layoutRevisionId) {
062                    return getService().createLayoutRevision(layoutRevisionId);
063            }
064    
065            /**
066            * Deletes the layout revision with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param layoutRevisionId the primary key of the layout revision
069            * @throws PortalException if a layout revision with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteLayoutRevision(long layoutRevisionId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteLayoutRevision(layoutRevisionId);
076            }
077    
078            /**
079            * Deletes the layout revision from the database. Also notifies the appropriate model listeners.
080            *
081            * @param layoutRevision the layout revision
082            * @throws PortalException
083            * @throws SystemException if a system exception occurred
084            */
085            public static void deleteLayoutRevision(
086                    com.liferay.portal.model.LayoutRevision layoutRevision)
087                    throws com.liferay.portal.kernel.exception.PortalException,
088                            com.liferay.portal.kernel.exception.SystemException {
089                    getService().deleteLayoutRevision(layoutRevision);
090            }
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public static java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().dynamicQuery(dynamicQuery);
104            }
105    
106            /**
107            * Performs a dynamic query on the database and returns a range of the matching rows.
108            *
109            * <p>
110            * 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.
111            * </p>
112            *
113            * @param dynamicQuery the dynamic query
114            * @param start the lower bound of the range of model instances
115            * @param end the upper bound of the range of model instances (not inclusive)
116            * @return the range of matching rows
117            * @throws SystemException if a system exception occurred
118            */
119            @SuppressWarnings("rawtypes")
120            public static java.util.List dynamicQuery(
121                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122                    int end) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().dynamicQuery(dynamicQuery, start, end);
124            }
125    
126            /**
127            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
128            *
129            * <p>
130            * 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.
131            * </p>
132            *
133            * @param dynamicQuery the dynamic query
134            * @param start the lower bound of the range of model instances
135            * @param end the upper bound of the range of model instances (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching rows
138            * @throws SystemException if a system exception occurred
139            */
140            @SuppressWarnings("rawtypes")
141            public static java.util.List dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143                    int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
148            }
149    
150            /**
151            * Returns the number of rows that match the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows that match the dynamic query
155            * @throws SystemException if a system exception occurred
156            */
157            public static long dynamicQueryCount(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getService().dynamicQueryCount(dynamicQuery);
161            }
162    
163            public static com.liferay.portal.model.LayoutRevision fetchLayoutRevision(
164                    long layoutRevisionId)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getService().fetchLayoutRevision(layoutRevisionId);
167            }
168    
169            /**
170            * Returns the layout revision with the primary key.
171            *
172            * @param layoutRevisionId the primary key of the layout revision
173            * @return the layout revision
174            * @throws PortalException if a layout revision with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portal.model.LayoutRevision getLayoutRevision(
178                    long layoutRevisionId)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getService().getLayoutRevision(layoutRevisionId);
182            }
183    
184            public static com.liferay.portal.model.PersistedModel getPersistedModel(
185                    java.io.Serializable primaryKeyObj)
186                    throws com.liferay.portal.kernel.exception.PortalException,
187                            com.liferay.portal.kernel.exception.SystemException {
188                    return getService().getPersistedModel(primaryKeyObj);
189            }
190    
191            /**
192            * Returns a range of all the layout revisions.
193            *
194            * <p>
195            * 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.
196            * </p>
197            *
198            * @param start the lower bound of the range of layout revisions
199            * @param end the upper bound of the range of layout revisions (not inclusive)
200            * @return the range of layout revisions
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portal.model.LayoutRevision> getLayoutRevisions(
204                    int start, int end)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getService().getLayoutRevisions(start, end);
207            }
208    
209            /**
210            * Returns the number of layout revisions.
211            *
212            * @return the number of layout revisions
213            * @throws SystemException if a system exception occurred
214            */
215            public static int getLayoutRevisionsCount()
216                    throws com.liferay.portal.kernel.exception.SystemException {
217                    return getService().getLayoutRevisionsCount();
218            }
219    
220            /**
221            * Updates the layout revision in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
222            *
223            * @param layoutRevision the layout revision
224            * @return the layout revision that was updated
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portal.model.LayoutRevision updateLayoutRevision(
228                    com.liferay.portal.model.LayoutRevision layoutRevision)
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return getService().updateLayoutRevision(layoutRevision);
231            }
232    
233            /**
234            * Updates the layout revision in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
235            *
236            * @param layoutRevision the layout revision
237            * @param merge whether to merge the layout revision with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
238            * @return the layout revision that was updated
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portal.model.LayoutRevision updateLayoutRevision(
242                    com.liferay.portal.model.LayoutRevision layoutRevision, boolean merge)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().updateLayoutRevision(layoutRevision, merge);
245            }
246    
247            /**
248            * Returns the Spring bean ID for this bean.
249            *
250            * @return the Spring bean ID for this bean
251            */
252            public static java.lang.String getBeanIdentifier() {
253                    return getService().getBeanIdentifier();
254            }
255    
256            /**
257            * Sets the Spring bean ID for this bean.
258            *
259            * @param beanIdentifier the Spring bean ID for this bean
260            */
261            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
262                    getService().setBeanIdentifier(beanIdentifier);
263            }
264    
265            public static com.liferay.portal.model.LayoutRevision addLayoutRevision(
266                    long userId, long layoutSetBranchId, long layoutBranchId,
267                    long parentLayoutRevisionId, boolean head, long plid,
268                    long portletPreferencesPlid, boolean privateLayout,
269                    java.lang.String name, java.lang.String title,
270                    java.lang.String description, java.lang.String keywords,
271                    java.lang.String robots, java.lang.String typeSettings,
272                    boolean iconImage, long iconImageId, java.lang.String themeId,
273                    java.lang.String colorSchemeId, java.lang.String wapThemeId,
274                    java.lang.String wapColorSchemeId, java.lang.String css,
275                    com.liferay.portal.service.ServiceContext serviceContext)
276                    throws com.liferay.portal.kernel.exception.PortalException,
277                            com.liferay.portal.kernel.exception.SystemException {
278                    return getService()
279                                       .addLayoutRevision(userId, layoutSetBranchId,
280                            layoutBranchId, parentLayoutRevisionId, head, plid,
281                            portletPreferencesPlid, privateLayout, name, title, description,
282                            keywords, robots, typeSettings, iconImage, iconImageId, themeId,
283                            colorSchemeId, wapThemeId, wapColorSchemeId, css, serviceContext);
284            }
285    
286            public static void deleteLayoutLayoutRevisions(long plid)
287                    throws com.liferay.portal.kernel.exception.PortalException,
288                            com.liferay.portal.kernel.exception.SystemException {
289                    getService().deleteLayoutLayoutRevisions(plid);
290            }
291    
292            public static void deleteLayoutRevisions(long layoutSetBranchId, long plid)
293                    throws com.liferay.portal.kernel.exception.PortalException,
294                            com.liferay.portal.kernel.exception.SystemException {
295                    getService().deleteLayoutRevisions(layoutSetBranchId, plid);
296            }
297    
298            public static void deleteLayoutRevisions(long layoutSetBranchId,
299                    long layoutBranchId, long plid)
300                    throws com.liferay.portal.kernel.exception.PortalException,
301                            com.liferay.portal.kernel.exception.SystemException {
302                    getService()
303                            .deleteLayoutRevisions(layoutSetBranchId, layoutBranchId, plid);
304            }
305    
306            public static void deleteLayoutSetBranchLayoutRevisions(
307                    long layoutSetBranchId)
308                    throws com.liferay.portal.kernel.exception.PortalException,
309                            com.liferay.portal.kernel.exception.SystemException {
310                    getService().deleteLayoutSetBranchLayoutRevisions(layoutSetBranchId);
311            }
312    
313            public static com.liferay.portal.model.LayoutRevision fetchLastLayoutRevision(
314                    long plid, boolean head)
315                    throws com.liferay.portal.kernel.exception.SystemException {
316                    return getService().fetchLastLayoutRevision(plid, head);
317            }
318    
319            public static java.util.List<com.liferay.portal.model.LayoutRevision> getChildLayoutRevisions(
320                    long layoutSetBranchId, long parentLayoutRevisionId, long plid)
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getService()
323                                       .getChildLayoutRevisions(layoutSetBranchId,
324                            parentLayoutRevisionId, plid);
325            }
326    
327            public static java.util.List<com.liferay.portal.model.LayoutRevision> getChildLayoutRevisions(
328                    long layoutSetBranchId, long parentLayoutRevision, long plid,
329                    int start, int end,
330                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
331                    throws com.liferay.portal.kernel.exception.SystemException {
332                    return getService()
333                                       .getChildLayoutRevisions(layoutSetBranchId,
334                            parentLayoutRevision, plid, start, end, orderByComparator);
335            }
336    
337            public static int getChildLayoutRevisionsCount(long layoutSetBranchId,
338                    long parentLayoutRevision, long plid)
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getService()
341                                       .getChildLayoutRevisionsCount(layoutSetBranchId,
342                            parentLayoutRevision, plid);
343            }
344    
345            public static com.liferay.portal.model.LayoutRevision getLayoutRevision(
346                    long layoutSetBranchId, long plid, boolean head)
347                    throws com.liferay.portal.kernel.exception.PortalException,
348                            com.liferay.portal.kernel.exception.SystemException {
349                    return getService().getLayoutRevision(layoutSetBranchId, plid, head);
350            }
351    
352            public static com.liferay.portal.model.LayoutRevision getLayoutRevision(
353                    long layoutSetBranchId, long layoutBranchId, long plid)
354                    throws com.liferay.portal.kernel.exception.PortalException,
355                            com.liferay.portal.kernel.exception.SystemException {
356                    return getService()
357                                       .getLayoutRevision(layoutSetBranchId, layoutBranchId, plid);
358            }
359    
360            public static java.util.List<com.liferay.portal.model.LayoutRevision> getLayoutRevisions(
361                    long plid) throws com.liferay.portal.kernel.exception.SystemException {
362                    return getService().getLayoutRevisions(plid);
363            }
364    
365            public static java.util.List<com.liferay.portal.model.LayoutRevision> getLayoutRevisions(
366                    long layoutSetBranchId, boolean head)
367                    throws com.liferay.portal.kernel.exception.SystemException {
368                    return getService().getLayoutRevisions(layoutSetBranchId, head);
369            }
370    
371            public static java.util.List<com.liferay.portal.model.LayoutRevision> getLayoutRevisions(
372                    long layoutSetBranchId, int status)
373                    throws com.liferay.portal.kernel.exception.SystemException {
374                    return getService().getLayoutRevisions(layoutSetBranchId, status);
375            }
376    
377            public static java.util.List<com.liferay.portal.model.LayoutRevision> getLayoutRevisions(
378                    long layoutSetBranchId, long plid)
379                    throws com.liferay.portal.kernel.exception.SystemException {
380                    return getService().getLayoutRevisions(layoutSetBranchId, plid);
381            }
382    
383            public static java.util.List<com.liferay.portal.model.LayoutRevision> getLayoutRevisions(
384                    long layoutSetBranchId, long plid, int status)
385                    throws com.liferay.portal.kernel.exception.SystemException {
386                    return getService().getLayoutRevisions(layoutSetBranchId, plid, status);
387            }
388    
389            public static java.util.List<com.liferay.portal.model.LayoutRevision> getLayoutRevisions(
390                    long layoutSetBranchId, long layoutBranchId, long plid, int start,
391                    int end,
392                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getService()
395                                       .getLayoutRevisions(layoutSetBranchId, layoutBranchId, plid,
396                            start, end, orderByComparator);
397            }
398    
399            public static int getLayoutRevisionsCount(long layoutSetBranchId,
400                    long layoutBranchId, long plid)
401                    throws com.liferay.portal.kernel.exception.SystemException {
402                    return getService()
403                                       .getLayoutRevisionsCount(layoutSetBranchId, layoutBranchId,
404                            plid);
405            }
406    
407            public static com.liferay.portal.model.LayoutRevision updateLayoutRevision(
408                    long userId, long layoutRevisionId, long layoutBranchId,
409                    java.lang.String name, java.lang.String title,
410                    java.lang.String description, java.lang.String keywords,
411                    java.lang.String robots, java.lang.String typeSettings,
412                    boolean iconImage, long iconImageId, java.lang.String themeId,
413                    java.lang.String colorSchemeId, java.lang.String wapThemeId,
414                    java.lang.String wapColorSchemeId, java.lang.String css,
415                    com.liferay.portal.service.ServiceContext serviceContext)
416                    throws com.liferay.portal.kernel.exception.PortalException,
417                            com.liferay.portal.kernel.exception.SystemException {
418                    return getService()
419                                       .updateLayoutRevision(userId, layoutRevisionId,
420                            layoutBranchId, name, title, description, keywords, robots,
421                            typeSettings, iconImage, iconImageId, themeId, colorSchemeId,
422                            wapThemeId, wapColorSchemeId, css, serviceContext);
423            }
424    
425            public static com.liferay.portal.model.LayoutRevision updateStatus(
426                    long userId, long layoutRevisionId, int status,
427                    com.liferay.portal.service.ServiceContext serviceContext)
428                    throws com.liferay.portal.kernel.exception.PortalException,
429                            com.liferay.portal.kernel.exception.SystemException {
430                    return getService()
431                                       .updateStatus(userId, layoutRevisionId, status,
432                            serviceContext);
433            }
434    
435            public static LayoutRevisionLocalService getService() {
436                    if (_service == null) {
437                            _service = (LayoutRevisionLocalService)PortalBeanLocatorUtil.locate(LayoutRevisionLocalService.class.getName());
438    
439                            ReferenceRegistry.registerReference(LayoutRevisionLocalServiceUtil.class,
440                                    "_service");
441                            MethodCache.remove(LayoutRevisionLocalService.class);
442                    }
443    
444                    return _service;
445            }
446    
447            public void setService(LayoutRevisionLocalService service) {
448                    MethodCache.remove(LayoutRevisionLocalService.class);
449    
450                    _service = service;
451    
452                    ReferenceRegistry.registerReference(LayoutRevisionLocalServiceUtil.class,
453                            "_service");
454                    MethodCache.remove(LayoutRevisionLocalService.class);
455            }
456    
457            private static LayoutRevisionLocalService _service;
458    }